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

Fix trivial bug in parsing bridge extra-info descriptors.

If the first thing we'd learn from a bridge was an extra-info
descriptor, we would not have stored the contained transports. This
case is very unlikely and has very little effect. Worth fixing anyway.
Found via code analysis.
parent b756eee6
......@@ -346,14 +346,16 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
DetailsStatus.class, true, fingerprint);
if (detailsStatus == null) {
detailsStatus = new DetailsStatus();
} else if (null == detailsStatus.getExtraInfoDescPublished()
|| descriptor.getPublishedMillis()
> detailsStatus.getExtraInfoDescPublished()) {
detailsStatus.setExtraInfoDescPublished(
descriptor.getPublishedMillis());
detailsStatus.setTransports(descriptor.getTransports());
this.documentStore.store(detailsStatus, fingerprint);
} else if (null != detailsStatus.getExtraInfoDescPublished()
&& detailsStatus.getExtraInfoDescPublished()
>= descriptor.getPublishedMillis()) {
/* Already parsed more recent extra-info descriptor from this bridge. */
return;
}
detailsStatus.setExtraInfoDescPublished(
descriptor.getPublishedMillis());
detailsStatus.setTransports(descriptor.getTransports());
this.documentStore.store(detailsStatus, fingerprint);
}
private void processBridgeNetworkStatus(BridgeNetworkStatus status) {
......
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