mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
[FIXED JENKINS-9230] Added unique instance identifier to UDP broadcast and DNS multicast.
This commit is contained in:
1 parent
7bf279422c
commit
f28409ee27
3 files changed
+8
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package hudson;
|
||||
|
||||
import hudson.model.Hudson;
|
||||
import hudson.Util;
|
||||
|
||||
import javax.jmdns.JmDNS;
|
||||
import javax.jmdns.ServiceInfo;
|
||||
@@ -39,6 +40,8 @@ public class DNSMultiCast implements Closeable {
|
||||
if (tal!=null)
|
||||
props.put("slave-port",String.valueOf(tal.getPort()));
|
||||
|
||||
props.put("server-id", Util.getDigestOf(hudson.getSecretKey()));
|
||||
|
||||
jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.","hudson",
|
||||
80,0,0,props)); // for backward compatibility
|
||||
jmdns.registerService(ServiceInfo.create("_jenkins._tcp.local.","jenkins",
|
||||
|
||||
@@ -25,6 +25,7 @@ package hudson;
|
||||
|
||||
import hudson.model.Hudson;
|
||||
import hudson.util.OneShotEvent;
|
||||
import hudson.Util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.BindException;
|
||||
@@ -77,6 +78,7 @@ public class UDPBroadcastThread extends Thread {
|
||||
StringBuilder rsp = new StringBuilder("<hudson>");
|
||||
tag(rsp,"version",Hudson.VERSION);
|
||||
tag(rsp,"url",hudson.getRootUrl());
|
||||
tag(rsp,"server-id", Util.getDigestOf(hudson.getSecretKey()));
|
||||
tag(rsp,"slave-port",tal==null?null:tal.getPort());
|
||||
|
||||
for (UDPBroadcastFragment f : UDPBroadcastFragment.all())
|
||||
|
||||
Reference in new issue
Block a user