Fix advertised JNLP Port

As far as I can figure, the /TcpSlaveAgentListener/ endpoint headers
tell the slaves what the JNLP port is. When I'm running jenkins behind a
proxy (marathon using the mesos plugin, which bridged networking), even
though I was setting the advertised port per a thread[1], it was not
accurately being returned in the header. This patch fixes that.

[1] https://groups.google.com/d/topic/jenkins-mesos/qUrXpDY07TQ/discussion
This commit is contained in:
bhenderson committed 2016-03-29 08:30:20 -07:00
1 parent a5bede84e6
commit 6fe31014d8
3 files changed
+10 -3

No files matched your search

+1 -1
View File
@@ -1925,7 +1925,7 @@ public class Functions {
TcpSlaveAgentListener tal = j.tcpSlaveAgentListener;
if (tal !=null) {
int p = TcpSlaveAgentListener.CLI_PORT !=null ? TcpSlaveAgentListener.CLI_PORT : tal.getPort();
int p = tal.getAdvertisedPort();
rsp.setIntHeader("X-Hudson-CLI-Port", p);
rsp.setIntHeader("X-Jenkins-CLI-Port", p);
rsp.setIntHeader("X-Jenkins-CLI2-Port", p);