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 2011/09/13 14:43:45 UTC
svn commit: r1170153 - in
/httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src:
main/java/org/apache/http/impl/nio/client/
test/java/org/apache/http/impl/nio/client/
Author: olegk
Date: Tue Sep 13 12:43:44 2011
New Revision: 1170153
URL: http://svn.apache.org/viewvc?rev=1170153&view=rev
Log:
Upgraded to the latest HttpCore API
Modified:
httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultAsyncRequestDirector.java
httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java
Modified: httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultAsyncRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultAsyncRequestDirector.java?rev=1170153&r1=1170152&r2=1170153&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultAsyncRequestDirector.java (original)
+++ httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultAsyncRequestDirector.java Tue Sep 13 12:43:44 2011
@@ -438,10 +438,10 @@ class DefaultAsyncRequestDirector<T> imp
}
}
- public synchronized void cancel() {
+ public synchronized boolean cancel() {
this.log.debug("HTTP exchange cancelled");
try {
- this.responseConsumer.cancel();
+ boolean cancelled = this.responseConsumer.cancel();
T result = this.responseConsumer.getResult();
Exception ex = this.responseConsumer.getException();
@@ -452,6 +452,7 @@ class DefaultAsyncRequestDirector<T> imp
} else {
this.resultCallback.cancelled(this);
}
+ return cancelled;
} catch (RuntimeException runex) {
this.resultCallback.failed(runex, this);
throw runex;
Modified: httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java?rev=1170153&r1=1170152&r2=1170153&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java (original)
+++ httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java Tue Sep 13 12:43:44 2011
@@ -47,6 +47,7 @@ import org.apache.http.client.Credential
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
+import org.apache.http.concurrent.Cancellable;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.DefaultTargetAuthenticationHandler;
@@ -204,7 +205,7 @@ public class TestClientAuthentication ex
this.authTokenExtractor = new BasicAuthTokenExtractor();
}
- public void verify(
+ public Cancellable verify(
final HttpRequest request,
final HttpAsyncContinueTrigger trigger,
final HttpContext context) throws HttpException, IOException {
@@ -219,6 +220,7 @@ public class TestClientAuthentication ex
} else {
trigger.continueRequest();
}
+ return null;
}
}