Commit 6761e652 authored by iwakeh's avatar iwakeh 🌴
Browse files

squash! Keep annotations of given descriptors.

Add more test data variety, rename variables verbosely, and add changelog entry.
parent d539c694
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@

 * Medium changes
   - Fix a bug while sanitizing bridge network statuses without entries.

   - Keep annotations provided by the descriptor and only add the
     default annotation, when there was none.

# Changes in version 1.2.0 - 2017-07-12

+8 −8
Original line number Diff line number Diff line
@@ -33,17 +33,17 @@ public abstract class DescriptorPersistence<T extends Descriptor> {
  protected String recentPath;

  /** Initializes the paths for storing descriptors of type <code>T</code>. */
  protected DescriptorPersistence(T desc, byte[] annotation) {
  protected DescriptorPersistence(T desc, byte[] defaultAnnotation) {
    this.desc = desc;
    List<String> annos = desc.getAnnotations();
    if (annos.isEmpty()) {
      this.annotation = annotation;
    List<String> annotations = desc.getAnnotations();
    if (annotations.isEmpty()) {
      this.annotation = defaultAnnotation;
    } else {
      StringBuilder res = new StringBuilder("");
      for (String anno : annos) {
        res.append(anno).append("\n");
      StringBuilder sb = new StringBuilder("");
      for (String annotation : annotations) {
        sb.append(annotation).append("\n");
      }
      this.annotation = res.toString().getBytes();
      this.annotation = sb.toString().getBytes();
    }
  }

+7 −0
Original line number Diff line number Diff line
@@ -145,6 +145,13 @@ bridge-ip-transports <OR>=8,obfs3=8,obfs4=48
router-digest-sha256 b/PO7nPdxo+we9Tr/dQt2hAyu1TbtAWdjzac3CWYzpg
router-digest BCFCBB38B15E9B500B1A6E9B0BCBBCE858660F17
@type bridge-extra-info 1.3
@many more annotations
@one
@two
@three
@four
@five and
@last and final
extra-info Unnamed 1283EDA3E80CA2D485CCFEDB9715392396DFAD29
master-key-ed25519 5GUbxrSHFtj6QjHHx5ovS2gAh8/ZjtbjU4yjULS0l0s
published 2016-10-02 06:09:43
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ BUILDTIMES=0.658563137054,1.08981704712,1.52948904037 CIRC_ID=1166 CONNECT=14756
BUILDTIMES=0.696699857712,0.833825826645,0.981504917145 CIRC_ID=1172 CONNECT=1475627521.53 DATACOMPLETE=1475627523.30 DATAPERC10=1475627522.45 DATAPERC20=1475627522.57 DATAPERC30=1475627522.68 DATAPERC40=1475627522.73 DATAPERC50=1475627522.85 DATAPERC60=1475627522.93 DATAPERC70=1475627523.04 DATAPERC80=1475627523.05 DATAPERC90=1475627523.21 DATAREQUEST=1475627521.87 DATARESPONSE=1475627522.12 DIDTIMEOUT=0 FILESIZE=1048576 LAUNCH=1475626321.13 NEGOTIATE=1475627521.53 PATH=$B411027C926A9BFFCF7DA91E3CAF1856A321EFFD,$02928855BFAD787F8B363F21860D1E7D156E0655,$95DA61AEF23A6C851028C1AA88AD8593F659E60F QUANTILE=0.800000 READBYTES=1048873 REQUEST=1475627521.53 RESPONSE=1475627521.87 SOCKET=1475627521.53 SOURCE=moria START=1475627521.53 TIMEOUT=1500 USED_AT=1475627523.30 USED_BY=2771 WRITEBYTES=74
@type torperf 1.0
BUILDTIMES=0.574013948441,0.694298028946,0.844352960587 CIRC_ID=1173 CONNECT=1475629321.12 DATACOMPLETE=1475629323.34 DATAPERC10=1475629322.05 DATAPERC20=1475629322.18 DATAPERC30=1475629322.26 DATAPERC40=1475629322.44 DATAPERC50=1475629322.58 DATAPERC60=1475629322.76 DATAPERC70=1475629322.90 DATAPERC80=1475629323.13 DATAPERC90=1475629323.24 DATAREQUEST=1475629321.47 DATARESPONSE=1475629321.71 DIDTIMEOUT=0 FILESIZE=1048576 LAUNCH=1475628121.66 NEGOTIATE=1475629321.12 PATH=$20462CBA5DA4C2D963567D17D0B7249718114A68,$480CCC94CEA04D2DEABC0D7373868E245D4C2AE2,$E1E922A20AF608728824A620BADC6EFC8CB8C2B8 QUANTILE=0.800000 READBYTES=1048873 REQUEST=1475629321.12 RESPONSE=1475629321.47 SOCKET=1475629321.12 SOURCE=moria START=1475629321.12 TIMEOUT=1500 USED_AT=1475629323.35 USED_BY=2773 WRITEBYTES=74
@type torperf 1.0
@type torperf 0.9
BUILDTIMES=0.573640108109,0.690929174423,0.906491041183 CIRC_ID=1175 CONNECT=1475631121.93 DATACOMPLETE=1475631124.21 DATAPERC10=1475631122.88 DATAPERC20=1475631123.01 DATAPERC30=1475631123.11 DATAPERC40=1475631123.30 DATAPERC50=1475631123.40 DATAPERC60=1475631123.55 DATAPERC70=1475631123.69 DATAPERC80=1475631123.80 DATAPERC90=1475631123.97 DATAREQUEST=1475631122.27 DATARESPONSE=1475631122.54 DIDTIMEOUT=0 FILESIZE=1048576 LAUNCH=1475629921.18 NEGOTIATE=1475631121.93 PATH=$183C2E314DD677D28CDB6839A0204C4276F6E32D,$360911BEBE036BE7D0BA45B8FC07FF50119EB5B0,$47BAD834309368640EA066913DF741AF413EDE5E QUANTILE=0.800000 READBYTES=1048873 REQUEST=1475631121.93 RESPONSE=1475631122.27 SOCKET=1475631121.93 SOURCE=moria START=1475631121.93 TIMEOUT=1500 USED_AT=1475631124.22 USED_BY=2776 WRITEBYTES=74
@type torperf 1.0
BUILDTIMES=0.578256845474,0.696436882019,0.842072963715 CIRC_ID=1176 CONNECT=1475632921.76 DATACOMPLETE=1475632923.47 DATAPERC10=1475632922.60 DATAPERC20=1475632922.69 DATAPERC30=1475632922.78 DATAPERC40=1475632922.90 DATAPERC50=1475632922.94 DATAPERC60=1475632923.03 DATAPERC70=1475632923.11 DATAPERC80=1475632923.23 DATAPERC90=1475632923.32 DATAREQUEST=1475632922.05 DATARESPONSE=1475632922.29 DIDTIMEOUT=0 FILESIZE=1048576 LAUNCH=1475631721.73 NEGOTIATE=1475632921.76 PATH=$888933294902B310106CF68C012ECDD110114452,$7961C9991F022C8A363FD440CA395D47DB5D44D5,$F65E0196C94DFFF48AFBF2F5F9E3E19AAE583FD0 QUANTILE=0.800000 READBYTES=1048873 REQUEST=1475632921.76 RESPONSE=1475632922.05 SOCKET=1475632921.76 SOURCE=moria START=1475632921.76 TIMEOUT=1500 USED_AT=1475632923.48 USED_BY=2799 WRITEBYTES=74