You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2015/10/30 16:06:25 UTC
svn commit: r1711493 - in /httpcomponents/httpasyncclient/branches/4.1.x:
httpasyncclient/src/main/java/org/apache/http/impl/nio/client/AbstractClientExchangeHandler.java
pom.xml
Author: olegk
Date: Fri Oct 30 15:06:25 2015
New Revision: 1711493
URL: http://svn.apache.org/viewvc?rev=1711493&view=rev
Log:
Upgraded HttpCore to version 4.4.4
Modified:
httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/AbstractClientExchangeHandler.java
httpcomponents/httpasyncclient/branches/4.1.x/pom.xml
Modified: httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/AbstractClientExchangeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/AbstractClientExchangeHandler.java?rev=1711493&r1=1711492&r2=1711493&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/AbstractClientExchangeHandler.java (original)
+++ httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/AbstractClientExchangeHandler.java Fri Oct 30 15:06:25 2015
@@ -26,12 +26,6 @@
*/
package org.apache.http.impl.nio.client;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-
import org.apache.commons.logging.Log;
import org.apache.http.ConnectionClosedException;
import org.apache.http.ConnectionReuseStrategy;
@@ -49,8 +43,15 @@ import org.apache.http.nio.NHttpClientCo
import org.apache.http.nio.conn.NHttpClientConnectionManager;
import org.apache.http.nio.protocol.HttpAsyncClientExchangeHandler;
import org.apache.http.nio.protocol.HttpAsyncRequestExecutor;
+import org.apache.http.protocol.HttpContext;
import org.apache.http.util.Asserts;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.AtomicReference;
+
/**
* Abstract {@link org.apache.http.nio.protocol.HttpAsyncClientExchangeHandler} class
* that implements connection management aspects shared by all HTTP exchange handlers.
@@ -312,10 +313,14 @@ abstract class AbstractClientExchangeHan
return;
}
- managedConn.getContext().setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this);
- managedConn.requestOutput();
- if (managedConn.isStale()) {
- failed(new ConnectionClosedException("Connection closed"));
+ final HttpContext context = managedConn.getContext();
+ synchronized (context) {
+ context.setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this);
+ if (managedConn.isStale()) {
+ failed(new ConnectionClosedException("Connection closed"));
+ } else {
+ managedConn.requestOutput();
+ }
}
} catch (final RuntimeException runex) {
failed(runex);
Modified: httpcomponents/httpasyncclient/branches/4.1.x/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/pom.xml?rev=1711493&r1=1711492&r2=1711493&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.1.x/pom.xml (original)
+++ httpcomponents/httpasyncclient/branches/4.1.x/pom.xml Fri Oct 30 15:06:25 2015
@@ -66,7 +66,7 @@
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
- <httpcore.version>4.4.3</httpcore.version>
+ <httpcore.version>4.4.4</httpcore.version>
<httpclient.version>4.5.1</httpclient.version>
<commons-logging.version>1.2</commons-logging.version>
<commons-io.version>2.4</commons-io.version>