Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7bd0287
HttpAsyncClient 4.1 branch
ok2c Apr 29, 2015
352d9ae
Fix when systemProperties is true but sslcontext not use systemProper…
ok2c Apr 29, 2015
4e87570
Upgraded project version to 4.2-alpha1-SNAPSHOT
ok2c Aug 21, 2015
0ced526
[HTTPASYNC-92] Make sure the osgi bundle imports what it needs, in pa…
ok2c Aug 21, 2015
6f479e5
Upgraded HttpCore to version 4.4.3
ok2c Sep 9, 2015
4d4f7c5
Upgraded HttpClient to version 4.5.1
ok2c Sep 15, 2015
fdfc94f
Changed project version to 4.1.1-SNAPSHOT
ok2c Oct 28, 2015
4b7ec04
Removed inherently racy test
ok2c Oct 30, 2015
358ca82
Upgraded HttpCore to version 4.4.4
ok2c Oct 30, 2015
f4d0ab1
Updated release notes for HttpAsyncClient 4.4.1 release
ok2c Oct 30, 2015
45cef34
Upgraded HttpAsyncClient version to 4.1.2-SNAPSHOT
ok2c Nov 6, 2015
e8fc6b1
Upgraded HttpClient OSGi dependency to 4.5
ok2c Dec 30, 2015
5a2277a
HttpAsyncClient builder to pass custom ThreadFactory to the DefaultCo…
ok2c Jan 8, 2016
98393ba
HTTPASYNC-101: CachingHttpAsyncClient to create default HttpContext i…
ok2c Jan 13, 2016
f938711
HTTPASYNC-105: socketTimeout is not reset back to default after a req…
ok2c Apr 21, 2016
7b28378
Upgraded HttpCore dependency to version 4.4.5
ok2c Jun 11, 2016
a926052
Upgraded HttpClient dependency to version 4.5.2
ok2c Jun 12, 2016
f0ebdd9
Updated NOTICE
ok2c Jun 12, 2016
5c21b8b
Updated release notes for HttpAsyncClient 4.1.2 release
ok2c Jun 12, 2016
b6cb17d
HTTPASYNC-97: Corrected OSGi imports.
ok2c Jun 13, 2016
cab1bf0
Relaxed assert of thrown exception due to different behavior on diffe…
ok2c Jun 13, 2016
3f51181
Fix checkstyle: use final.
garydgregory Jun 13, 2016
11d4831
Add Eclipse Checkstyle files to svn:ignore.
garydgregory Jun 13, 2016
d3d1730
apache-rat-plugin 0.11 -> 0.12. Exclude Eclipse Checkstyle file.
garydgregory Jun 13, 2016
369d1a0
Use non-routable 0.0.0.0 instead of '.invalid' hostname to simulate r…
ok2c Jun 14, 2016
ee42177
Disabled test failing on some Windows platforms
ok2c Jun 18, 2016
117dec6
Better build instructions.
garydgregory Jun 20, 2016
6818832
Add final modifier to local variables.
garydgregory Jun 23, 2016
51b1755
Upgraded HttpAsyncClient version to 4.1.3-SNAPSHOT
ok2c Jun 25, 2016
e03897b
fix HttpAsyncMethods.createPost/createPut(URI,byte[],ContentType): se…
ok2c Aug 28, 2016
efb1294
Multiple HEAD integration test
ok2c Jan 28, 2017
5344046
Upgraded HttpCore to version 4.4.6; upgraded HttpClient to version 4.5.3
ok2c Jan 28, 2017
65b1038
HTTPASYNC-116: Chain pool entry lease and connection futures in order…
ok2c Jan 28, 2017
28e7303
HTTPASYNC-116: Correct cancellation of client message exchange
ok2c Jan 28, 2017
ca1053f
HTTPASYNC-116: Added #validatePendingRequests to PoolingNHttpClientCo…
ok2c Jan 28, 2017
9b45b40
Added missing exchange id to debug logs
ok2c Feb 5, 2017
1cb9351
HTTPASYNC-110: Default exchange handler fails to correctly re-use ful…
ok2c Feb 5, 2017
6721daf
Updated examples to use httpbin.org resources
ok2c Feb 5, 2017
0c80068
Updated release notes for HttpAsyncClient 4.1.3 release
ok2c Feb 5, 2017
f0ae746
Upgraded HttpAsyncClient version to 4.1.4-SNAPSHOT
ok2c Feb 8, 2017
744cb5d
HTTPASYNC-118: HttpAsyncClientBuilder to use SystemDefaultCredentials…
ok2c Feb 23, 2017
22d69ed
Upgraded HttpCore dependency to version 4.4.7
ok2c Sep 15, 2017
cdfc9bd
HTTPASYNC-126: Increase range of commons-logging in OSGI manifest
ok2c Sep 15, 2017
8f59f7d
Corrected quick start example
ok2c Sep 25, 2017
f219c6e
[HTTPASYNC-135] HttpAsyncMethods.createHead() methods creates HttpGet…
garydgregory Mar 12, 2018
b4daf4e
HttpCore upgraded to version 4.4.9; HttpClient upgraded to version 4.…
garydgregory Mar 12, 2018
0dbb469
Fix versions.
garydgregory Mar 12, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions BUILDING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ mvn apache-rat:check

