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

Add "as" field as a copy of "as_number".

Implements part of #23713.
parent c9218fbd
......@@ -4,6 +4,8 @@
- Support a comma-separated list of fingerprints in the lookup
parameter to allow for URLs that specify a list of relays or
bridges.
- Add "as" field as a copy of the "as_number" field in preparation
of removing the "as_number" field in the future.
# Changes in version 6.1-1.15.0 - 2018-07-16
......
......@@ -201,12 +201,31 @@ public class DetailsDocument extends Document {
return this.longitude;
}
private String as;
@Deprecated
private String asNumber;
public void setAs(String as) {
this.as = escapeJson(as);
}
@Deprecated
public void setAsNumber(String asNumber) {
this.asNumber = escapeJson(asNumber);
}
@Deprecated
public void setAsAndAsNumber(String asNumber) {
this.as = escapeJson(asNumber);
this.asNumber = escapeJson(asNumber);
}
public String getAs() {
return unescapeJson(this.as);
}
@Deprecated
public String getAsNumber() {
return unescapeJson(this.asNumber);
}
......
......@@ -279,6 +279,8 @@ public class ResponseBuilder {
dd.setLatitude(detailsDocument.getLatitude());
} else if (field.equals("longitude")) {
dd.setLongitude(detailsDocument.getLongitude());
} else if (field.equals("as")) {
dd.setAs(detailsDocument.getAs());
} else if (field.equals("as_number")) {
dd.setAsNumber(detailsDocument.getAsNumber());
} else if (field.equals("as_name")) {
......
......@@ -97,7 +97,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
detailsDocument.setCountryName(detailsStatus.getCountryName());
detailsDocument.setRegionName(detailsStatus.getRegionName());
detailsDocument.setCityName(detailsStatus.getCityName());
detailsDocument.setAsNumber(detailsStatus.getAsNumber());
detailsDocument.setAsAndAsNumber(detailsStatus.getAsNumber());
detailsDocument.setAsName(detailsStatus.getAsName());
if (detailsStatus.isRunning()) {
detailsDocument.setConsensusWeightFraction(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment