Skip to content

Commit

Permalink
[FIXED JENKINS-42371] - Call disconnect() on HttpURLConnection object (
Browse files Browse the repository at this point in the history
…#152)

[FIXED JENKINS-42371] - Call disconnect() on HttpURLConnection object
  • Loading branch information
nehaljwani authored and oleg-nenashev committed Feb 28, 2017
1 parent 785661c commit 75f9fab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/hudson/remoting/Launcher.java
Expand Up @@ -376,8 +376,9 @@ public List<String> parseJnlpArguments() throws ParserConfigurationException, SA
}
}
while (true) {
URLConnection con = null;
try {
URLConnection con = Util.openURLConnection(slaveJnlpURL);
con = Util.openURLConnection(slaveJnlpURL);
if (con instanceof HttpURLConnection) {
HttpURLConnection http = (HttpURLConnection) con;
if (slaveJnlpCredentials != null) {
Expand Down Expand Up @@ -462,6 +463,11 @@ public List<String> parseJnlpArguments() throws ParserConfigurationException, SA
System.err.println("Waiting 10 seconds before retry");
Thread.sleep(10*1000);
// retry
} finally {
if (con instanceof HttpURLConnection) {
HttpURLConnection http = (HttpURLConnection) con;
http.disconnect();
}
}
}
}
Expand Down

0 comments on commit 75f9fab

Please sign in to comment.