Skip to content
Commits on Source (5)
Apache HttpComponents Client
Copyright 1999-2018 The Apache Software Foundation
Copyright 1999-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
......
Release 4.5.7
-------------------
This is a maintenance release that corrects Automatic-Module-Name definitions added in the previous
release and fixes a number of minor defects discovered since 4.5.6.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
* Upgraded HttpCore to version 4.4.11
Contributed by Oleg Kalnichevski <olegk at apache.org>
* HTTPCLIENT-1960: URIBuilder incorrect handling of multiple leading slashes in path component
Contributed by Oleg Kalnichevski <olegk at apache.org>
* HTTPCLIENT-1958: PoolingHttpClientConnectionManager to throw ExecutionException in case of a lease operation
cancellation instead of InterruptedException.
Contributed by Oleg Kalnichevski <olegk at apache.org>
* HTTPCLIENT-1952: Allow default User Agent to be disabled.
Contributed by Michael Osipov <michaelo at apache.org>
* HTTPCLIENT-1956: CONNECT overwrites the main request object in the HTTP context when requests are executed
via a proxy tunnel.
Contributed by Oleg Kalnichevski <olegk at apache.org>
* HTTPCLIENT-1940: deprecated SSLSocketFactory made to rethrow SocketTimeoutException as
ConnectTimeoutException for consistency with non-deprecated code.
Contributed by Oleg Kalnichevski <olegk at apache.org>
* Fixed regression in BasicCookieStore serialization.
Contributed by Author: Mark Mielke <mmielke at ciena.com>
* HTTPCLIENT-1929: Corrected Automatic-Module-Name entries for HttpClient Fluent, HttpClient Windows
and HttpClient Cache.
Contributed by Oleg Kalnichevski <olegk at apache.org>
* HTTPCLIENT-1927: URLEncodedUtils#parse breaks at double quotes when parsing unquoted values.
Contributed by Oleg Kalnichevski <olegk at apache.org>
* HTTPCLIENT-1939: Update Apache Commons Codec from 1.10 to 1.11
Contributed by Gary Gregory <ggregory at apache.org>
Release 4.5.6
-------------------
This is a maintenance release that adds Automatic-Module-Name to the manifest for compatibility
with Java 9 Platform Module System and fixes a number of issues discovered since 4.5.5
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
......@@ -44,7 +90,7 @@ Release 4.5.5
HttpClient 4.5.5 (GA) is a maintenance release that fixes a regression introduced
by the previous release causing a NPE in SystemDefaultCredentialsProvider.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
......@@ -68,7 +114,7 @@ Release 4.5.4
HttpClient 4.5.4 (GA) is a maintenance release that fixes a number of defects found since 4.5.3.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
......@@ -138,7 +184,7 @@ Release 4.5.3
HttpClient 4.5.3 (GA) is a maintenance release that fixes a number of defects found since 4.5.2.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
......@@ -215,7 +261,7 @@ Release 4.5.2
HttpClient 4.5.2 (GA) is a maintenance release that fixes a number of minor defects found since 4.5.1.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
......@@ -265,7 +311,7 @@ Release 4.5.1
HttpClient 4.5.1 (GA) is a maintenance release that fixes a number of minor defects found since 4.5.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
......@@ -332,7 +378,7 @@ introduced in version 4.4.
Users of HttpClient 4.4 are encouraged to upgrade.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
-------------------
......@@ -390,7 +436,7 @@ Use at your discretion.
This release also includes all fixes from the stable 4.3.x release branch.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
......@@ -456,7 +502,7 @@ requests
This release also includes all fixes from the stable 4.3.x release branch.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Changelog:
......@@ -500,7 +546,7 @@ requests
This release also includes all fixes from the stable 4.3.x release branch.
Please note that as of 4.4 HttpClient requires Java 1.6 or newer.
Please note that as of 4.4, HttpClient requires Java 1.6 or newer.
Please note that new features included in this release are still considered experimental and
their API may change in the future 4.4 alpha and beta releases.
......
httpcomponents-client (4.5.7-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Refreshed the patches
-- Emmanuel Bourg <ebourg@apache.org> Mon, 28 Jan 2019 22:48:39 +0100
httpcomponents-client (4.5.6-2) unstable; urgency=medium
* Team upload.
......
......@@ -15,6 +15,7 @@
# junit junit jar s/3\..*/3.x/
org.apache.httpcomponents httpclient jar * tests *
* animal-sniffer-maven-plugin
* maven-checkstyle-plugin
* maven-clover2-plugin
* maven-source-plugin
......
......@@ -8,7 +8,7 @@ Subject: generate-osgi-metadata
--- a/httpclient/pom.xml
+++ b/httpclient/pom.xml
@@ -127,6 +127,7 @@
@@ -126,6 +126,7 @@
</goals>
<configuration>
<archive combine.children="append">
......@@ -16,7 +16,7 @@ Subject: generate-osgi-metadata
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient</Automatic-Module-Name>
</manifestEntries>
@@ -135,6 +136,33 @@
@@ -134,6 +135,33 @@
</execution>
</executions>
</plugin>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
<version>4.5.6</version>
<version>4.5.7</version>
</parent>
<artifactId>fluent-hc</artifactId>
<name>Apache HttpClient Fluent API</name>
......@@ -95,7 +95,7 @@
<configuration>
<archive combine.children="append">
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.fluent-hc</Automatic-Module-Name>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient.fluent</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
......
......@@ -91,10 +91,10 @@ class InternalByteArrayEntity extends AbstractHttpEntity implements Cloneable {
}
@Override
public void writeTo(final OutputStream outstream) throws IOException {
Args.notNull(outstream, "Output stream");
outstream.write(this.b, this.off, this.len);
outstream.flush();
public void writeTo(final OutputStream outStream) throws IOException {
Args.notNull(outStream, "Output stream");
outStream.write(this.b, this.off, this.len);
outStream.flush();
}
@Override
......
......@@ -65,18 +65,18 @@ class InternalFileEntity extends AbstractHttpEntity implements Cloneable {
}
@Override
public void writeTo(final OutputStream outstream) throws IOException {
Args.notNull(outstream, "Output stream");
final InputStream instream = new FileInputStream(this.file);
public void writeTo(final OutputStream outStream) throws IOException {
Args.notNull(outStream, "Output stream");
final InputStream inStream = new FileInputStream(this.file);
try {
final byte[] tmp = new byte[4096];
int l;
while ((l = instream.read(tmp)) != -1) {
outstream.write(tmp, 0, l);
while ((l = inStream.read(tmp)) != -1) {
outStream.write(tmp, 0, l);
}
outstream.flush();
outStream.flush();
} finally {
instream.close();
inStream.close();
}
}
......
......@@ -40,9 +40,9 @@ class InternalInputStreamEntity extends AbstractHttpEntity {
private final InputStream content;
private final long length;
public InternalInputStreamEntity(final InputStream instream, final long length, final ContentType contentType) {
public InternalInputStreamEntity(final InputStream inputStream, final long length, final ContentType contentType) {
super();
this.content = Args.notNull(instream, "Source input stream");
this.content = Args.notNull(inputStream, "Source input stream");
this.length = length;
if (contentType != null) {
setContentType(contentType.toString());
......@@ -65,31 +65,31 @@ class InternalInputStreamEntity extends AbstractHttpEntity {
}
@Override
public void writeTo(final OutputStream outstream) throws IOException {
Args.notNull(outstream, "Output stream");
final InputStream instream = this.content;
public void writeTo(final OutputStream outStream) throws IOException {
Args.notNull(outStream, "Output stream");
final InputStream inStream = this.content;
try {
final byte[] buffer = new byte[4096];
int l;
int readLen;
if (this.length < 0) {
// consume until EOF
while ((l = instream.read(buffer)) != -1) {
outstream.write(buffer, 0, l);
while ((readLen = inStream.read(buffer)) != -1) {
outStream.write(buffer, 0, readLen);
}
} else {
// consume no more than length
long remaining = this.length;
while (remaining > 0) {
l = instream.read(buffer, 0, (int)Math.min(4096, remaining));
if (l == -1) {
readLen = inStream.read(buffer, 0, (int)Math.min(4096, remaining));
if (readLen == -1) {
break;
}
outstream.write(buffer, 0, l);
remaining -= l;
outStream.write(buffer, 0, readLen);
remaining -= readLen;
}
}
} finally {
instream.close();
inStream.close();
}
}
......
......@@ -401,12 +401,12 @@ public class Request {
return body(new InternalByteArrayEntity(b, off, len, contentType));
}
public Request bodyStream(final InputStream instream) {
return body(new InternalInputStreamEntity(instream, -1, null));
public Request bodyStream(final InputStream inStream) {
return body(new InternalInputStreamEntity(inStream, -1, null));
}
public Request bodyStream(final InputStream instream, final ContentType contentType) {
return body(new InternalInputStreamEntity(instream, -1, contentType));
public Request bodyStream(final InputStream inStream, final ContentType contentType) {
return body(new InternalInputStreamEntity(inStream, -1, contentType));
}
@Override
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
<version>4.5.6</version>
<version>4.5.7</version>
</parent>
<artifactId>httpclient-cache</artifactId>
<name>Apache HttpClient Cache</name>
......@@ -112,7 +112,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
......@@ -142,7 +141,7 @@
<configuration>
<archive combine.children="append">
<manifestEntries>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient-cache</Automatic-Module-Name>
<Automatic-Module-Name>org.apache.httpcomponents.httpclient.cache</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
......
......@@ -41,7 +41,7 @@ public interface ResourceFactory {
* Creates a {@link Resource} from a given response body.
* @param requestId a unique identifier for this particular
* response body
* @param instream the original {@link InputStream}
* @param inStream the original {@link InputStream}
* containing the response body of the origin HTTP response.
* @param limit maximum number of bytes to consume of the
* response body; if this limit is reached before the
......@@ -52,7 +52,7 @@ public interface ResourceFactory {
* the response body was successfully read.
* @throws IOException
*/
Resource generate(String requestId, InputStream instream, InputLimit limit) throws IOException;
Resource generate(String requestId, InputStream inStream, InputLimit limit) throws IOException;
/**
* Clones an existing {@link Resource}.
......
......@@ -82,13 +82,13 @@ class CacheEntity implements HttpEntity, Serializable {
}
@Override
public void writeTo(final OutputStream outstream) throws IOException {
Args.notNull(outstream, "Output stream");
final InputStream instream = this.cacheEntry.getResource().getInputStream();
public void writeTo(final OutputStream outStream) throws IOException {
Args.notNull(outStream, "Output stream");
final InputStream inStream = this.cacheEntry.getResource().getInputStream();
try {
IOUtils.copy(instream, outstream);
IOUtils.copy(inStream, outStream);
} finally {
instream.close();
inStream.close();
}
}
......
......@@ -41,11 +41,11 @@ class CombinedEntity extends AbstractHttpEntity {
private final Resource resource;
private final InputStream combinedStream;
CombinedEntity(final Resource resource, final InputStream instream) throws IOException {
CombinedEntity(final Resource resource, final InputStream inStream) throws IOException {
super();
this.resource = resource;
this.combinedStream = new SequenceInputStream(
new ResourceStream(resource.getInputStream()), instream);
new ResourceStream(resource.getInputStream()), inStream);
}
@Override
......@@ -69,17 +69,17 @@ class CombinedEntity extends AbstractHttpEntity {
}
@Override
public void writeTo(final OutputStream outstream) throws IOException {
Args.notNull(outstream, "Output stream");
final InputStream instream = getContent();
public void writeTo(final OutputStream outStream) throws IOException {
Args.notNull(outStream, "Output stream");
final InputStream inStream = getContent();
try {
int l;
final byte[] tmp = new byte[2048];
while ((l = instream.read(tmp)) != -1) {
outstream.write(tmp, 0, l);
while ((l = inStream.read(tmp)) != -1) {
outStream.write(tmp, 0, l);
}
} finally {
instream.close();
inStream.close();
}
}
......
......@@ -73,16 +73,16 @@ public class FileResourceFactory implements ResourceFactory {
@Override
public Resource generate(
final String requestId,
final InputStream instream,
final InputStream inStream,
final InputLimit limit) throws IOException {
final File file = generateUniqueCacheFile(requestId);
final FileOutputStream outstream = new FileOutputStream(file);
final FileOutputStream outStream = new FileOutputStream(file);
try {
final byte[] buf = new byte[2048];
long total = 0;
int l;
while ((l = instream.read(buf)) != -1) {
outstream.write(buf, 0, l);
while ((l = inStream.read(buf)) != -1) {
outStream.write(buf, 0, l);
total += l;
if (limit != null && total > limit.getValue()) {
limit.reached();
......@@ -90,7 +90,7 @@ public class FileResourceFactory implements ResourceFactory {
}
}
} finally {
outstream.close();
outStream.close();
}
return new FileResource(file);
}
......
......@@ -47,21 +47,21 @@ public class HeapResourceFactory implements ResourceFactory {
@Override
public Resource generate(
final String requestId,
final InputStream instream,
final InputStream inStream,
final InputLimit limit) throws IOException {
final ByteArrayOutputStream outstream = new ByteArrayOutputStream();
final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
final byte[] buf = new byte[2048];
long total = 0;
int l;
while ((l = instream.read(buf)) != -1) {
outstream.write(buf, 0, l);
while ((l = inStream.read(buf)) != -1) {
outStream.write(buf, 0, l);
total += l;
if (limit != null && total > limit.getValue()) {
limit.reached();
break;
}
}
return createResource(outstream.toByteArray());
return createResource(outStream.toByteArray());
}
@Override
......@@ -72,9 +72,9 @@ public class HeapResourceFactory implements ResourceFactory {
if (resource instanceof HeapResource) {
body = ((HeapResource) resource).getByteArray();
} else {
final ByteArrayOutputStream outstream = new ByteArrayOutputStream();
IOUtils.copyAndClose(resource.getInputStream(), outstream);
body = outstream.toByteArray();
final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
IOUtils.copyAndClose(resource.getInputStream(), outStream);
body = outStream.toByteArray();
}
return createResource(body);
}
......
......@@ -43,9 +43,9 @@ class IOUtils {
return;
}
if (entity.isStreaming()) {
final InputStream instream = entity.getContent();
if (instream != null) {
instream.close();
final InputStream inStream = entity.getContent();
if (inStream != null) {
inStream.close();
}
}
}
......
......@@ -49,7 +49,7 @@ class SizeLimitedResponseReader {
private final HttpRequest request;
private final CloseableHttpResponse response;
private InputStream instream;
private InputStream inStream;
private InputLimit limit;
private Resource resource;
private boolean consumed;
......@@ -99,12 +99,12 @@ class SizeLimitedResponseReader {
return;
}
final String uri = request.getRequestLine().getUri();
instream = entity.getContent();
inStream = entity.getContent();
try {
resource = resourceFactory.generate(uri, instream, limit);
resource = resourceFactory.generate(uri, inStream, limit);
} finally {
if (!limit.isReached()) {
instream.close();
inStream.close();
}
}
}
......@@ -124,7 +124,7 @@ class SizeLimitedResponseReader {
final HttpResponse reconstructed = new BasicHttpResponse(response.getStatusLine());
reconstructed.setHeaders(response.getAllHeaders());
final CombinedEntity combinedEntity = new CombinedEntity(resource, instream);
final CombinedEntity combinedEntity = new CombinedEntity(resource, inStream);
final HttpEntity entity = response.getEntity();
if (entity != null) {
combinedEntity.setContentType(entity.getContentType());
......
......@@ -45,8 +45,8 @@ public class TestCombinedEntity {
when(resource.getInputStream()).thenReturn(
new ByteArrayInputStream(new byte[] { 1, 2, 3, 4, 5 }));
final ByteArrayInputStream instream = new ByteArrayInputStream(new byte[] { 6, 7, 8, 9, 10 });
final CombinedEntity entity = new CombinedEntity(resource, instream);
final ByteArrayInputStream inStream = new ByteArrayInputStream(new byte[] { 6, 7, 8, 9, 10 });
final CombinedEntity entity = new CombinedEntity(resource, inStream);
Assert.assertEquals(-1, entity.getContentLength());
Assert.assertFalse(entity.isRepeatable());
Assert.assertTrue(entity.isStreaming());
......
......@@ -74,7 +74,7 @@ public class TestEhcacheHttpCacheStorage extends TestCase {
impl.putEntry(key, value);
verify(mockSerializer).writeTo(same(value), isA(OutputStream.class));
verify(mockCache).put(e);;
verify(mockCache).put(e);
}
@Test
......