Skip to content
Permalink
Browse files
[JENKINS-36871] Use Blocking-I/O for the clients
  • Loading branch information
stephenc committed Aug 5, 2016
1 parent 19093e3 commit 41841e520b6cfec0bb1179cf33ef969aec230886
Showing 1 changed file with 9 additions and 2 deletions.
@@ -263,8 +263,9 @@ private void innerRun(IOHub hub, SSLContext context, ExecutorService service) {
List<JnlpProtocolHandler> protocols = new JnlpProtocolHandlerFactory(service)
.withIOHub(hub)
.withSSLContext(context)
.withPreferNonBlockingIO(false) // we only have one connection, prefer blocking I/O
.handlers();
Map<String,String> headers = new HashMap<String,String>();
final Map<String,String> headers = new HashMap<String,String>();
headers.put(JnlpConnectionState.CLIENT_NAME_KEY, slaveName);
headers.put(JnlpConnectionState.SECRET_KEY, secretKey);

@@ -362,7 +363,13 @@ public void beforeChannel(@NonNull JnlpConnectionState event) {

@Override
public void afterChannel(@NonNull JnlpConnectionState event) {

// store the new cookie for next connection attempt
String cookie = event.getProperty(JnlpConnectionState.COOKIE_KEY);
if (cookie == null) {
headers.remove(JnlpConnectionState.COOKIE_KEY);
} else {
headers.put(JnlpConnectionState.COOKIE_KEY, cookie);
}
}
}).get();
} catch (IOException ioe) {

0 comments on commit 41841e5

Please sign in to comment.