Commit bd5b45a7 authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Add "version" field to details documents.

Add a "version" field to relay details documents with the Tor software
version listed in the consensus and similarly to bridge details
documents with the Tor software version found in the server
descriptor.

Implements #22488.
parent e118782c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
# Changes in version 4.4-1.8.0 - 2017-??-??

 * Medium changes
   - Add a "version" field to relay details documents with the Tor
     software version listed in the consensus and similarly to bridge
     details documents with the Tor software version found in the
     server descriptor.


# Changes in version 4.3-1.7.1 - 2017-11-17

 * Minor changes
+10 −0
Original line number Diff line number Diff line
@@ -346,6 +346,16 @@ public class DetailsDocument extends Document {
    return unescapeJson(this.platform);
  }

  private String version;

  public void setVersion(String version) {
    this.version = version;
  }

  public String getVersion() {
    return this.version;
  }

  private SortedSet<String> alleged_family;

  public void setAllegedFamily(SortedSet<String> allegedFamily) {
+10 −0
Original line number Diff line number Diff line
@@ -540,5 +540,15 @@ public class DetailsStatus extends Document {
  public List<String> getAdvertisedOrAddresses() {
    return this.advertised_or_addresses;
  }

  private String version;

  public void setVersion(String version) {
    this.version = version;
  }

  public String getVersion() {
    return this.version;
  }
}
+1 −2
Original line number Diff line number Diff line
@@ -324,8 +324,7 @@ public class NodeStatus extends Document {
  private String version;

  public void setVersion(String version) {
    this.version = null == version ? null
        : version.substring(version.lastIndexOf(" ") + 1);
    this.version = version;
  }

  public String getVersion() {
+2 −0
Original line number Diff line number Diff line
@@ -342,6 +342,8 @@ public class ResponseBuilder {
          } else if (field.equals("unreachable_or_addresses")) {
            dd.setUnreachableOrAddresses(
                detailsDocument.getUnreachableOrAddresses());
          } else if (field.equals("version")) {
            dd.setVersion(detailsDocument.getVersion());
          }
        }
        /* Don't escape HTML characters, like < and >, contained in
Loading