提交 f28409ee 编写于 作者: A Andrew Bayer

[FIXED JENKINS-9230] Added unique instance identifier to UDP broadcast and DNS multicast.

上级 7bf27942
...@@ -65,6 +65,9 @@ Upcoming changes</a> ...@@ -65,6 +65,9 @@ Upcoming changes</a>
<li class=bug> <li class=bug>
Fixed a persistence problem in <tt>View$PropertyList</tt> Fixed a persistence problem in <tt>View$PropertyList</tt>
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9367">issue 9367</a>) (<a href="http://issues.jenkins-ci.org/browse/JENKINS-9367">issue 9367</a>)
<li class=bug>
Added unique instance identifier to UDP broadcast and DNS multicast information.
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9230">issue 9230</a>)
<li class=rfe> <li class=rfe>
Maven agent needs a fix for the 'hardcoded' socket connection to localhost Maven agent needs a fix for the 'hardcoded' socket connection to localhost
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-6795">issue 6795</a>) (<a href="http://issues.jenkins-ci.org/browse/JENKINS-6795">issue 6795</a>)
......
package hudson; package hudson;
import hudson.model.Hudson; import hudson.model.Hudson;
import hudson.Util;
import javax.jmdns.JmDNS; import javax.jmdns.JmDNS;
import javax.jmdns.ServiceInfo; import javax.jmdns.ServiceInfo;
...@@ -39,6 +40,8 @@ public class DNSMultiCast implements Closeable { ...@@ -39,6 +40,8 @@ public class DNSMultiCast implements Closeable {
if (tal!=null) if (tal!=null)
props.put("slave-port",String.valueOf(tal.getPort())); props.put("slave-port",String.valueOf(tal.getPort()));
props.put("server-id", Util.getDigestOf(hudson.getSecretKey()));
jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.","hudson", jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.","hudson",
80,0,0,props)); // for backward compatibility 80,0,0,props)); // for backward compatibility
jmdns.registerService(ServiceInfo.create("_jenkins._tcp.local.","jenkins", jmdns.registerService(ServiceInfo.create("_jenkins._tcp.local.","jenkins",
......
...@@ -25,6 +25,7 @@ package hudson; ...@@ -25,6 +25,7 @@ package hudson;
import hudson.model.Hudson; import hudson.model.Hudson;
import hudson.util.OneShotEvent; import hudson.util.OneShotEvent;
import hudson.Util;
import java.io.IOException; import java.io.IOException;
import java.net.BindException; import java.net.BindException;
...@@ -77,6 +78,7 @@ public class UDPBroadcastThread extends Thread { ...@@ -77,6 +78,7 @@ public class UDPBroadcastThread extends Thread {
StringBuilder rsp = new StringBuilder("<hudson>"); StringBuilder rsp = new StringBuilder("<hudson>");
tag(rsp,"version",Hudson.VERSION); tag(rsp,"version",Hudson.VERSION);
tag(rsp,"url",hudson.getRootUrl()); tag(rsp,"url",hudson.getRootUrl());
tag(rsp,"server-id", Util.getDigestOf(hudson.getSecretKey()));
tag(rsp,"slave-port",tal==null?null:tal.getPort()); tag(rsp,"slave-port",tal==null?null:tal.getPort());
for (UDPBroadcastFragment f : UDPBroadcastFragment.all()) for (UDPBroadcastFragment f : UDPBroadcastFragment.all())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册