Execute the following commands in order to generate Javadoc:

mvn install
mvn javadoc:aggregate
mvn compile javadoc:aggregate

2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache HttpComponents AsyncClient
Copyright 2010-2015 The Apache Software Foundation
Copyright 2010-2017 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
84 changes: 84 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
Release 4.1.4
-------------------

This is a maintenance release that fixes a number of minor issues discovered since 4.1.2 and upgrades
HttpCore and HttpClient dependencies.

* [HTTPASYNC-135] HttpAsyncMethods.createHead() methods creates HttpGet objects.
Contributed by Mateusz Matela <mateusz dot matela at gmail dot>

* HttpCore upgraded to version 4.4.9

* HttpClient upgraded to version 4.5.5



Release 4.1.3
-------------------

Changelog
-------------------

* HttpCore upgraded to version 4.4.6

* HttpClient upgraded to version 4.5.3

* [HTTPASYNC-110] Default exchange handler fails to correctly re-use fully established tunnelled connection
leased from the pool when CONNECT request results in 407 over connection that cannot be kept alive.
Contributed by Oleg Kalnichevski <olegk at apache.org>

* [HTTPASYNC-116] Correct cancellation of client message exchange.
Contributed by Oleg Kalnichevski <olegk at apache.org>

* Fix HttpAsyncMethods#createPost/createPut(URI,byte[],ContentType): set entity to request
Contributed by Dmitry Potapov <dpotapov at yandex-team.ru>



Release 4.1.2
-------------------

This is a maintenance release that fixes a number of issues discovered since 4.1.1 and upgrades
HttpCore and HttpClient dependencies.

Changelog
-------------------

* HttpCore upgraded to version 4.4.5

* HttpClient upgraded to version 4.5.2

* [HTTPASYNC-105] socketTimeout is not reset back to default after a request that has specific
timeout
Contributed by Oleg Kalnichevski <olegk at apache.org>

