Permalink
Browse files

HTTPCLIENT-1186: State of newly created connections in the connection…

… pool is not always correctly updated potentially allowing those connections to be leased to users with a different security context

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpasyncclient/trunk@1330733 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 2aa05aa commit 6135f79ef28f7c38b3c2166e6641effaf59eb0a4 @ok2c ok2c committed Apr 26, 2012
@@ -338,10 +338,12 @@ public synchronized void responseReceived(
}
Object userToken = this.localContext.getAttribute(ClientContext.USER_TOKEN);
- if (managedConn != null && userToken == null) {
- userToken = userTokenHandler.getUserToken(this.localContext);
- if (userToken != null) {
+ if (managedConn != null) {
+ if (userToken == null) {
+ userToken = userTokenHandler.getUserToken(this.localContext);
this.localContext.setAttribute(ClientContext.USER_TOKEN, userToken);
+ }
+ if (userToken != null) {
managedConn.setState(userToken);
}
}

0 comments on commit 6135f79

Please sign in to comment.