Posted by ol...@apache.org.
HTTPCORE-345: EntityAsyncContentProducer fails to release resources allocated by the underlying entity when #produceContent is never invoked
Contributed by Tad Whitenight <tadwhitenight at gmail.com
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1499262 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/6c66e1e6
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/6c66e1e6
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/6c66e1e6
Branch: refs/heads/4.2.x
Commit: 6c66e1e6215b66b80b25886031f634c0c3d0e0ca
Parents: b27fc70
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed Jul 3 08:41:05 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Jul 3 08:41:05 2013 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 4 ++++
.../http/nio/entity/EntityAsyncContentProducer.java | 5 +++++
.../TestHttpAsyncPrematureTermination.java | 15 ++++++++++++++-
3 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/6c66e1e6/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 0338632..50c60ea 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,6 +1,10 @@
Changes since Release 4.2.4
-------------------
+* [HTTPCORE-345] EntityAsyncContentProducer fails to release resources allocated by the underlying
+ entity when #produceContent is never invoked.
+ Contributed by Tad Whitenight <tadwhitenight at gmail.com>
+
* Non-blocking connection pool to avoid scanning the entire queue of pending connection requests
on each connection lease / release operation (under heavy load the request queue can contain
a significant number of pending requests, a full linear scan of which can cause massive
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/6c66e1e6/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java b/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java
index 35d0cf0..ea25c38 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java
@@ -28,6 +28,7 @@
package org.apache.http.nio.entity;
import java.io.IOException;
+import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
@@ -86,6 +87,10 @@ public class EntityAsyncContentProducer implements HttpAsyncContentProducer {
if (local != null) {
local.close();
}
+ if (this.entity.isStreaming()) {
+ InputStream instream = this.entity.getContent();
+ instream.close();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/6c66e1e6/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java b/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java
index 2865bde..5ae6919 100644
--- a/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java
+++ b/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java
@@ -26,11 +26,14 @@
*/
package org.apache.http.nio.integration;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.net.InetSocketAddress;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import org.apache.http.Consts;
import org.apache.http.HttpConnection;
import org.apache.http.HttpCoreNIOTestBase;
import org.apache.http.HttpException;
@@ -41,6 +44,7 @@ import org.apache.http.LoggingClientConnectionFactory;
import org.apache.http.LoggingServerConnectionFactory;
import org.apache.http.concurrent.FutureCallback;
import org.apache.http.entity.ContentType;
+import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.impl.DefaultHttpResponseFactory;
import org.apache.http.impl.nio.DefaultNHttpClientConnection;
@@ -178,6 +182,14 @@ public class TestHttpAsyncPrematureTermination extends HttpCoreNIOTestBase {
@Test
public void testConnectionTerminatedHandlingRequest() throws Exception {
+ final CountDownLatch responseStreamClosed = new CountDownLatch(1);
+ final InputStream testInputStream = new ByteArrayInputStream("all is well".getBytes(Consts.ASCII)) {
+ @Override
+ public void close() throws IOException {
+ responseStreamClosed.countDown();
+ super.close();
+ }
+ };
HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
registry.register("*", new HttpAsyncRequestHandler<HttpRequest>() {
@@ -195,7 +207,7 @@ public class TestHttpAsyncPrematureTermination extends HttpCoreNIOTestBase {
ExecutionContext.HTTP_CONNECTION);
conn.shutdown();
HttpResponse response = httpExchange.getResponse();
- response.setEntity(new NStringEntity("all is well", ContentType.TEXT_PLAIN));
+ response.setEntity(new InputStreamEntity(testInputStream, -1));
httpExchange.submitResponse();
}
@@ -229,6 +241,7 @@ public class TestHttpAsyncPrematureTermination extends HttpCoreNIOTestBase {
this.connpool, context, callback);
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
+ Assert.assertTrue(responseStreamClosed.await(5, TimeUnit.SECONDS));
}
@Test
[50/50] httpcomponents-core git commit: Upgraded project version to
4.2.6-SNAPSHOT
Posted by ol...@apache.org.
Upgraded project version to 4.2.6-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1509625 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/86897bd6
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/86897bd6
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/86897bd6
Branch: refs/heads/4.2.x
Commit: 86897bd674bd2c547d1ad3e93add6d82916010de
Parents: f93ea28
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Aug 2 11:13:19 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Aug 2 11:13:19 2013 +0000
----------------------------------------------------------------------
httpcore-ab/pom.xml | 2 +-
httpcore-benchmark/pom.xml | 2 +-
httpcore-contrib/pom.xml | 2 +-
httpcore-nio/pom.xml | 2 +-
httpcore-osgi/pom.xml | 2 +-
httpcore/pom.xml | 2 +-
pom.xml | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/86897bd6/httpcore-ab/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-ab/pom.xml b/httpcore-ab/pom.xml
index d8edd6e..8402ec7 100644
--- a/httpcore-ab/pom.xml
+++ b/httpcore-ab/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.5-SNAPSHOT</version>
+ <version>4.2.6-SNAPSHOT</version>
</parent>
<artifactId>httpcore-ab</artifactId>
<name>Apache HttpCore Benchmarking Tool</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/86897bd6/httpcore-benchmark/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/pom.xml b/httpcore-benchmark/pom.xml
index 630c50b..b2cd4c3 100644
--- a/httpcore-benchmark/pom.xml
+++ b/httpcore-benchmark/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.5-SNAPSHOT</version>
+ <version>4.2.6-SNAPSHOT</version>
</parent>
<artifactId>httpcore-benchmark</artifactId>
<name>HttpCore Benchmarks</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/86897bd6/httpcore-contrib/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-contrib/pom.xml b/httpcore-contrib/pom.xml
index c4f50bb..1a0b6ee 100644
--- a/httpcore-contrib/pom.xml
+++ b/httpcore-contrib/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.5-SNAPSHOT</version>
+ <version>4.2.6-SNAPSHOT</version>
</parent>
<artifactId>httpcore-contrib</artifactId>
<name>HttpCore Contrib</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/86897bd6/httpcore-nio/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-nio/pom.xml b/httpcore-nio/pom.xml
index eb66768..9b659b3 100644
--- a/httpcore-nio/pom.xml
+++ b/httpcore-nio/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.5-SNAPSHOT</version>
+ <version>4.2.6-SNAPSHOT</version>
</parent>
<artifactId>httpcore-nio</artifactId>
<name>Apache HttpCore NIO</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/86897bd6/httpcore-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-osgi/pom.xml b/httpcore-osgi/pom.xml
index eac39bf..1b9173f 100644
--- a/httpcore-osgi/pom.xml
+++ b/httpcore-osgi/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.5-SNAPSHOT</version>
+ <version>4.2.6-SNAPSHOT</version>
</parent>
<artifactId>httpcore-osgi</artifactId>
<name>Apache HttpCore OSGi bundle</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/86897bd6/httpcore/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore/pom.xml b/httpcore/pom.xml
index 0a4bcaa..b6f99c0 100644
--- a/httpcore/pom.xml
+++ b/httpcore/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.5-SNAPSHOT</version>
+ <version>4.2.6-SNAPSHOT</version>
</parent>
<artifactId>httpcore</artifactId>
<name>Apache HttpCore</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/86897bd6/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8bef90b..9abb5c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>httpcomponents-core</artifactId>
<name>Apache HttpComponents Core</name>
- <version>4.2.5-SNAPSHOT</version>
+ <version>4.2.6-SNAPSHOT</version>
<description>Core components to build HTTP enabled services</description>
<url>http://hc.apache.org/httpcomponents-core</url>
<inceptionYear>2005</inceptionYear>
[36/50] httpcomponents-core git commit: Fixed bug introduced in
r1478038
Posted by ol...@apache.org.
Fixed bug introduced in r1478038
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1493389 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/4797808b
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/4797808b
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/4797808b
Branch: refs/heads/4.2.x
Commit: 4797808b8a60fd268488704a5f8962ae265fd2a3
Parents: 9f34946
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sat Jun 15 16:20:44 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat Jun 15 16:20:44 2013 +0000
----------------------------------------------------------------------
.../main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/4797808b/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java b/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
index 975cad9..546ed00 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
@@ -233,8 +233,8 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
ListIterator<LeaseRequest<T, C, E>> it = this.leasingRequests.listIterator();
while (it.hasNext()) {
LeaseRequest<T, C, E> request = it.next();
- processPendingRequest(request);
- if (request.isDone()) {
+ boolean completed = processPendingRequest(request);
+ if (request.isDone() || completed) {
it.remove();
}
}
[14/50] httpcomponents-core git commit: HTTPCORE-331: BasicFuture no
longer executes notification callbacks inside a synchronized block (cleanup)
Posted by ol...@apache.org.
HTTPCORE-331: BasicFuture no longer executes notification callbacks inside a synchronized block (cleanup)
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1435147 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/d0569b23
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/d0569b23
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/d0569b23
Branch: refs/heads/4.2.x
Commit: d0569b23b9b87858da07c9d4afb0cfa910d8243c
Parents: 2d706f9
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Jan 18 14:10:51 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Jan 18 14:10:51 2013 +0000
----------------------------------------------------------------------
.../src/main/java/org/apache/http/concurrent/BasicFuture.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d0569b23/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
----------------------------------------------------------------------
diff --git a/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java b/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
index faca044..46a3aca 100644
--- a/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
+++ b/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
@@ -99,7 +99,7 @@ public class BasicFuture<T> implements Future<T>, Cancellable {
}
}
- public synchronized boolean completed(final T result) {
+ public boolean completed(final T result) {
synchronized(this) {
if (this.completed) {
return false;
@@ -114,7 +114,7 @@ public class BasicFuture<T> implements Future<T>, Cancellable {
return true;
}
- public synchronized boolean failed(final Exception exception) {
+ public boolean failed(final Exception exception) {
synchronized(this) {
if (this.completed) {
return false;
@@ -129,7 +129,7 @@ public class BasicFuture<T> implements Future<T>, Cancellable {
return true;
}
- public synchronized boolean cancel(boolean mayInterruptIfRunning) {
+ public boolean cancel(boolean mayInterruptIfRunning) {
synchronized(this) {
if (this.completed) {
return false;
[08/50] httpcomponents-core git commit: Upgraded project version to
4.2.4-SNAPSHOT
Posted by ol...@apache.org.
Upgraded project version to 4.2.4-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1414403 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/3c897383
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/3c897383
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/3c897383
Branch: refs/heads/4.2.x
Commit: 3c89738310ed10687b475892f9ba18d5a6ec96ba
Parents: 37e2b87
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Tue Nov 27 21:32:42 2012 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Tue Nov 27 21:32:42 2012 +0000
----------------------------------------------------------------------
httpcore-ab/pom.xml | 2 +-
httpcore-nio/pom.xml | 2 +-
httpcore-osgi/pom.xml | 2 +-
httpcore/pom.xml | 2 +-
pom.xml | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3c897383/httpcore-ab/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-ab/pom.xml b/httpcore-ab/pom.xml
index 79f9dac..60f12d8 100644
--- a/httpcore-ab/pom.xml
+++ b/httpcore-ab/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.3-SNAPSHOT</version>
+ <version>4.2.4-SNAPSHOT</version>
</parent>
<artifactId>httpcore-ab</artifactId>
<name>HttpCore AB clone</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3c897383/httpcore-nio/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-nio/pom.xml b/httpcore-nio/pom.xml
index c0156d9..1c8996a 100644
--- a/httpcore-nio/pom.xml
+++ b/httpcore-nio/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.3-SNAPSHOT</version>
+ <version>4.2.4-SNAPSHOT</version>
</parent>
<artifactId>httpcore-nio</artifactId>
<name>HttpCore NIO</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3c897383/httpcore-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-osgi/pom.xml b/httpcore-osgi/pom.xml
index 9cbc1e0..4074171 100644
--- a/httpcore-osgi/pom.xml
+++ b/httpcore-osgi/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.3-SNAPSHOT</version>
+ <version>4.2.4-SNAPSHOT</version>
</parent>
<artifactId>httpcore-osgi</artifactId>
<name>HttpCore OSGi bundle</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3c897383/httpcore/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore/pom.xml b/httpcore/pom.xml
index 3eec1dc..3c4de7c 100644
--- a/httpcore/pom.xml
+++ b/httpcore/pom.xml
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.2.3-SNAPSHOT</version>
+ <version>4.2.4-SNAPSHOT</version>
</parent>
<artifactId>httpcore</artifactId>
<name>HttpCore</name>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3c897383/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 40488ec..7211bfd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>httpcomponents-core</artifactId>
<name>HttpComponents Core</name>
- <version>4.2.3-SNAPSHOT</version>
+ <version>4.2.4-SNAPSHOT</version>
<description>Core components to build HTTP enabled services</description>
<url>http://hc.apache.org/httpcomponents-core</url>
<inceptionYear>2005</inceptionYear>
[10/50] httpcomponents-core git commit: HTTPCORE-319: terminate
non-blocking SSLIOSession if the SSL handshake is aborted by the oppositve
endpoint leaving the SSL engine in the NEED_UNWRAP state
Posted by ol...@apache.org.
HTTPCORE-319: terminate non-blocking SSLIOSession if the SSL handshake is aborted by the oppositve endpoint leaving the SSL engine in the NEED_UNWRAP state
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1418951 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/e8063d96
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/e8063d96
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/e8063d96
Branch: refs/heads/4.2.x
Commit: e8063d965d1f522e318b7f3ed186a951307b59a0
Parents: 522e23f
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sun Dec 9 13:42:10 2012 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sun Dec 9 13:42:10 2012 +0000
----------------------------------------------------------------------
.../java/org/apache/http/nio/reactor/ssl/SSLIOSession.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/e8063d96/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index 1a08f5c..2613b66 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -288,10 +288,16 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
}
private void updateEventMask() {
+ // Graceful session termination
if (this.status == CLOSING && this.sslEngine.isOutboundDone()
&& (this.endOfStream || this.sslEngine.isInboundDone())) {
this.status = CLOSED;
}
+ // Abnormal session termination
+ if (this.status == ACTIVE && this.endOfStream
+ && this.sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_UNWRAP) {
+ this.status = CLOSED;
+ }
if (this.status == CLOSED) {
this.session.close();
return;
[17/50] httpcomponents-core git commit: developed by => developed at
: see http://www.apache.org/legal/reports.html#2006-05-24 section 6C
Posted by ol...@apache.org.
developed by => developed at : see http://www.apache.org/legal/reports.html#2006-05-24 section 6C
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1440720 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/4a13f440
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/4a13f440
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/4a13f440
Branch: refs/heads/4.2.x
Commit: 4a13f4404285b633f499152c66b69ab2c476d36d
Parents: 12a8cd8
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jan 30 22:40:33 2013 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jan 30 22:40:33 2013 +0000
----------------------------------------------------------------------
NOTICE.txt | 2 +-
pom.xml | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/4a13f440/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
index 3487321..3f40109 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,7 +1,7 @@
Apache HttpComponents Core
Copyright 2005-2012 The Apache Software Foundation
-This product includes software developed by
+This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
This project contains annotations derived from JCIP-ANNOTATIONS
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/4a13f440/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7211bfd..d2809a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,6 +80,10 @@
<api.comparison.version>4.2</api.comparison.version>
</properties>
+<prerequisites>
+ <maven>2.2.1</maven>
+</prerequisites>
+
<dependencyManagement>
<dependencies>
<dependency>
[19/50] httpcomponents-core git commit: Accept as many as incoming
connections as possible from the listener's server channel
Posted by ol...@apache.org.
Accept as many as incoming connections as possible from the listener's server channel
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1444383 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/b54b88a5
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/b54b88a5
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/b54b88a5
Branch: refs/heads/4.2.x
Commit: b54b88a5dc01c8c285f475ae165752c419ba8455
Parents: 2dac292
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sat Feb 9 16:07:31 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat Feb 9 16:07:31 2013 +0000
----------------------------------------------------------------------
.../nio/reactor/DefaultListeningIOReactor.java | 24 +++++++++++---------
1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/b54b88a5/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
index 8fc26b0..2a24c98 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
@@ -162,18 +162,20 @@ public class DefaultListeningIOReactor extends AbstractMultiworkerIOReactor
if (key.isAcceptable()) {
ServerSocketChannel serverChannel = (ServerSocketChannel) key.channel();
- SocketChannel socketChannel = null;
- try {
- socketChannel = serverChannel.accept();
- } catch (IOException ex) {
- if (this.exceptionHandler == null ||
- !this.exceptionHandler.handle(ex)) {
- throw new IOReactorException(
- "Failure accepting connection", ex);
+ for (;;) {
+ SocketChannel socketChannel = null;
+ try {
+ socketChannel = serverChannel.accept();
+ } catch (IOException ex) {
+ if (this.exceptionHandler == null ||
+ !this.exceptionHandler.handle(ex)) {
+ throw new IOReactorException(
+ "Failure accepting connection", ex);
+ }
+ }
+ if (socketChannel == null) {
+ break;
}
- }
-
- if (socketChannel != null) {
try {
prepareSocket(socketChannel.socket());
} catch (IOException ex) {
[02/50] httpcomponents-core git commit: Updated HttpCore 4.2.3
release notes
Posted by ol...@apache.org.
Updated HttpCore 4.2.3 release notes
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1412456 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/d64f9ef9
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/d64f9ef9
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/d64f9ef9
Branch: refs/heads/4.2.x
Commit: d64f9ef9028c53ed2a99a01ab9e931c0ebb1034f
Parents: 9aea100
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Thu Nov 22 09:02:35 2012 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Thu Nov 22 09:02:35 2012 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d64f9ef9/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 1d9231e..848e702 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,5 +1,15 @@
-Changes since Release 4.2.2
-=======
+Release 4.2.3
+-------------------
+
+This is a maintenance release that fixes a number of bugs and found since 4.2.2 including
+a major bug in the NIO module that can cause an infinite loop in SSL sessions under special
+circumstances when the remote peer terminates the session in the middle of SSL handshake.
+Please note this issue does not affect blocking I/O components used by HttpClient.
+
+Users of HttpCore NIO of all versions are advised to upgrade.
+
+Changelog
+-------------------
* [HTTPCORE-319, HTTPCORE-322] Non-blocking SSLIOSession can enter an infinite loop under
special circumstances when the remote peer terminates the session in the middle of SSL handshake.
[29/50] httpcomponents-core git commit: HTTPCORE-336: Unhandled
CancelledKeyException leads to a shutdown of the underlying IOReactor
Contributed by Thomas Dudek
Posted by ol...@apache.org.
HTTPCORE-336: Unhandled CancelledKeyException leads to a shutdown of the underlying IOReactor
Contributed by Thomas Dudek <mail.dudek at gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1463609 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/005878d1
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/005878d1
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/005878d1
Branch: refs/heads/4.2.x
Commit: 005878d197b2e5ce0138a88974b2ac1c1c5349af
Parents: 3357a32
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Tue Apr 2 16:10:32 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Tue Apr 2 16:10:32 2013 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 7 +++++
.../impl/nio/reactor/AbstractIOReactor.java | 29 +++++++++++---------
2 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/005878d1/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 63c5199..bada959 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,3 +1,10 @@
+Changes since Release 4.2.4
+-------------------
+
+* [HTTPCORE-336] Unhandled CancelledKeyException leads to a shutdown of the underlying IOReactor.
+ Contributed by Thomas Dudek <mail.dudek at gmail.com>
+
+
Release 4.2.4
-------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/005878d1/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
index b3e7f95..1d678f3 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
@@ -403,22 +403,25 @@ public abstract class AbstractIOReactor implements IOReactor {
};
}
- IOSession session = new IOSessionImpl(key, interestOpsCallback, sessionClosedCallback);
-
- int timeout = 0;
+ IOSession session;
try {
- timeout = channel.socket().getSoTimeout();
- } catch (IOException ex) {
- // Very unlikely to happen and is not fatal
- // as the protocol layer is expected to overwrite
- // this value anyways
- }
-
- session.setAttribute(IOSession.ATTACHMENT_KEY, entry.getAttachment());
- session.setSocketTimeout(timeout);
- this.sessions.add(session);
+ session = new IOSessionImpl(key, interestOpsCallback, sessionClosedCallback);
+ int timeout = 0;
+ try {
+ timeout = channel.socket().getSoTimeout();
+ } catch (final IOException ex) {
+ // Very unlikely to happen and is not fatal
+ // as the protocol layer is expected to overwrite
+ // this value anyways
+ }
+ session.setAttribute(IOSession.ATTACHMENT_KEY, entry.getAttachment());
+ session.setSocketTimeout(timeout);
+ } catch (final CancelledKeyException ex) {
+ continue;
+ }
try {
+ this.sessions.add(session);
SessionRequestImpl sessionRequest = entry.getSessionRequest();
if (sessionRequest != null) {
sessionRequest.completed(session);
[16/50] httpcomponents-core git commit: Do not automatically close
HttpAsyncRequestExecutionHandler on an I/O error allowing the handler to
retry
Posted by ol...@apache.org.
Do not automatically close HttpAsyncRequestExecutionHandler on an I/O error allowing the handler to retry
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1439903 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/12a8cd8d
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/12a8cd8d
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/12a8cd8d
Branch: refs/heads/4.2.x
Commit: 12a8cd8d2aba45064b8bd6b4b0b77addd499e3af
Parents: 576ac96
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Tue Jan 29 14:19:02 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Tue Jan 29 14:19:02 2013 +0000
----------------------------------------------------------------------
.../nio/protocol/HttpAsyncRequestExecutor.java | 31 ++++++++++----------
.../protocol/TestHttpAsyncRequestExecutor.java | 2 --
2 files changed, 15 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/12a8cd8d/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
index a6009b5..282fc72 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
@@ -104,8 +104,8 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
public void closed(final NHttpClientConnection conn) {
State state = getState(conn);
HttpAsyncRequestExecutionHandler<?> handler = getHandler(conn);
- if (state == null || !state.isValid()) {
- closeHandler(handler, null);
+ if (state == null || (handler != null && handler.isDone())) {
+ closeHandler(handler);
}
if (state != null) {
state.reset();
@@ -117,7 +117,7 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
shutdownConnection(conn);
HttpAsyncRequestExecutionHandler<?> handler = getHandler(conn);
if (handler != null) {
- closeHandler(handler, cause);
+ handler.failed(cause);
} else {
log(cause);
}
@@ -131,7 +131,7 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
}
HttpAsyncRequestExecutionHandler<?> handler = getHandler(conn);
if (handler != null && handler.isDone()) {
- closeHandler(handler, null);
+ closeHandler(handler);
state.reset();
handler = null;
}
@@ -258,7 +258,8 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
if (state != null) {
if (state.getRequestState().compareTo(MessageState.READY) != 0) {
state.invalidate();
- closeHandler(getHandler(conn), new ConnectionClosedException("Connection closed"));
+ HttpAsyncRequestExecutionHandler<?> handler = getHandler(conn);
+ handler.failed(new ConnectionClosedException("Connection closed"));
}
}
// Closing connection in an orderly manner and
@@ -283,7 +284,11 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
return;
} else {
state.invalidate();
- closeHandler(getHandler(conn), new SocketTimeoutException());
+ HttpAsyncRequestExecutionHandler<?> handler = getHandler(conn);
+ if (handler != null) {
+ handler.failed(new SocketTimeoutException());
+ handler.close();
+ }
}
}
if (conn.getStatus() == NHttpConnection.ACTIVE) {
@@ -337,18 +342,12 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
}
}
- private void closeHandler(final HttpAsyncRequestExecutionHandler<?> handler, final Exception ex) {
+ private void closeHandler(final HttpAsyncRequestExecutionHandler<?> handler) {
if (handler != null) {
try {
- if (ex != null) {
- handler.failed(ex);
- }
- } finally {
- try {
- handler.close();
- } catch (IOException ioex) {
- log(ioex);
- }
+ handler.close();
+ } catch (IOException ioex) {
+ log(ioex);
}
}
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/12a8cd8d/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java b/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java
index 68ce3a7..76a33b2 100644
--- a/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java
+++ b/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java
@@ -148,7 +148,6 @@ public class TestHttpAsyncRequestExecutor {
this.protocolHandler.exception(this.conn, httpex);
Mockito.verify(this.exchangeHandler).failed(httpex);
- Mockito.verify(this.exchangeHandler).close();
Mockito.verify(this.conn).shutdown();
}
@@ -164,7 +163,6 @@ public class TestHttpAsyncRequestExecutor {
this.protocolHandler.exception(this.conn, ioex);
Mockito.verify(this.exchangeHandler).failed(ioex);
- Mockito.verify(this.exchangeHandler).close();
Mockito.verify(this.conn).shutdown();
}
[35/50] httpcomponents-core git commit: Added Idea config files to
gitignore
Posted by ol...@apache.org.
Added Idea config files to gitignore
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1493388 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/9f349464
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/9f349464
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/9f349464
Branch: refs/heads/4.2.x
Commit: 9f34946428d271d995016ff2200faa4dd1c23cbb
Parents: d73a24e
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sat Jun 15 16:20:21 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat Jun 15 16:20:21 2013 +0000
----------------------------------------------------------------------
.gitignore | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/9f349464/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index f9e3d68..cc6db32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
.clover
target
maven-eclipse.xml
+.idea
+*.iml
[05/50] httpcomponents-core git commit: - Removed duplicate entries
in RELEASE_NOTES.txt
Posted by ol...@apache.org.
- Removed duplicate entries in RELEASE_NOTES.txt
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1412884 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/5e3b7a2a
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/5e3b7a2a
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/5e3b7a2a
Branch: refs/heads/4.2.x
Commit: 5e3b7a2ab31b967e750c02895f671e55748efdc3
Parents: 6342dc7
Author: Bill Speirs <ws...@apache.org>
Authored: Fri Nov 23 13:33:31 2012 +0000
Committer: Bill Speirs <ws...@apache.org>
Committed: Fri Nov 23 13:33:31 2012 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 7 -------
1 file changed, 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/5e3b7a2a/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 8194dc7..e773196 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -23,13 +23,6 @@ Changelog
released from the session request callback causing a resource leak.
Contributed by Scott Stanton <snstanton at gmail.com>
-* [HTTPCORE-313] ContentType#parse now ignores empty attributes. HttpEntityUtils#toString now
- throws checked I/O exception if it encounters an unsupported charset.
-
-* [HTTPCORE-315] AbstractNIOConnPool fails to correctly deallocate connection if it is immediately
- released from the session request callback causing a resource leak.
- Contributed by Scott Stanton <snstanton at gmail.com>
-
* [HTTPCORE-313] ContentType#parse now ignores empty and blank charset attributes.
HttpEntityUtils#toString now throws checked I/O exception if it encounters an unsupported
charset.
[12/50] httpcomponents-core git commit: HTTPCORE-328,
HTTPCORE-329: EntityUtils#toString ignores the default charset if
there is no ContentType in a http response
Posted by ol...@apache.org.
HTTPCORE-328, HTTPCORE-329: EntityUtils#toString ignores the default charset if there is no ContentType in a http response
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1435088 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/0b9f6cb1
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/0b9f6cb1
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/0b9f6cb1
Branch: refs/heads/4.2.x
Commit: 0b9f6cb13bd7e57016767d1cb6b4d787c4ccb93c
Parents: a64b98c
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Jan 18 11:11:22 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Jan 18 11:11:22 2013 +0000
----------------------------------------------------------------------
httpcore/src/main/java/org/apache/http/util/EntityUtils.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/0b9f6cb1/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
----------------------------------------------------------------------
diff --git a/httpcore/src/main/java/org/apache/http/util/EntityUtils.java b/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
index 8739cdd..85bc830 100644
--- a/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
+++ b/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
@@ -213,9 +213,11 @@ public final class EntityUtils {
}
Charset charset = null;
try {
- ContentType contentType = ContentType.getOrDefault(entity);
- charset = contentType.getCharset();
- } catch (UnsupportedCharsetException ex) {
+ ContentType contentType = ContentType.get(entity);
+ if (contentType != null) {
+ charset = contentType.getCharset();
+ }
+ } catch (final UnsupportedCharsetException ex) {
throw new UnsupportedEncodingException(ex.getMessage());
}
if (charset == null) {
[25/50] httpcomponents-core git commit: Update copyrights in
NOTICE.txt files to 2013
Posted by ol...@apache.org.
Update copyrights in NOTICE.txt files to 2013
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1458727 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/dd52f94e
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/dd52f94e
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/dd52f94e
Branch: refs/heads/4.2.x
Commit: dd52f94e119791f341553dc491e84f9d79c5e715
Parents: 96bbd7b
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed Mar 20 10:32:29 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Mar 20 10:32:29 2013 +0000
----------------------------------------------------------------------
NOTICE.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/dd52f94e/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
index 3f40109..3e59692 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,8 +1,8 @@
Apache HttpComponents Core
-Copyright 2005-2012 The Apache Software Foundation
+Copyright 2005-2013 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
\ No newline at end of file
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
[27/50] httpcomponents-core git commit: Add missing @since markers
Posted by ol...@apache.org.
Add missing @since markers
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1459575 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/a78464f2
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/a78464f2
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/a78464f2
Branch: refs/heads/4.2.x
Commit: a78464f2b52c85b3147fe09f12c873b497732744
Parents: 82bf919
Author: Sebastian Bazley <se...@apache.org>
Authored: Thu Mar 21 23:14:46 2013 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Thu Mar 21 23:14:46 2013 +0000
----------------------------------------------------------------------
.../java/org/apache/http/impl/nio/reactor/IOReactorConfig.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/a78464f2/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
index f555b39..473d070 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
@@ -294,6 +294,7 @@ public final class IOReactorConfig implements Cloneable {
* Default: <code>0</code> (system default)
*
* @see SocketOptions#SO_SNDBUF
+ * @since 4.2.4
*/
public int getSndBufSize() {
return sndBufSize;
@@ -304,6 +305,7 @@ public final class IOReactorConfig implements Cloneable {
* for newly created sockets.
*
* @see SocketOptions#SO_SNDBUF
+ * @since 4.2.4
*/
public void setSndBufSize(int sndBufSize) {
this.sndBufSize = sndBufSize;
@@ -316,6 +318,7 @@ public final class IOReactorConfig implements Cloneable {
* Default: <code>0</code> (system default)
*
* @see SocketOptions#SO_RCVBUF
+ * @since 4.2.4
*/
public int getRcvBufSize() {
return rcvBufSize;
@@ -326,6 +329,7 @@ public final class IOReactorConfig implements Cloneable {
* for newly created sockets.
*
* @see SocketOptions#SO_RCVBUF
+ * @since 4.2.4
*/
public void setRcvBufSize(int rcvBufSize) {
this.rcvBufSize = rcvBufSize;
[42/50] httpcomponents-core git commit: Updated HttpCore 4.2.5
release notes
Posted by ol...@apache.org.
Updated HttpCore 4.2.5 release notes
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1503269 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/e4045960
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/e4045960
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/e4045960
Branch: refs/heads/4.2.x
Commit: e4045960e67b84a6481c954e59d2388daf3e5bd3
Parents: 230bb2e
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Mon Jul 15 14:29:15 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Mon Jul 15 14:29:15 2013 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/e4045960/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 50c60ea..507ed64 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,4 +1,13 @@
-Changes since Release 4.2.4
+Release 4.2.5
+-------------------
+
+This maintenance release fixes a number of bugs found in NIO components since 4.2.4. We advise
+users of HttpCore NIO of all versions to upgrade.
+
+This is likely to be the last release in the 4.2.x branch.
+
+
+Changelog
-------------------
* [HTTPCORE-345] EntityAsyncContentProducer fails to release resources allocated by the underlying
[44/50] httpcomponents-core git commit: Explicit boxing
Posted by ol...@apache.org.
Explicit boxing
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1504521 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/1228557f
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/1228557f
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/1228557f
Branch: refs/heads/4.2.x
Commit: 1228557f852915b84bb008a47999fa8edc9d1a0a
Parents: 9b79d3f
Author: Sebastian Bazley <se...@apache.org>
Authored: Thu Jul 18 16:57:28 2013 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Thu Jul 18 16:57:28 2013 +0000
----------------------------------------------------------------------
.../java/org/apache/http/nio/protocol/NullRequestConsumer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/1228557f/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java
index 196cf2d..2ffeaaf 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java
@@ -66,7 +66,7 @@ class NullRequestConsumer implements HttpAsyncRequestConsumer<Object> {
}
public Object getResult() {
- return this.completed;
+ return Boolean.valueOf(this.completed);
}
public Exception getException() {
[04/50] httpcomponents-core git commit: Spurious "and"
Posted by ol...@apache.org.
Spurious "and"
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1412549 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/6342dc77
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/6342dc77
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/6342dc77
Branch: refs/heads/4.2.x
Commit: 6342dc77566ca8e46d59b10f3b4520879d6dd169
Parents: 9c9b505
Author: Sebastian Bazley <se...@apache.org>
Authored: Thu Nov 22 13:47:18 2012 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Thu Nov 22 13:47:18 2012 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/6342dc77/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 848e702..8194dc7 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,7 +1,7 @@
Release 4.2.3
-------------------
-This is a maintenance release that fixes a number of bugs and found since 4.2.2 including
+This is a maintenance release that fixes a number of bugs found since 4.2.2 including
a major bug in the NIO module that can cause an infinite loop in SSL sessions under special
circumstances when the remote peer terminates the session in the middle of SSL handshake.
Please note this issue does not affect blocking I/O components used by HttpClient.
[18/50] httpcomponents-core git commit: revert accidental commit in
rr1440720
Posted by ol...@apache.org.
revert accidental commit in rr1440720
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1440721 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/2dac292a
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/2dac292a
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/2dac292a
Branch: refs/heads/4.2.x
Commit: 2dac292ae0d1c0ea9613308d28f0a4fa54a2dff1
Parents: 4a13f44
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jan 30 22:43:38 2013 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jan 30 22:43:38 2013 +0000
----------------------------------------------------------------------
pom.xml | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/2dac292a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d2809a3..7211bfd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,10 +80,6 @@
<api.comparison.version>4.2</api.comparison.version>
</properties>
-<prerequisites>
- <maven>2.2.1</maven>
-</prerequisites>
-
<dependencyManagement>
<dependencies>
<dependency>
[37/50] httpcomponents-core git commit: Upgraded HC parent POM to 7
Posted by ol...@apache.org.
Upgraded HC parent POM to 7
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1499260 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/b27fc704
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/b27fc704
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/b27fc704
Branch: refs/heads/4.2.x
Commit: b27fc704df203273f472ec597fec429ccc7e4475
Parents: 4797808
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed Jul 3 08:40:07 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Jul 3 08:40:07 2013 +0000
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/b27fc704/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8435104..9222c56 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<parent>
<artifactId>project</artifactId>
<groupId>org.apache.httpcomponents</groupId>
- <version>6</version>
+ <version>7</version>
<relativePath>../project/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
[15/50] httpcomponents-core git commit: HTTPCORE-331: fixed possible
race condition in case of an exceptional condition (such as an I/O error)
Posted by ol...@apache.org.
HTTPCORE-331: fixed possible race condition in case of an exceptional condition (such as an I/O error)
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1435160 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/576ac96e
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/576ac96e
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/576ac96e
Branch: refs/heads/4.2.x
Commit: 576ac96e8c891a653d61e9ca55c93cc8e80378c9
Parents: d0569b2
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Jan 18 14:31:52 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Jan 18 14:31:52 2013 +0000
----------------------------------------------------------------------
.../java/org/apache/http/nio/protocol/HttpAsyncRequester.java | 3 ++-
.../java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/576ac96e/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java
index 84dee82..12f9d81 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java
@@ -110,7 +110,6 @@ public class HttpAsyncRequester {
private <T> void doExecute(
final HttpAsyncRequestExecutionHandler<T> handler, final NHttpClientConnection conn) {
conn.getContext().setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, handler);
- conn.requestOutput();
if (!conn.isOpen()) {
handler.failed(new ConnectionClosedException("Connection closed"));
try {
@@ -118,6 +117,8 @@ public class HttpAsyncRequester {
} catch (IOException ex) {
log(ex);
}
+ } else {
+ conn.requestOutput();
}
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/576ac96e/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java b/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java
index 89e42b7..7006760 100644
--- a/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java
+++ b/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java
@@ -162,6 +162,7 @@ public class TestHttpAsyncRequester {
@Test
public void testSimpleExecute() throws Exception {
+ Mockito.when(this.conn.isOpen()).thenReturn(Boolean.TRUE);
Future<Object> future = this.requester.execute(
this.requestProducer,
this.responseConsumer,
[32/50] httpcomponents-core git commit: Non-blocking connection pool
to avoid scanning the entire queue of pending connection requests on each
connection lease / release operation (under heavy load the request queue can
contain a significant number of pe
Posted by ol...@apache.org.
Non-blocking connection pool to avoid scanning the entire queue of pending connection requests on each connection lease / release operation (under heavy load the request queue can contain a significant number of pending requests, a full linear scan of which can cause massive performance degradation)
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1478038 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/579fdb55
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/579fdb55
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/579fdb55
Branch: refs/heads/4.2.x
Commit: 579fdb559c623c21b1ca1c00774fd5c11017fcb1
Parents: a8c8e4e
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed May 1 14:58:17 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed May 1 14:58:17 2013 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 9 +
.../http/nio/pool/AbstractNIOConnPool.java | 164 ++++++++++---------
2 files changed, 99 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/579fdb55/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index bada959..0338632 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,6 +1,15 @@
Changes since Release 4.2.4
-------------------
+* Non-blocking connection pool to avoid scanning the entire queue of pending connection requests
+ on each connection lease / release operation (under heavy load the request queue can contain
+ a significant number of pending requests, a full linear scan of which can cause massive
+ performance degradation).
+ Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Use bulk ByteBuffer#put method instead of single byte ByteBuffer#put
+ Contributed by Oleg Kalnichevski <olegk at apache.org>
+
* [HTTPCORE-336] Unhandled CancelledKeyException leads to a shutdown of the underlying IOReactor.
Contributed by Thomas Dudek <mail.dudek at gmail.com>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/579fdb55/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java b/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
index 4754c26..2344a96 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
@@ -187,9 +187,9 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
long timeout = connectTimeout > 0 ? tunit.toMillis(connectTimeout) : 0;
BasicFuture<E> future = new BasicFuture<E>(callback);
LeaseRequest<T, C, E> request = new LeaseRequest<T, C, E>(route, state, timeout, future);
- this.leasingRequests.add(request);
-
- processPendingRequests();
+ if (!processPendingRequest(request)) {
+ this.leasingRequests.add(request);
+ }
return future;
} finally {
this.lock.unlock();
@@ -221,7 +221,7 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
} else {
entry.close();
}
- processPendingRequests();
+ processNextPendingRequest();
}
} finally {
this.lock.unlock();
@@ -232,85 +232,101 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
ListIterator<LeaseRequest<T, C, E>> it = this.leasingRequests.listIterator();
while (it.hasNext()) {
LeaseRequest<T, C, E> request = it.next();
+ if (processPendingRequest(request)) {
+ it.remove();
+ }
+ }
+ }
- T route = request.getRoute();
- Object state = request.getState();
- long deadline = request.getDeadline();
- BasicFuture<E> future = request.getFuture();
-
- long now = System.currentTimeMillis();
- if (now > deadline) {
+ private void processNextPendingRequest() {
+ ListIterator<LeaseRequest<T, C, E>> it = this.leasingRequests.listIterator();
+ while (it.hasNext()) {
+ LeaseRequest<T, C, E> request = it.next();
+ if (processPendingRequest(request)) {
it.remove();
- future.failed(new TimeoutException());
- continue;
+ return;
}
+ }
+ }
- RouteSpecificPool<T, C, E> pool = getPool(route);
- E entry = null;
- for (;;) {
- entry = pool.getFree(state);
- if (entry == null) {
- break;
- }
- if (entry.isClosed() || entry.isExpired(System.currentTimeMillis())) {
- entry.close();
- this.available.remove(entry);
- pool.free(entry, false);
- } else {
- break;
- }
+ private boolean processPendingRequest(final LeaseRequest<T, C, E> request) {
+ T route = request.getRoute();
+ Object state = request.getState();
+ long deadline = request.getDeadline();
+ BasicFuture<E> future = request.getFuture();
+
+ long now = System.currentTimeMillis();
+ if (now > deadline) {
+ future.failed(new TimeoutException());
+ return true;
+ }
+
+ RouteSpecificPool<T, C, E> pool = getPool(route);
+ E entry = null;
+ for (;;) {
+ entry = pool.getFree(state);
+ if (entry == null) {
+ break;
}
- if (entry != null) {
- it.remove();
+ if (entry.isClosed() || entry.isExpired(System.currentTimeMillis())) {
+ entry.close();
this.available.remove(entry);
- this.leased.add(entry);
- future.completed(entry);
- continue;
+ pool.free(entry, false);
+ } else {
+ break;
}
-
- // New connection is needed
- int maxPerRoute = getMax(route);
- // Shrink the pool prior to allocating a new connection
- int excess = Math.max(0, pool.getAllocatedCount() + 1 - maxPerRoute);
- if (excess > 0) {
- for (int i = 0; i < excess; i++) {
- E lastUsed = pool.getLastUsed();
- if (lastUsed == null) {
- break;
- }
- lastUsed.close();
- this.available.remove(lastUsed);
- pool.remove(lastUsed);
+ }
+ if (entry != null) {
+ this.available.remove(entry);
+ this.leased.add(entry);
+ future.completed(entry);
+ return true;
+ }
+
+ // New connection is needed
+ int maxPerRoute = getMax(route);
+ // Shrink the pool prior to allocating a new connection
+ int excess = Math.max(0, pool.getAllocatedCount() + 1 - maxPerRoute);
+ if (excess > 0) {
+ for (int i = 0; i < excess; i++) {
+ E lastUsed = pool.getLastUsed();
+ if (lastUsed == null) {
+ break;
}
+ lastUsed.close();
+ this.available.remove(lastUsed);
+ pool.remove(lastUsed);
}
+ }
- if (pool.getAllocatedCount() < maxPerRoute) {
- int totalUsed = this.pending.size() + this.leased.size();
- int freeCapacity = Math.max(this.maxTotal - totalUsed, 0);
- if (freeCapacity == 0) {
- continue;
- }
- int totalAvailable = this.available.size();
- if (totalAvailable > freeCapacity - 1) {
- if (!this.available.isEmpty()) {
- E lastUsed = this.available.removeLast();
- lastUsed.close();
- RouteSpecificPool<T, C, E> otherpool = getPool(lastUsed.getRoute());
- otherpool.remove(lastUsed);
- }
+ if (pool.getAllocatedCount() < maxPerRoute) {
+ int totalUsed = this.pending.size() + this.leased.size();
+ int freeCapacity = Math.max(this.maxTotal - totalUsed, 0);
+ if (freeCapacity == 0) {
+ return false;
+ }
+ int totalAvailable = this.available.size();
+ if (totalAvailable > freeCapacity - 1) {
+ if (!this.available.isEmpty()) {
+ E lastUsed = this.available.removeLast();
+ lastUsed.close();
+ RouteSpecificPool<T, C, E> otherpool = getPool(lastUsed.getRoute());
+ otherpool.remove(lastUsed);
}
- it.remove();
- SessionRequest sessionRequest = this.ioreactor.connect(
- resolveRemoteAddress(route),
- resolveLocalAddress(route),
- route,
- this.sessionRequestCallback);
- int timout = request.getConnectTimeout() < Integer.MAX_VALUE ?
- (int) request.getConnectTimeout() : Integer.MAX_VALUE;
- sessionRequest.setConnectTimeout(timout);
- this.pending.add(sessionRequest);
- pool.addPending(sessionRequest, future);
}
+ SessionRequest sessionRequest = this.ioreactor.connect(
+ resolveRemoteAddress(route),
+ resolveLocalAddress(route),
+ route,
+ this.sessionRequestCallback);
+ int timout = request.getConnectTimeout() < Integer.MAX_VALUE ?
+ (int) request.getConnectTimeout() : Integer.MAX_VALUE;
+ sessionRequest.setConnectTimeout(timout);
+ this.pending.add(sessionRequest);
+ pool.addPending(sessionRequest, future);
+ return true;
+ } else {
+ return false;
}
}
@@ -369,7 +385,7 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
this.pending.remove(request);
RouteSpecificPool<T, C, E> pool = getPool(route);
pool.cancelled(request);
- processPendingRequests();
+ processNextPendingRequest();
} finally {
this.lock.unlock();
}
@@ -386,7 +402,7 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
this.pending.remove(request);
RouteSpecificPool<T, C, E> pool = getPool(route);
pool.failed(request, request.getException());
- processPendingRequests();
+ processNextPendingRequest();
} finally {
this.lock.unlock();
}
@@ -403,7 +419,7 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
this.pending.remove(request);
RouteSpecificPool<T, C, E> pool = getPool(route);
pool.timeout(request);
- processPendingRequests();
+ processNextPendingRequest();
} finally {
this.lock.unlock();
}
[09/50] httpcomponents-core git commit: HTTPCORE-319: Non-blocking
SSLIOSession can fail to shut down correctly when the underlying connection
gets terminated abnormally by the opposite endpoint in case there is a
truncated or corrupted encrypted content
Posted by ol...@apache.org.
HTTPCORE-319: Non-blocking SSLIOSession can fail to shut down correctly when the underlying connection gets terminated abnormally by the opposite endpoint in case there is a truncated or corrupted encrypted content in the input buffer and there is still data in the output buffer that needs to be flushed out (most likely to occur with POST or PUT requests)
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1415878 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/522e23f7
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/522e23f7
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/522e23f7
Branch: refs/heads/4.2.x
Commit: 522e23f73a9fdf5be6278ff67a809ce4890aea53
Parents: 3c89738
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Nov 30 22:47:58 2012 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Nov 30 22:47:58 2012 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 10 ++++++++
.../nio/protocol/HttpAsyncRequestExecutor.java | 7 ++++++
.../http/nio/protocol/HttpAsyncService.java | 7 ++++++
.../http/nio/reactor/ssl/SSLIOSession.java | 24 ++++++++++++++++++--
4 files changed, 46 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/522e23f7/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 7fb79d2..e52b12e 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,3 +1,13 @@
+Changes since 4.2.3
+
+* [HTTPCORE-319] Non-blocking SSLIOSession can fail to shut down correctly when the underlying
+ connection gets terminated abnormally by the opposite endpoint in case there is a truncated or
+ corrupted encrypted content in the input buffer and there is still data in the output buffer
+ that needs to be flushed out (most likely to occur with POST or PUT requests).
+ Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+
+
Release 4.2.3
-------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/522e23f7/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
index 675b5f6..a6009b5 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
@@ -261,6 +261,13 @@ public class HttpAsyncRequestExecutor implements NHttpClientEventHandler {
closeHandler(getHandler(conn), new ConnectionClosedException("Connection closed"));
}
}
+ // Closing connection in an orderly manner and
+ // waiting for output buffer to get flushed.
+ // Do not want to wait indefinitely, though, in case
+ // the opposite end is not reading
+ if (conn.getSocketTimeout() <= 0) {
+ conn.setSocketTimeout(1000);
+ }
conn.close();
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/522e23f7/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
index 9b602c8..f8e9fa4 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
@@ -355,6 +355,13 @@ public class HttpAsyncService implements NHttpServerEventHandler {
}
public void endOfInput(final NHttpServerConnection conn) throws IOException {
+ // Closing connection in an orderly manner and
+ // waiting for output buffer to get flushed.
+ // Do not want to wait indefinitely, though, in case
+ // the opposite end is not reading
+ if (conn.getSocketTimeout() <= 0) {
+ conn.setSocketTimeout(1000);
+ }
conn.close();
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/522e23f7/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index 8f8dc93..1a08f5c 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -304,7 +304,7 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
newMask = EventMask.READ_WRITE;
break;
case NEED_UNWRAP:
- newMask = EventMask.READ;
+ newMask = EventMask.READ | (this.appEventMask & EventMask.WRITE);
break;
case NOT_HANDSHAKING:
newMask = this.appEventMask;
@@ -354,6 +354,9 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
if (result.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING) {
break;
}
+ if (this.endOfStream) {
+ break;
+ }
}
return decrypted;
}
@@ -563,8 +566,17 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
this.session.setAttribute(name, obj);
}
+ private static void formatOps(final StringBuilder buffer, int ops) {
+ if ((ops & SelectionKey.OP_READ) > 0) {
+ buffer.append('r');
+ }
+ if ((ops & SelectionKey.OP_WRITE) > 0) {
+ buffer.append('w');
+ }
+ }
+
@Override
- public String toString() {
+ public synchronized String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append(this.session);
buffer.append("[");
@@ -580,7 +592,15 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
break;
}
buffer.append("][");
+ formatOps(buffer, this.appEventMask);
+ buffer.append("][");
buffer.append(this.sslEngine.getHandshakeStatus());
+ if (this.sslEngine.isInboundDone()) {
+ buffer.append("][inbound done][");
+ }
+ if (this.sslEngine.isOutboundDone()) {
+ buffer.append("][outbound done][");
+ }
if (this.endOfStream) {
buffer.append("][EOF][");
}
[40/50] httpcomponents-core git commit: Removed maven assembly and
release plugin configuration; removed assembly definitions
Posted by ol...@apache.org.
Removed maven assembly and release plugin configuration; removed assembly definitions
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1503224 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/45567a4c
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/45567a4c
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/45567a4c
Branch: refs/heads/4.2.x
Commit: 45567a4cfac9987f59fca914c7e76fbc48ecd53e
Parents: 0bb1864
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Mon Jul 15 13:05:31 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Mon Jul 15 13:05:31 2013 +0000
----------------------------------------------------------------------
pom.xml | 45 --------------------
src/main/assembly/bin.xml | 85 -------------------------------------
src/main/assembly/build.xml | 70 ------------------------------
src/main/assembly/osgi-bin.xml | 80 ----------------------------------
src/main/assembly/src.xml | 48 ---------------------
5 files changed, 328 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/45567a4c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9222c56..cd8bacc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -152,13 +152,6 @@
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
- <id>javadoc-aggregate</id>
- <goals>
- <goal>aggregate</goal>
- </goals>
- <phase>pre-site</phase>
- </execution>
- <execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
@@ -178,37 +171,6 @@
<artifactId>maven-site-plugin</artifactId>
</plugin>
<plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- <descriptor>src/main/assembly/osgi-bin.xml</descriptor>
- <descriptor>src/main/assembly/src.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <inherited>false</inherited>
- <configuration>
- <tasks>
- <ant antfile="src/main/assembly/build.xml">
- <property name="target" value="${project.build.directory}" />
- <property name="package.name" value="${project.artifactId}-${project.version}-bin" />
- </ant>
- <ant antfile="src/main/assembly/build.xml">
- <property name="target" value="${project.build.directory}" />
- <property name="package.name" value="${project.artifactId}-${project.version}-src" />
- </ant>
- <ant antfile="src/main/assembly/build.xml">
- <property name="target" value="${project.build.directory}" />
- <property name="package.name" value="${project.artifactId}-${project.version}-osgi-bin" />
- </ant>
- </tasks>
- </configuration>
- </plugin>
- <plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<dependencies>
@@ -281,13 +243,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- </configuration>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/45567a4c/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/bin.xml b/src/main/assembly/bin.xml
deleted file mode 100644
index bcc8e71..0000000
--- a/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<!--
- $HeadURL$
- $Revision$
-
- ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- ====================================================================
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the Apache Software Foundation. For more
- information on the Apache Software Foundation, please see
- <http://www.apache.org/>.
- -->
-<assembly>
- <id>bin</id>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
- <moduleSets>
- <moduleSet>
- <excludes>
- <exclude>org.apache.httpcomponents:httpcore-osgi</exclude>
- </excludes>
- <binaries>
- <includeDependencies>false</includeDependencies>
- <outputDirectory>/lib</outputDirectory>
- <unpack>false</unpack>
- </binaries>
- </moduleSet>
- </moduleSets>
- <fileSets>
- <fileSet>
- <directory></directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>README.txt</include>
- <include>LICENSE.txt</include>
- <include>NOTICE.txt</include>
- <include>RELEASE_NOTES.txt</include>
- </includes>
- </fileSet>
- <!-- Javadocs -->
- <fileSet>
- <directory>target/site/apidocs</directory>
- <outputDirectory>javadoc</outputDirectory>
- </fileSet>
- <!-- Tutorial -->
- <fileSet>
- <directory>target/site/tutorial</directory>
- <outputDirectory>tutorial</outputDirectory>
- </fileSet>
- <!-- Examples: base module -->
- <fileSet>
- <directory>httpcore/src/examples/</directory>
- <outputDirectory>examples</outputDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <!-- Examples: NIO module -->
- <fileSet>
- <directory>httpcore-nio/src/examples/</directory>
- <outputDirectory>examples</outputDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/45567a4c/src/main/assembly/build.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/build.xml b/src/main/assembly/build.xml
deleted file mode 100644
index 5aeddac..0000000
--- a/src/main/assembly/build.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<!--
- ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- ====================================================================
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the Apache Software Foundation. For more
- information on the Apache Software Foundation, please see
- <http://www.apache.org/>.
- -->
-<project name="assembly-postprocess" default="fixarchives" basedir=".">
-
- <!-- Use property to define the source file types, as it is needed twice -->
- <property name="src.file.types"
- value="**/*.txt **/*.xml **/*.properties **/*.java **/*.html **/*.css **/*.apt **/*.xsl"/>
-
- <target name="fixarchives" depends="_eolcheck,fixzip,fixtgz">
- </target>
-
- <target name="fixzip" unless="native.crlf">
- <property name="tmp.dir" location="${target}/tmp"/>
- <property name="zip.file" location="${target}/${package.name}.zip"/>
- <delete dir="${tmp.dir}" />
- <unzip src="${zip.file}" dest="${tmp.dir}"/>
- <fixcrlf srcdir="${tmp.dir}" eol="crlf" eof="remove" fixlast="false"
- includes="${src.file.types}" />
- <zip destfile="${zip.file}" basedir="${tmp.dir}" duplicate="preserve" />
- <delete dir="${tmp.dir}" />
- </target>
-
- <target name="fixtgz" unless="native.lf">
- <property name="tmp.dir" location="${target}/tmp"/>
- <property name="gz.file" location="${target}/${package.name}.tar.gz"/>
- <property name="tar.file" location="${target}/${package.name}.tar"/>
- <delete dir="${tmp.dir}" />
- <gunzip src="${gz.file}" dest="${tar.file}"/>
- <untar src="${tar.file}" dest="${tmp.dir}"/>
- <fixcrlf srcdir="${tmp.dir}" eol="lf" eof="remove" fixlast="false"
- includes="${src.file.types}" />
- <tar destfile="${tar.file}" basedir="${tmp.dir}" longfile="gnu"/>
- <gzip src="${tar.file}" destfile="${gz.file}"/>
- <delete file="${tar.file}"/>
- <delete dir="${tmp.dir}"/>
- </target>
-
- <!-- Determine if the native format is CRLF or LF (or neither) -->
- <target name="_eolcheck">
- <condition property="native.lf">
- <os family="unix"/>
- </condition>
- <condition property="native.crlf">
- <os family="dos"/>
- </condition>
- </target>
-</project>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/45567a4c/src/main/assembly/osgi-bin.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/osgi-bin.xml b/src/main/assembly/osgi-bin.xml
deleted file mode 100644
index 755c267..0000000
--- a/src/main/assembly/osgi-bin.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<!--
- ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- ====================================================================
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the Apache Software Foundation. For more
- information on the Apache Software Foundation, please see
- <http://www.apache.org/>.
- -->
-<assembly>
- <id>osgi-bin</id>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
- <fileSets>
- <fileSet>
- <directory>httpcore-osgi/target</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>*.jar</include>
- </includes>
- <excludes>
- <exclude>*sources.jar</exclude>
- </excludes>
- </fileSet>
- <fileSet>
- <directory></directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>README.txt</include>
- <include>LICENSE.txt</include>
- <include>NOTICE.txt</include>
- <include>RELEASE_NOTES.txt</include>
- </includes>
- </fileSet>
- <!-- Javadocs -->
- <fileSet>
- <directory>target/site/apidocs</directory>
- <outputDirectory>javadoc</outputDirectory>
- </fileSet>
- <!-- Tutorial -->
- <fileSet>
- <directory>target/site/tutorial</directory>
- <outputDirectory>tutorial</outputDirectory>
- </fileSet>
- <!-- Examples: base module -->
- <fileSet>
- <directory>httpcore/src/examples/</directory>
- <outputDirectory>examples</outputDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <!-- Examples: NIO module -->
- <fileSet>
- <directory>httpcore-nio/src/examples/</directory>
- <outputDirectory>examples</outputDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/45567a4c/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/src.xml b/src/main/assembly/src.xml
deleted file mode 100644
index 3f949b7..0000000
--- a/src/main/assembly/src.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- ====================================================================
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the Apache Software Foundation. For more
- information on the Apache Software Foundation, please see
- <http://www.apache.org/>.
- -->
-<assembly>
- <id>src</id>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
- <fileSets>
- <!-- Release materials -->
- <fileSet>
- <directory></directory>
- <outputDirectory>/</outputDirectory>
- <excludes>
- <exclude>**/.*</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>**/bin/**</exclude>
- <exclude>**/target/**</exclude>
- <exclude>**/local/**</exclude>
- <exclude>**/lib/**</exclude>
- <exclude>*.rdf</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-</assembly>
[30/50] httpcomponents-core git commit: Performance optimization: use
bulk ByteBuffer#put method instead of single byte ByteBuffer#put
Posted by ol...@apache.org.
Performance optimization: use bulk ByteBuffer#put method instead of single byte ByteBuffer#put
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1477535 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/908b8dd0
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/908b8dd0
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/908b8dd0
Branch: refs/heads/4.2.x
Commit: 908b8dd0362726bfbd2dfabf0492b9e0bd900574
Parents: 005878d
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Tue Apr 30 10:32:18 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Tue Apr 30 10:32:18 2013 +0000
----------------------------------------------------------------------
.../http/impl/nio/reactor/SessionInputBufferImpl.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/908b8dd0/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java
index 12f01d8..9eac7a7 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java
@@ -110,8 +110,15 @@ public class SessionInputBufferImpl extends ExpandableBuffer implements SessionI
setOutputMode();
int len = Math.min(dst.remaining(), maxLen);
int chunk = Math.min(this.buffer.remaining(), len);
- for (int i = 0; i < chunk; i++) {
- dst.put(this.buffer.get());
+ if (this.buffer.remaining() > chunk) {
+ int oldLimit = this.buffer.limit();
+ int newLimit = this.buffer.position() + chunk;
+ this.buffer.limit(newLimit);
+ dst.put(this.buffer);
+ this.buffer.limit(oldLimit);
+ return len;
+ } else {
+ dst.put(this.buffer);
}
return chunk;
}
[24/50] httpcomponents-core git commit: Publish javadocs on deployment
Posted by ol...@apache.org.
Publish javadocs on deployment
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1458715 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/96bbd7b5
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/96bbd7b5
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/96bbd7b5
Branch: refs/heads/4.2.x
Commit: 96bbd7b572c8704c9679434e3a8f853daf76ecb2
Parents: 3cc01f4
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed Mar 20 10:09:28 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Mar 20 10:09:28 2013 +0000
----------------------------------------------------------------------
pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/96bbd7b5/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7211bfd..d9372a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,6 +158,12 @@
</goals>
<phase>pre-site</phase>
</execution>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
</executions>
<configuration>
<!-- reduce console output. Can override with -Dquiet=false -->
[49/50] httpcomponents-core git commit: Add missing EOL at EOF
Posted by ol...@apache.org.
Add missing EOL at EOF
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1507134 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f93ea282
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f93ea282
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f93ea282
Branch: refs/heads/4.2.x
Commit: f93ea282a958bdd9f6c2b7ebe03157932d46b630
Parents: c194309
Author: Sebastian Bazley <se...@apache.org>
Authored: Thu Jul 25 21:27:47 2013 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Thu Jul 25 21:27:47 2013 +0000
----------------------------------------------------------------------
httpcore/src/main/appended-resources/META-INF/NOTICE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f93ea282/httpcore/src/main/appended-resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/httpcore/src/main/appended-resources/META-INF/NOTICE b/httpcore/src/main/appended-resources/META-INF/NOTICE
index 589fda5..b2660ff 100644
--- a/httpcore/src/main/appended-resources/META-INF/NOTICE
+++ b/httpcore/src/main/appended-resources/META-INF/NOTICE
@@ -1,2 +1,2 @@
This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
\ No newline at end of file
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
[45/50] httpcomponents-core git commit: Removed web content
Posted by ol...@apache.org.
Removed web content
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1504844 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f2c3748a
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f2c3748a
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f2c3748a
Branch: refs/heads/4.2.x
Commit: f2c3748a6df5ff42dd0e1a8fb218e5c4debaa206
Parents: 1228557
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Jul 19 11:40:25 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Jul 19 11:40:25 2013 +0000
----------------------------------------------------------------------
BUILDING.txt | 30 -----------
httpcore-nio/src/site/apt/index.apt | 44 ---------------
httpcore-nio/src/site/resources/css/site.css | 1 -
httpcore-nio/src/site/site.xml | 40 --------------
httpcore/src/site/apt/index.apt | 44 ---------------
httpcore/src/site/resources/css/site.css | 1 -
httpcore/src/site/site.xml | 40 --------------
src/site/apt/download.apt | 66 -----------------------
src/site/apt/examples.apt | 62 ---------------------
src/site/apt/index.apt | 61 ---------------------
src/site/resources/css/site.css | 1 -
src/site/site.xml | 45 ----------------
12 files changed, 435 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/BUILDING.txt
----------------------------------------------------------------------
diff --git a/BUILDING.txt b/BUILDING.txt
index fa5c15f..f1b720c 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -43,33 +43,3 @@ Execute the following command in order to generate the tutorial in html and pdf
mvn docbkx:generate-pdf docbkx:generate-html
-(5) Building distribution assemblies
-
-Execute the following command in order to build the distribution assemblies
-
-mvn package assembly:assembly
-
-(6) Fix EOL in source files
-
-Fix the archive files so the source files have the correct EOL settings:
-
-mvn antrun:run
-
-(7) Building project web site
-
-Execute the following command in order to generate the project web site:
-
-mvn site
-
-Execute the following command in order to generate the project web site with Clover reports.
-This step is optional:
-
-mvn site -Pclover -Dmaven.clover.licenseLocation=<path>/clover.license
-
-where <path> is a full path to Clover license file
-
-ASF committers can obtain a copy of Clover license donated to the ASF from the SVN repository
-at the following location:
-
-https://svn.apache.org/repos/private/committers/donated-licenses/clover
-
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/httpcore-nio/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/site/apt/index.apt b/httpcore-nio/src/site/apt/index.apt
deleted file mode 100644
index 99a6144..0000000
--- a/httpcore-nio/src/site/apt/index.apt
+++ /dev/null
@@ -1,44 +0,0 @@
-~~ ====================================================================
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-~~ ====================================================================
-~~
-~~ This software consists of voluntary contributions made by many
-~~ individuals on behalf of the Apache Software Foundation. For more
-~~ information on the Apache Software Foundation, please see
-~~ <http://www.apache.org/>.
-
- ----------
- HttpComponents HttpCore NIO Extensions Module
- ----------
- ----------
- ----------
-
-HttpCore (NIO Extensions Module)
-
- This module contains optional extensions to the HttpCore API that
- leverage the event driven, non-blocking I/O (NIO) model.
- HttpCore NIO extensions require a Java 5.0 compatible runtime and
- the HttpCore {{{../httpcore/index.html}base}} module.
-
- {{{./apidocs/index.html}Javadocs}}
-
- {{{./xref/index.html}Project sources}}
-
- {{{./dependencies.html}Dependencies}}
-
- {{{./issue-tracking.html}Issue Tracking}}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/httpcore-nio/src/site/resources/css/site.css
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/site/resources/css/site.css b/httpcore-nio/src/site/resources/css/site.css
deleted file mode 100644
index 017b79d..0000000
--- a/httpcore-nio/src/site/resources/css/site.css
+++ /dev/null
@@ -1 +0,0 @@
-@import url("../../../css/hc-maven.css");
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/httpcore-nio/src/site/site.xml
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/site/site.xml b/httpcore-nio/src/site/site.xml
deleted file mode 100644
index a1b8da0..0000000
--- a/httpcore-nio/src/site/site.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- ====================================================================
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the Apache Software Foundation. For more
- information on the Apache Software Foundation, please see
- <http://www.apache.org/>.
- -->
-
-<project name="HttpCore">
-
- <body>
- <menu name="HttpCore Overview">
- <item name="Description" href="../index.html"/>
- <item name="Examples" href="../examples.html"/>
- </menu>
- <menu name="Modules">
- <item name="HttpCore" href="../httpcore/index.html"/>
- <item name="HttpCore NIO" href="index.html"/>
- </menu>
- </body>
-</project>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/httpcore/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/httpcore/src/site/apt/index.apt b/httpcore/src/site/apt/index.apt
deleted file mode 100644
index f06d39e..0000000
--- a/httpcore/src/site/apt/index.apt
+++ /dev/null
@@ -1,44 +0,0 @@
-~~ ====================================================================
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-~~ ====================================================================
-~~
-~~ This software consists of voluntary contributions made by many
-~~ individuals on behalf of the Apache Software Foundation. For more
-~~ information on the Apache Software Foundation, please see
-~~ <http://www.apache.org/>.
-
- ----------
- HttpComponents HttpCore Base Module
- ----------
- ----------
- ----------
-
-HttpCore (base module)
-
- This is the base module of HttpCore, which contains its public API and the
- default implementation based on the classic Java I/O model.
- The HttpCore API and the default implementation require a Java 1.3
- compatible runtime and have no dependency on any external libraries.
-
- {{{./apidocs/index.html}Javadocs}}
-
- {{{./xref/index.html}Project sources}}
-
- {{{./dependencies.html}Dependencies}}
-
- {{{./issue-tracking.html}Issue Tracking}}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/httpcore/src/site/resources/css/site.css
----------------------------------------------------------------------
diff --git a/httpcore/src/site/resources/css/site.css b/httpcore/src/site/resources/css/site.css
deleted file mode 100644
index 017b79d..0000000
--- a/httpcore/src/site/resources/css/site.css
+++ /dev/null
@@ -1 +0,0 @@
-@import url("../../../css/hc-maven.css");
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/httpcore/src/site/site.xml
----------------------------------------------------------------------
diff --git a/httpcore/src/site/site.xml b/httpcore/src/site/site.xml
deleted file mode 100644
index 5c9f5d3..0000000
--- a/httpcore/src/site/site.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- ====================================================================
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the Apache Software Foundation. For more
- information on the Apache Software Foundation, please see
- <http://www.apache.org/>.
- -->
-
-<project name="HttpCore">
-
- <body>
- <menu name="HttpCore Overview">
- <item name="Description" href="../index.html"/>
- <item name="Examples" href="../examples.html"/>
- </menu>
- <menu name="Modules">
- <item name="HttpCore" href="index.html"/>
- <item name="HttpCore NIO" href="../httpcore-nio/index.html"/>
- </menu>
- </body>
-</project>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/src/site/apt/download.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/download.apt b/src/site/apt/download.apt
deleted file mode 100644
index e036b3d..0000000
--- a/src/site/apt/download.apt
+++ /dev/null
@@ -1,66 +0,0 @@
-~~ ====================================================================
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-~~ ====================================================================
-~~
-~~ This software consists of voluntary contributions made by many
-~~ individuals on behalf of the Apache Software Foundation. For more
-~~ information on the Apache Software Foundation, please see
-~~ <http://www.apache.org/>.
-
- ----------
- HttpComponents HttpCore Download Page
- ----------
- ----------
- ----------
-
-HttpCore Downloads
-
- The latest release available for download:
-
- {{{http://hc.apache.org/downloads.cgi}Release packages}} -
- {{{http://www.apache.org/dist/httpcomponents/httpcore/RELEASE_NOTES-4.2.x.txt}Release Notes}} -
- {{{http://www.apache.org/licenses/LICENSE-2.0.html}License}}
-
-{Dependency management with Maven}
-
- If you are using {{{http://maven.apache.org}Maven}} for your project, you can create a dependency
- in your {{{http://maven.apache.org/guides/introduction/introduction-to-the-pom.html}pom.xml}}
- by adding the following block to the dependency descriptor:
-
-* {HttpComponents Core 4.2.5 (GA)}
-
--------------------------
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>4.2.5</version>
- <scope>compile</scope>
- </dependency>
--------------------------
-
-* {HttpComponents Core NIO 4.2.5 (GA)}
-
--------------------------
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore-nio</artifactId>
- <version>4.2.5</version>
- <scope>compile</scope>
- </dependency>
--------------------------
-
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/src/site/apt/examples.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/examples.apt b/src/site/apt/examples.apt
deleted file mode 100644
index 4663576..0000000
--- a/src/site/apt/examples.apt
+++ /dev/null
@@ -1,62 +0,0 @@
-~~ ====================================================================
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-~~ ====================================================================
-~~
-~~ This software consists of voluntary contributions made by many
-~~ individuals on behalf of the Apache Software Foundation. For more
-~~ information on the Apache Software Foundation, please see
-~~ <http://www.apache.org/>.
-
- ----------
- HttpComponents HttpCore Examples
- ----------
- ----------
- ----------
-
-HttpCore Examples
-
- * {{{./httpcore/examples/org/apache/http/examples/ElementalHttpGet.java} Basic HTTP GET}}
-
- This example demonstrates how to execute a series of synchronous (blocking) HTTP GET requests.
-
- * {{{./httpcore/examples/org/apache/http/examples/ElementalHttpPost.java} Basic HTTP POST}}
-
- This example demonstrates how to execute a series of synchronous (blocking) HTTP POST requests
- that enclose entity content of various types: a string, a byte array, an arbitrary input stream.
-
- * {{{./httpcore/examples/org/apache/http/examples/ElementalHttpServer.java} Basic HTTP server}}
-
- This is an example of an HTTP/1.1 file server based on a synchronous (blocking) I/O model.
-
- * {{{./httpcore-nio/examples/org/apache/http/examples/nio/NHttpClient.java} Asynchronous HTTP GET}}
-
- This example demonstrates how HttpCore NIO can be used to execute multiple HTTP requests
- asynchronously using only one I/O thread.
-
- * {{{./httpcore-nio/examples/org/apache/http/examples/nio/NHttpServer.java} Asynchronous HTTP
- server}}
-
- This example demonstrates the use of HttpCore NIO to build an asynchronous (non-blocking)
- HTTP server capable of direct channel (zero copy) data transfer.
-
- * {{{./httpcore-nio/examples/org/apache/http/examples/nio/NHttpReverseProxy.java} Asynchronous
- HTTP reverse proxy}}
-
- This example demonstrates how HttpCore NIO can be used to build an asynchronous, fully
- streaming reverse HTTP proxy.
-
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
deleted file mode 100644
index 5c572ca..0000000
--- a/src/site/apt/index.apt
+++ /dev/null
@@ -1,61 +0,0 @@
-~~ ====================================================================
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-~~ ====================================================================
-~~
-~~ This software consists of voluntary contributions made by many
-~~ individuals on behalf of the Apache Software Foundation. For more
-~~ information on the Apache Software Foundation, please see
-~~ <http://www.apache.org/>.
-
- ----------
- HttpComponents HttpCore Overview
- ----------
- ----------
- ----------
-
-HttpCore Overview
-
- HttpCore is a set of low level HTTP transport components that can be used to build custom
- client and server side HTTP services with a minimal footprint. HttpCore supports two I/O models:
- blocking I/O model based on the classic Java I/O and non-blocking, event driven I/O model based
- on Java NIO.
-
- The blocking I/O model may be more appropriate for data intensive, low latency scenarios,
- whereas the non-blocking model may be more appropriate for high latency scenarios where raw data
- throughput is less important than the ability to handle thousands of simultaneous HTTP
- connections in a resource efficient manner.
-
- * {{{./httpcore/index.html}HttpCore}}
-
- * {{{./httpcore-nio/index.html}HttpCore NIO}}
-
-{Documentation}
-
- * HttpCore Tutorial ( {{{./tutorial/html/index.html}HTML}} / {{{./tutorial/pdf/httpcore-tutorial.pdf}PDF}} )
-
- * Some examples of HttpCore components in action can be found {{{./examples.html}here}}
-
-{Standards Compliance}
-
- HttpCore components strive to conform to the following specifications endorsed by the Internet
- Engineering Task Force (IETF) and the internet at large:
-
- * {{{http://www.ietf.org/rfc/rfc1945.txt}RFC 1945}} - Hypertext Transfer Protocol -- HTTP/1.0
-
- * {{{http://www.ietf.org/rfc/rfc2616.txt}RFC 2616}} - Hypertext Transfer Protocol -- HTTP/1.1
-
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/src/site/resources/css/site.css
----------------------------------------------------------------------
diff --git a/src/site/resources/css/site.css b/src/site/resources/css/site.css
deleted file mode 100644
index 41016d1..0000000
--- a/src/site/resources/css/site.css
+++ /dev/null
@@ -1 +0,0 @@
-@import url("../../css/hc-maven.css");
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f2c3748a/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
deleted file mode 100644
index 16ede72..0000000
--- a/src/site/site.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- ====================================================================
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the Apache Software Foundation. For more
- information on the Apache Software Foundation, please see
- <http://www.apache.org/>.
- -->
-
-<project name="HttpCore">
-
- <body>
- <menu name="HttpCore Overview">
- <item name="Description" href="index.html"/>
- </menu>
- <menu name="Documentation">
- <item name="Tutorial" href="tutorial/html/index.html"/>
- <item name="Examples" href="examples.html"/>
- </menu>
- <menu name="Modules">
- <item name="HttpCore" href="httpcore/index.html"/>
- <item name="HttpCore NIO" href="httpcore-nio/index.html"/>
- </menu>
- <!-- Reports don't really apply at this level; in particular the dependecy report is misleading -->
- <!-- menu ref="reports"/-->
- </body>
-</project>
[48/50] httpcomponents-core git commit: Tab police
Posted by ol...@apache.org.
Tab police
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1507133 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/c1943097
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/c1943097
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/c1943097
Branch: refs/heads/4.2.x
Commit: c1943097b77c197b95aeda97089cfe8e39ad2431
Parents: f22047e
Author: Sebastian Bazley <se...@apache.org>
Authored: Thu Jul 25 21:24:24 2013 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Thu Jul 25 21:24:24 2013 +0000
----------------------------------------------------------------------
.../org/apache/http/nio/reactor/ssl/SSLIOSession.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/c1943097/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index c579e14..5c5837e 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -623,11 +623,11 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
}
public Socket getSocket(){
- if (this.session instanceof SocketAccessor){
- return ((SocketAccessor) this.session).getSocket();
- } else {
- return null;
- }
+ if (this.session instanceof SocketAccessor){
+ return ((SocketAccessor) this.session).getSocket();
+ } else {
+ return null;
+ }
}
private class InternalByteChannel implements ByteChannel {
[13/50] httpcomponents-core git commit: HTTPCORE-331: BasicFuture no
longer executes notification callbacks inside a synchronized block
Posted by ol...@apache.org.
HTTPCORE-331: BasicFuture no longer executes notification callbacks inside a synchronized block
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1435144 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/2d706f9e
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/2d706f9e
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/2d706f9e
Branch: refs/heads/4.2.x
Commit: 2d706f9e5307edd4b9246f879259888486aa51c1
Parents: 0b9f6cb
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Jan 18 14:07:18 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Jan 18 14:07:18 2013 +0000
----------------------------------------------------------------------
RELEASE_NOTES.txt | 3 ++
.../org/apache/http/concurrent/BasicFuture.java | 36 ++++++++++++--------
2 files changed, 24 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/2d706f9e/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index e52b12e..72dcf42 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,5 +1,8 @@
Changes since 4.2.3
+* [HTTPCORE-331] BasicFuture no longer executes notification callbacks inside a synchronized block.
+ Contributed by Oleg Kalnichevski <olegk at apache.org>
+
* [HTTPCORE-319] Non-blocking SSLIOSession can fail to shut down correctly when the underlying
connection gets terminated abnormally by the opposite endpoint in case there is a truncated or
corrupted encrypted content in the input buffer and there is still data in the output buffer
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/2d706f9e/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
----------------------------------------------------------------------
diff --git a/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java b/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
index 3111eb8..faca044 100644
--- a/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
+++ b/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java
@@ -100,41 +100,47 @@ public class BasicFuture<T> implements Future<T>, Cancellable {
}
public synchronized boolean completed(final T result) {
- if (this.completed) {
- return false;
+ synchronized(this) {
+ if (this.completed) {
+ return false;
+ }
+ this.completed = true;
+ this.result = result;
+ notifyAll();
}
- this.completed = true;
- this.result = result;
if (this.callback != null) {
this.callback.completed(result);
}
- notifyAll();
return true;
}
public synchronized boolean failed(final Exception exception) {
- if (this.completed) {
- return false;
+ synchronized(this) {
+ if (this.completed) {
+ return false;
+ }
+ this.completed = true;
+ this.ex = exception;
+ notifyAll();
}
- this.completed = true;
- this.ex = exception;
if (this.callback != null) {
this.callback.failed(exception);
}
- notifyAll();
return true;
}
public synchronized boolean cancel(boolean mayInterruptIfRunning) {
- if (this.completed) {
- return false;
+ synchronized(this) {
+ if (this.completed) {
+ return false;
+ }
+ this.completed = true;
+ this.cancelled = true;
+ notifyAll();
}
- this.completed = true;
- this.cancelled = true;
if (this.callback != null) {
this.callback.cancelled();
}
- notifyAll();
return true;
}
[33/50] httpcomponents-core git commit: Updated project building
instructions
Posted by ol...@apache.org.
Updated project building instructions
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1481340 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f8431ca0
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f8431ca0
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f8431ca0
Branch: refs/heads/4.2.x
Commit: f8431ca002dc38a50dc1ba9cf1fc709b3772bd20
Parents: 579fdb5
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sat May 11 14:46:29 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat May 11 14:46:29 2013 +0000
----------------------------------------------------------------------
BUILDING.txt | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f8431ca0/BUILDING.txt
----------------------------------------------------------------------
diff --git a/BUILDING.txt b/BUILDING.txt
index 0c73a97..fa5c15f 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -5,10 +5,8 @@ Building HttpComponents Core
--------------
JDK 1.5+ is required in order to compile and run HttpCore.
-HttpCore utilizes Maven 2 as a distribution management and packaging tool.
-Version 2.2.1 or later is recommended. Maven 3.0.x can also be used
-to build HttpCore, however it is known to be incompatible with the Clover
-plugin used to generate web site content.
+HttpCore utilizes Maven as a distribution management and packaging tool.
+Version 3.0.3 or later is required.
Maven installation and configuration instructions can be found here:
@@ -57,11 +55,16 @@ Fix the archive files so the source files have the correct EOL settings:
mvn antrun:run
-(7) Building project web site
+(7) Building project web site
Execute the following command in order to generate the project web site:
-mvn site -Dmaven.clover.licenseLocation=<path>/clover.license
+mvn site
+
+Execute the following command in order to generate the project web site with Clover reports.
+This step is optional:
+
+mvn site -Pclover -Dmaven.clover.licenseLocation=<path>/clover.license
where <path> is a full path to Clover license file
[43/50] httpcomponents-core git commit: Removed clover2 plugin config
(defined in HC parent)
Posted by ol...@apache.org.
Removed clover2 plugin config (defined in HC parent)
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1503399 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/9b79d3f3
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/9b79d3f3
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/9b79d3f3
Branch: refs/heads/4.2.x
Commit: 9b79d3f311b210ed37ab53257289057d2275ab77
Parents: e404596
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Mon Jul 15 18:37:39 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Mon Jul 15 18:37:39 2013 +0000
----------------------------------------------------------------------
httpcore-nio/pom.xml | 27 ---------------------------
httpcore/pom.xml | 27 ---------------------------
2 files changed, 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/9b79d3f3/httpcore-nio/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore-nio/pom.xml b/httpcore-nio/pom.xml
index ce94c1a..9404019 100644
--- a/httpcore-nio/pom.xml
+++ b/httpcore-nio/pom.xml
@@ -98,24 +98,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <configuration>
- <flushPolicy>threaded</flushPolicy>
- <flushInterval>100</flushInterval>
- <targetPercentage>50%</targetPercentage>
- </configuration>
- <executions>
- <execution>
- <id>site</id>
- <phase>pre-site</phase>
- <goals>
- <goal>instrument</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
@@ -144,15 +126,6 @@
</plugin>
<plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <version>${clover.version}</version>
- <configuration>
- <jdk>1.5</jdk>
- </configuration>
- </plugin>
-
- <plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>${hc.jxr.version}</version>
</plugin>
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/9b79d3f3/httpcore/pom.xml
----------------------------------------------------------------------
diff --git a/httpcore/pom.xml b/httpcore/pom.xml
index bdf7170..3eba12f 100644
--- a/httpcore/pom.xml
+++ b/httpcore/pom.xml
@@ -98,24 +98,6 @@
<jvm>${httpcore.surefire.java}</jvm>
</configuration>
</plugin>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <configuration>
- <flushPolicy>threaded</flushPolicy>
- <flushInterval>100</flushInterval>
- <targetPercentage>50%</targetPercentage>
- </configuration>
- <executions>
- <execution>
- <id>site</id>
- <phase>pre-site</phase>
- <goals>
- <goal>instrument</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
@@ -143,15 +125,6 @@
</plugin>
<plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <version>${clover.version}</version>
- <configuration>
- <jdk>1.5</jdk>
- </configuration>
- </plugin>
-
- <plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>${hc.jxr.version}</version>
</plugin>
[47/50] httpcomponents-core git commit: Add missing EOL at EOF
Posted by ol...@apache.org.
Add missing EOL at EOF
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1507132 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f22047e0
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f22047e0
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f22047e0
Branch: refs/heads/4.2.x
Commit: f22047e0c7157d1e8a4b19b2dd15fdddf4475195
Parents: 0fac814
Author: Sebastian Bazley <se...@apache.org>
Authored: Thu Jul 25 21:22:30 2013 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Thu Jul 25 21:22:30 2013 +0000
----------------------------------------------------------------------
.../main/java/org/apache/http/benchmark/httpcore/HttpListener.java | 2 +-
.../main/java/org/apache/http/benchmark/httpcore/HttpWorker.java | 2 +-
.../org/apache/http/benchmark/httpcore/HttpWorkerCallback.java | 2 +-
.../org/apache/http/benchmark/httpcore/NRandomDataHandler.java | 2 +-
.../java/org/apache/http/benchmark/httpcore/RandomDataHandler.java | 2 +-
.../org/apache/http/benchmark/httpcore/StdHttpWorkerCallback.java | 2 +-
.../java/org/apache/http/benchmark/jetty/RandomDataHandler.java | 2 +-
.../java/org/apache/http/contrib/logging/LoggingIOSession.java | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpListener.java
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpListener.java b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpListener.java
index 6fcc88a..f56c168 100644
--- a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpListener.java
+++ b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpListener.java
@@ -101,4 +101,4 @@ class HttpListener extends Thread {
this.join(millis);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorker.java
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorker.java b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorker.java
index c9ddd72..486a669 100644
--- a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorker.java
+++ b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorker.java
@@ -94,4 +94,4 @@ class HttpWorker extends Thread {
this.join(millis);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorkerCallback.java
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorkerCallback.java b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorkerCallback.java
index c370359..79d7a49 100644
--- a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorkerCallback.java
+++ b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/HttpWorkerCallback.java
@@ -32,4 +32,4 @@ interface HttpWorkerCallback {
void shutdown(HttpWorker worker);
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/NRandomDataHandler.java
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/NRandomDataHandler.java b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/NRandomDataHandler.java
index 2e1c9b1..f8a2fe1 100644
--- a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/NRandomDataHandler.java
+++ b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/NRandomDataHandler.java
@@ -201,4 +201,4 @@ class NRandomDataHandler implements NHttpRequestHandler {
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/RandomDataHandler.java
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/RandomDataHandler.java b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/RandomDataHandler.java
index 155a472..a5f40ed 100644
--- a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/RandomDataHandler.java
+++ b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/RandomDataHandler.java
@@ -129,4 +129,4 @@ class RandomDataHandler implements HttpRequestHandler {
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/StdHttpWorkerCallback.java
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/StdHttpWorkerCallback.java b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/StdHttpWorkerCallback.java
index 1feaccb..0137529 100644
--- a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/StdHttpWorkerCallback.java
+++ b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/httpcore/StdHttpWorkerCallback.java
@@ -64,4 +64,4 @@ class StdHttpWorkerCallback implements HttpWorkerCallback {
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-benchmark/src/main/java/org/apache/http/benchmark/jetty/RandomDataHandler.java
----------------------------------------------------------------------
diff --git a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/jetty/RandomDataHandler.java b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/jetty/RandomDataHandler.java
index 08a69c1..bdf6647 100644
--- a/httpcore-benchmark/src/main/java/org/apache/http/benchmark/jetty/RandomDataHandler.java
+++ b/httpcore-benchmark/src/main/java/org/apache/http/benchmark/jetty/RandomDataHandler.java
@@ -92,4 +92,4 @@ class RandomDataHandler extends AbstractHandler {
outstream.flush();
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f22047e0/httpcore-contrib/src/main/java/org/apache/http/contrib/logging/LoggingIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-contrib/src/main/java/org/apache/http/contrib/logging/LoggingIOSession.java b/httpcore-contrib/src/main/java/org/apache/http/contrib/logging/LoggingIOSession.java
index 7157fb5..4645b7e 100644
--- a/httpcore-contrib/src/main/java/org/apache/http/contrib/logging/LoggingIOSession.java
+++ b/httpcore-contrib/src/main/java/org/apache/http/contrib/logging/LoggingIOSession.java
@@ -231,4 +231,4 @@ public class LoggingIOSession implements IOSession {
}
-}
\ No newline at end of file
+}
[20/50] httpcomponents-core git commit: Added sndBufSize / rcvBufSize
parameters to IOReactorConfig
Posted by ol...@apache.org.
Added sndBufSize / rcvBufSize parameters to IOReactorConfig
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1444384 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/5640ae9b
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/5640ae9b
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/5640ae9b
Branch: refs/heads/4.2.x
Commit: 5640ae9b4917bfd77eaebbb01e48e4b8fc561612
Parents: b54b88a
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sat Feb 9 16:07:50 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat Feb 9 16:07:50 2013 +0000
----------------------------------------------------------------------
.../reactor/AbstractMultiworkerIOReactor.java | 11 +++-
.../nio/reactor/DefaultListeningIOReactor.java | 5 +-
.../http/impl/nio/reactor/IOReactorConfig.java | 53 +++++++++++++++++++-
3 files changed, 65 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/5640ae9b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
index 38c4e08..62519c0 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
@@ -523,8 +523,17 @@ public abstract class AbstractMultiworkerIOReactor implements IOReactor {
*/
protected void prepareSocket(final Socket socket) throws IOException {
socket.setTcpNoDelay(this.config.isTcpNoDelay());
- socket.setSoTimeout(this.config.getSoTimeout());
socket.setKeepAlive(this.config.isSoKeepalive());
+ socket.setReuseAddress(this.config.isSoReuseAddress());
+ if (this.config.getSoTimeout() > 0) {
+ socket.setSoTimeout(this.config.getSoTimeout());
+ }
+ if (this.config.getSndBufSize() > 0) {
+ socket.setSendBufferSize(this.config.getSndBufSize());
+ }
+ if (this.config.getRcvBufSize() > 0) {
+ socket.setReceiveBufferSize(this.config.getRcvBufSize());
+ }
int linger = this.config.getSoLinger();
if (linger >= 0) {
socket.setSoLinger(linger > 0, linger);
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/5640ae9b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
index 2a24c98..b1a2ac6 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
@@ -28,6 +28,7 @@
package org.apache.http.impl.nio.reactor;
import java.io.IOException;
+import java.net.ServerSocket;
import java.net.SocketAddress;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.SelectionKey;
@@ -231,8 +232,10 @@ public class DefaultListeningIOReactor extends AbstractMultiworkerIOReactor
throw new IOReactorException("Failure opening server socket", ex);
}
try {
+ ServerSocket socket = serverChannel.socket();
+ socket.setReuseAddress(this.config.isSoReuseAddress());
serverChannel.configureBlocking(false);
- serverChannel.socket().bind(address);
+ socket.bind(address);
} catch (IOException ex) {
closeChannel(serverChannel);
request.failed(ex);
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/5640ae9b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
index 562257e..f555b39 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java
@@ -41,7 +41,7 @@ import org.apache.http.annotation.NotThreadSafe;
public final class IOReactorConfig implements Cloneable {
private static final int AVAIL_PROCS = Runtime.getRuntime().availableProcessors();
-
+
private long selectInterval;
private long shutdownGracePeriod;
private boolean interestOpQueued;
@@ -52,6 +52,8 @@ public final class IOReactorConfig implements Cloneable {
private boolean soKeepAlive;
private boolean tcpNoDelay;
private int connectTimeout;
+ private int sndBufSize;
+ private int rcvBufSize;
public IOReactorConfig() {
super();
@@ -285,6 +287,50 @@ public final class IOReactorConfig implements Cloneable {
this.connectTimeout = connectTimeout;
}
+ /**
+ * Determines the default value of the {@link SocketOptions#SO_SNDBUF} parameter
+ * for newly created sockets.
+ * <p/>
+ * Default: <code>0</code> (system default)
+ *
+ * @see SocketOptions#SO_SNDBUF
+ */
+ public int getSndBufSize() {
+ return sndBufSize;
+ }
+
+ /**
+ * Defines the default value of the {@link SocketOptions#SO_SNDBUF} parameter
+ * for newly created sockets.
+ *
+ * @see SocketOptions#SO_SNDBUF
+ */
+ public void setSndBufSize(int sndBufSize) {
+ this.sndBufSize = sndBufSize;
+ }
+
+ /**
+ * Determines the default value of the {@link SocketOptions#SO_RCVBUF} parameter
+ * for newly created sockets.
+ * <p/>
+ * Default: <code>0</code> (system default)
+ *
+ * @see SocketOptions#SO_RCVBUF
+ */
+ public int getRcvBufSize() {
+ return rcvBufSize;
+ }
+
+ /**
+ * Defines the default value of the {@link SocketOptions#SO_RCVBUF} parameter
+ * for newly created sockets.
+ *
+ * @see SocketOptions#SO_RCVBUF
+ */
+ public void setRcvBufSize(int rcvBufSize) {
+ this.rcvBufSize = rcvBufSize;
+ }
+
@Override
protected IOReactorConfig clone() throws CloneNotSupportedException {
return (IOReactorConfig) super.clone();
@@ -302,7 +348,10 @@ public final class IOReactorConfig implements Cloneable {
.append(", soLinger=").append(this.soLinger)
.append(", soKeepAlive=").append(this.soKeepAlive)
.append(", tcpNoDelay=").append(this.tcpNoDelay)
- .append(", connectTimeout=").append(this.connectTimeout).append("]");
+ .append(", connectTimeout=").append(this.connectTimeout)
+ .append(", sndBufSize=").append(this.sndBufSize)
+ .append(", rcvBufSize=").append(this.rcvBufSize)
+ .append("]");
return builder.toString();
}
[41/50] httpcomponents-core git commit: Updated web site for HttpCore
4.2.5 release
Posted by ol...@apache.org.
Updated web site for HttpCore 4.2.5 release
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1503268 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/230bb2e7
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/230bb2e7
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/230bb2e7
Branch: refs/heads/4.2.x
Commit: 230bb2e748f09869050fbf8d37bb76408a52d5f6
Parents: 45567a4
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Mon Jul 15 14:29:00 2013 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Mon Jul 15 14:29:00 2013 +0000
----------------------------------------------------------------------
src/site/apt/download.apt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/230bb2e7/src/site/apt/download.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/download.apt b/src/site/apt/download.apt
index 6af4519..e036b3d 100644
--- a/src/site/apt/download.apt
+++ b/src/site/apt/download.apt
@@ -33,7 +33,7 @@ HttpCore Downloads
The latest release available for download:
{{{http://hc.apache.org/downloads.cgi}Release packages}} -
- {{{http://www.apache.org/dist/httpcomponents/httpcore/RELEASE_NOTES.txt}Release Notes}} -
+ {{{http://www.apache.org/dist/httpcomponents/httpcore/RELEASE_NOTES-4.2.x.txt}Release Notes}} -
{{{http://www.apache.org/licenses/LICENSE-2.0.html}License}}
{Dependency management with Maven}
@@ -42,24 +42,24 @@ HttpCore Downloads
in your {{{http://maven.apache.org/guides/introduction/introduction-to-the-pom.html}pom.xml}}
by adding the following block to the dependency descriptor:
-* {HttpComponents Core 4.2.4 (GA)}
+* {HttpComponents Core 4.2.5 (GA)}
-------------------------
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
- <version>4.2.4</version>
+ <version>4.2.5</version>
<scope>compile</scope>
</dependency>
-------------------------
-* {HttpComponents Core NIO 4.2.4 (GA)}
+* {HttpComponents Core NIO 4.2.5 (GA)}
-------------------------
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-nio</artifactId>
- <version>4.2.4</version>
+ <version>4.2.5</version>
<scope>compile</scope>
</dependency>
-------------------------
[07/50] httpcomponents-core git commit: Updated build instructions
Posted by ol...@apache.org.
Updated build instructions
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1413814 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/37e2b877
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/37e2b877
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/37e2b877
Branch: refs/heads/4.2.x
Commit: 37e2b877748658872b2ef93334f4fc2727f2c0ed
Parents: f8d35ab
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Mon Nov 26 20:19:22 2012 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Mon Nov 26 20:19:22 2012 +0000
----------------------------------------------------------------------
BUILDING.txt | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/37e2b877/BUILDING.txt
----------------------------------------------------------------------
diff --git a/BUILDING.txt b/BUILDING.txt
index 11c7775..0c73a97 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -3,10 +3,12 @@ Building HttpComponents Core
(1) Requisites
--------------
+JDK 1.5+ is required in order to compile and run HttpCore.
+
HttpCore utilizes Maven 2 as a distribution management and packaging tool.
-Version 2.1.0 or above is required, which requires JDK 1.4 or later. However,
-it is recommended that you use Maven 2.2.1 or later, which requires JDK 1.5+.
-JDK 1.5 also required in order to compile some modules (such as NIO extensions).
+Version 2.2.1 or later is recommended. Maven 3.0.x can also be used
+to build HttpCore, however it is known to be incompatible with the Clover
+plugin used to generate web site content.
Maven installation and configuration instructions can be found here:
@@ -16,20 +18,16 @@ http://maven.apache.org/run-maven/index.html
Execute the following command in order to compile and test the components
-mvn test [-P java-1.3|java-1.4]
-
-The profile java-1.3 ensures that the tests are run with JVM 1.3, similarly for java-1.4.
-These profiles require the appropriate environment variables to have been set up,
-see pom.xml comments for details.
+mvn test
(3) Building packages
-Execute the following command in order to build the JAR packages
-
-mvn package [-P java-1.3|java-1.4]
+Execute the following command in order to build the JAR packages and install
+them to the local repository:
+mvn install
-The resultant packages can be found in the target folders of their respective modules
+The JAR packages can be found in the target folders of their respective modules
httpcore/target/httpcore-<VERSION>.jar
httpcore-nio/target/httpcore-nio-<VERSION>.jar