* [HTTPASYNC-101 CachingHttpAsyncClient to create default HttpContext if none specified
Contributed by Oleg Kalnichevski <olegk at apache.org>

* [HTTPASYNC-97] Upgraded HttpClient OSGi dependency to 4.5
Contributed by Oleg Kalnichevski <olegk at apache.org>



Release 4.1.1
-------------------

This is a maintenance release that fixes a number of issues discovered since 4.1 and upgrades
HttpCore and HttpClient dependencies.

Changelog
-------------------

* HttpCore upgraded to version 4.4.4

* HttpClient upgraded to version 4.5.1

* [HTTPASYNC-92] Fixed osgi bundle imports (added missing 'org.apache.http.ssl')
Contributed by Daniel Kulp <dkulp at apache.org>

* HttpAsyncClientBuilder ignores UseSystemProperties setting when initializing SSL context
Contributed by Oleg Kalnichevski <olegk at apache.org>




Release 4.1
-------------------

Expand Down
2 changes: 1 addition & 1 deletion httpasyncclient-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-asyncclient</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.4-SNAPSHOT</version>
</parent>
<artifactId>httpasyncclient-cache</artifactId>
<name>Apache HttpAsyncClient Cache</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public void failed(final Exception e) {
future.get();
} catch (final ProtocolException pe) {
this.log.error("ProtocolException thrown during asynchronous revalidation", pe);
} catch (ExecutionException e) {
} catch (final ExecutionException e) {
this.log.error("Exception thrown during asynchronous revalidation", e.getCause());
} catch (InterruptedException e) {
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
} finally {
this.parent.markComplete(this.identifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
import org.apache.http.ProtocolException;
import org.apache.http.ProtocolVersion;
import org.apache.http.RequestLine;
import org.apache.http.annotation.ThreadSafe;
import org.apache.http.annotation.Contract;
import org.apache.http.annotation.ThreadingBehavior;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.cache.CacheResponseStatus;
import org.apache.http.client.cache.HeaderConstants;
Expand Down Expand Up @@ -76,7 +77,7 @@
import org.apache.http.util.EntityUtils;
import org.apache.http.util.VersionInfo;

@ThreadSafe // So long as the responseCache implementation is threadsafe
@Contract(threading = ThreadingBehavior.SAFE) // So long as the responseCache implementation is threadsafe
public class CachingHttpAsyncClient implements HttpAsyncClient {

private final static boolean SUPPORTS_RANGE_AND_CONTENT_RANGE_HEADERS = false;
Expand Down Expand Up @@ -288,7 +289,7 @@ public Future<HttpResponse> execute(
final FutureCallback<HttpResponse> futureCallback) {
final BasicFuture<HttpResponse> future = new BasicFuture<HttpResponse>(futureCallback);
final HttpRequestWrapper request = HttpRequestWrapper.wrap(originalRequest);
final HttpCacheContext clientContext = HttpCacheContext.adapt(context);
final HttpCacheContext clientContext = context != null ? HttpCacheContext.adapt(context) : HttpCacheContext.create();
// default response context
setResponseStatus(clientContext, CacheResponseStatus.CACHE_MISS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ public CloseableHttpResponse execute(
try {
final Future<HttpResponse> future = client.execute(route.getTargetHost(), request, context, null);
return Proxies.enhanceResponse(future.get());
} catch (InterruptedException e) {
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
return null;
} catch (ExecutionException e) {
} catch (final ExecutionException e) {
try {
throw e.getCause();
} catch (IOException ex) {
} catch (final IOException ex) {
throw ex;
} catch (HttpException ex) {
} catch (final HttpException ex) {
throw ex;
} catch (RuntimeException ex) {
} catch (final RuntimeException ex) {
throw ex;
} catch (Error ex) {
} catch (final Error ex) {
throw ex;
} catch (Throwable ex) {
} catch (final Throwable ex) {
throw new UndeclaredThrowableException(ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public Future<HttpResponse> execute(
HttpRequestWrapper.wrap(request),
HttpClientContext.adapt(context), null);
future.completed(result);
} catch (IOException e) {
} catch (final IOException e) {
future.failed(e);
} catch (HttpException e) {
} catch (final HttpException e) {
future.failed(e);
}
return future;
Expand Down
12 changes: 7 additions & 5 deletions httpasyncclient-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-asyncclient</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.4-SNAPSHOT</version>
</parent>
<artifactId>httpasyncclient-osgi</artifactId>
<name>Apache HttpAsyncClient OSGi bundle</name>
Expand All @@ -40,8 +40,8 @@

<properties>
<httpcore.osgi.import.version>"[4.4.0, 4.5.0)"</httpcore.osgi.import.version>
<httpclient.osgi.import.version>"[4.4.0, 4.5.0)"</httpclient.osgi.import.version>
<commons-logging.osgi.import.version>"[1.1.0, 1.2.0)"</commons-logging.osgi.import.version>
<httpclient.osgi.import.version>"[4.5.0, 4.6.0)"</httpclient.osgi.import.version>
<commons-logging.osgi.import.version>"[1.1.0, 1.3.0)"</commons-logging.osgi.import.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -107,7 +107,7 @@
org.apache.http.conn.ssl;version=${httpclient.osgi.import.version},
org.apache.http.conn.util;version=${httpclient.osgi.import.version},
org.apache.http.client;version=${httpclient.osgi.import.version},
org.apache.http.client.config;version=${httpcore.osgi.import.version},
org.apache.http.client.config;version=${httpclient.osgi.import.version},
org.apache.http.client.methods;version=${httpclient.osgi.import.version},
org.apache.http.client.params;version=${httpclient.osgi.import.version},
org.apache.http.client.protocol;version=${httpclient.osgi.import.version},
Expand All @@ -116,7 +116,9 @@
org.apache.http.impl.cookie;version=${httpclient.osgi.import.version},
org.apache.http.impl.conn;version=${httpclient.osgi.import.version},
org.apache.http.impl.client;version=${httpclient.osgi.import.version},
org.apache.http.impl.execchain;version=${httpclient.osgi.import.version}
org.apache.http.impl.execchain;version=${httpclient.osgi.import.version},
org.apache.http.ssl;version=${httpcore.osgi.import.version},
*
</Import-Package>
<Include-Resource />
<!-- Stop the JAVA_1_n_HOME variables from being treated as headers by Bnd -->
Expand Down
2 changes: 1 addition & 1 deletion httpasyncclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-asyncclient</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.4-SNAPSHOT</version>
</parent>
<artifactId>httpasyncclient</artifactId>
<name>Apache HttpAsyncClient</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*/
package org.apache.http.examples.nio.client;

import java.util.concurrent.Future;

import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
Expand All @@ -35,8 +37,6 @@
import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
import org.apache.http.impl.nio.client.HttpAsyncClients;

import java.util.concurrent.Future;

/**
* A simple example that uses HttpClient to execute an HTTP request against
* a target site that requires user authentication.
Expand All @@ -46,13 +46,14 @@ public class AsyncClientAuthentication {
public static void main(String[] args) throws Exception {
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(
new AuthScope("localhost", 443),
new UsernamePasswordCredentials("username", "password"));
new AuthScope("httpbin.org", 80),
new UsernamePasswordCredentials("user", "passwd"));
CloseableHttpAsyncClient httpclient = HttpAsyncClients.custom()
.setDefaultCredentialsProvider(credsProvider)
.build();
try {
HttpGet httpget = new HttpGet("http://localhost/");
httpclient.start();
HttpGet httpget = new HttpGet("http://httpbin.org/basic-auth/user/passwd");

System.out.println("Executing request " + httpget.getRequestLine());
Future<HttpResponse> future = httpclient.execute(httpget, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CookieStore;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.AuthSchemes;
Expand Down Expand Up @@ -201,6 +203,7 @@ public InetAddress[] resolve(final String host) throws UnknownHostException {
CookieStore cookieStore = new BasicCookieStore();
// Use custom credentials provider if necessary.
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(new AuthScope("localhost", 8889), new UsernamePasswordCredentials("squid", "nopassword"));
// Create global request configuration
RequestConfig defaultRequestConfig = RequestConfig.custom()
.setCookieSpec(CookieSpecs.DEFAULT)
Expand All @@ -214,19 +217,19 @@ public InetAddress[] resolve(final String host) throws UnknownHostException {
.setConnectionManager(connManager)
.setDefaultCookieStore(cookieStore)
.setDefaultCredentialsProvider(credentialsProvider)
.setProxy(new HttpHost("myproxy", 8080))
.setProxy(new HttpHost("localhost", 8889))
.setDefaultRequestConfig(defaultRequestConfig)
.build();

try {
HttpGet httpget = new HttpGet("http://localhost/");
HttpGet httpget = new HttpGet("http://httpbin.org/get");
// Request configuration can be overridden at the request level.
// They will take precedence over the one set at the client level.
RequestConfig requestConfig = RequestConfig.copy(defaultRequestConfig)
.setSocketTimeout(5000)
.setConnectTimeout(5000)
.setConnectionRequestTimeout(5000)
.setProxy(new HttpHost("myotherproxy", 8080))
.setProxy(new HttpHost("localhost", 8888))
.build();
httpget.setConfig(requestConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@

package org.apache.http.examples.nio.client;

import java.util.List;
import java.util.concurrent.Future;

import org.apache.http.HttpResponse;
import org.apache.http.client.CookieStore;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.BasicCookieStore;
import org.apache.http.impl.cookie.BasicClientCookie;
import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
import org.apache.http.impl.nio.client.HttpAsyncClients;

import java.util.List;
import java.util.concurrent.Future;

/**
* This example demonstrates the use of a local HTTP context populated with
* custom attributes.
Expand All @@ -48,6 +49,8 @@ public class AsyncClientCustomContext {
public final static void main(String[] args) throws Exception {
CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();
try {
httpclient.start();

// Create a local instance of cookie store
CookieStore cookieStore = new BasicCookieStore();

Expand All @@ -56,10 +59,13 @@ public final static void main(String[] args) throws Exception {
// Bind custom cookie store to the local context
localContext.setCookieStore(cookieStore);

HttpGet httpget = new HttpGet("http://localhost/");
System.out.println("Executing request " + httpget.getRequestLine());
BasicClientCookie cookie = new BasicClientCookie("stuff", "important");
cookie.setDomain("httpbin.org");
cookie.setPath("/");
cookieStore.addCookie(cookie);

httpclient.start();
HttpGet httpget = new HttpGet("http://httpbin.org/cookies");
System.out.println("Executing request " + httpget.getRequestLine());

// Pass local context as a parameter
Future<HttpResponse> future = httpclient.execute(httpget, localContext, null);
Expand Down
Loading