Navigation Menu

Skip to content

Commit

Permalink
[FIXED JENKINS-9230] Added unique instance identifier to UDP broadcas…
Browse files Browse the repository at this point in the history
…t and DNS multicast.
  • Loading branch information
abayer committed Apr 21, 2011
1 parent 7bf2794 commit f28409e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -65,6 +65,9 @@
<li class=bug>
Fixed a persistence problem in <tt>View$PropertyList</tt>
(<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>
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>)
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/DNSMultiCast.java
@@ -1,6 +1,7 @@
package hudson;

import hudson.model.Hudson;
import hudson.Util;

import javax.jmdns.JmDNS;
import javax.jmdns.ServiceInfo;
Expand Down Expand Up @@ -39,6 +40,8 @@ public DNSMultiCast(Hudson hudson) {
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",
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/hudson/UDPBroadcastThread.java
Expand Up @@ -25,6 +25,7 @@

import hudson.model.Hudson;
import hudson.util.OneShotEvent;
import hudson.Util;

import java.io.IOException;
import java.net.BindException;
Expand Down Expand Up @@ -77,6 +78,7 @@ public void run() {
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())
Expand Down

0 comments on commit f28409e

Please sign in to comment.