Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-03-14 22:44:07 -0400
committerslewis2008-03-14 22:44:07 -0400
commit29d51c18b8da34b1934e6afcccd03db66cfae1d8 (patch)
tree24ad8518fd1ac7aabbea9bca90bfe81ff82f71fe
parent5101632346bfe98b2fcf7ccb9946eec8d62ac2e2 (diff)
downloadorg.eclipse.ecf-29d51c18b8da34b1934e6afcccd03db66cfae1d8.tar.gz
org.eclipse.ecf-29d51c18b8da34b1934e6afcccd03db66cfae1d8.tar.xz
org.eclipse.ecf-29d51c18b8da34b1934e6afcccd03db66cfae1d8.zip
Fix for priority and weight defaultsv20080314-2030
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java
index 046b94e9e..a89136937 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java
@@ -409,7 +409,9 @@ public class JMDNSDiscoveryContainer extends AbstractDiscoveryContainerAdapter i
// Add URI scheme to props
URI location = serviceInfo.getLocation();
props.put(SCHEME_PROPERTY, location.getScheme());
- final ServiceInfo si = new ServiceInfo(sID.getServiceTypeID().getInternal(), sID.getServiceName(), location.getPort(), serviceInfo.getPriority(), serviceInfo.getWeight(), props);
+ int priority = (serviceInfo.getPriority() == -1) ? 0 : serviceInfo.getPriority();
+ int weight = (serviceInfo.getWeight() == -1) ? 0 : serviceInfo.getWeight();
+ final ServiceInfo si = new ServiceInfo(sID.getServiceTypeID().getInternal(), sID.getServiceName(), location.getPort(), priority, weight, props);
return si;
}

Back to the top