You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2013/03/25 16:34:27 UTC
svn commit: r1460717 - in /httpcomponents/httpclient/trunk: ./
httpclient/src/examples/org/apache/http/examples/client/
httpclient/src/main/java/org/apache/http/impl/conn/
Author: olegk
Date: Mon Mar 25 15:34:27 2013
New Revision: 1460717
URL: http://svn.apache.org/r1460717
Log:
Upgraded HttpCore to version 4.3-beta1
Modified:
httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java
httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionImpl.java
httpcomponents/httpclient/trunk/pom.xml
Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java?rev=1460717&r1=1460716&r2=1460717&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java Mon Mar 25 15:34:27 2013
@@ -128,11 +128,10 @@ public class ClientConfiguration {
// Use a custom connection factory to customize the process of
// initialization of outgoing HTTP connections. Beside standard connection
- // configuration parameters HTTP connection factory can control the size of
- // input / output buffers as well as determine message parser / writer routines
- // to be employed by individual connections.
+ // configuration parameters HTTP connection factory can define message
+ // parser / writer routines to be employed by individual connections.
HttpConnectionFactory<ManagedHttpClientConnection> connFactory = new ManagedHttpClientConnectionFactory(
- 8 * 1024, requestWriterFactory, responseParserFactory);
+ requestWriterFactory, responseParserFactory);
// Client HTTP connection objects when fully initialized can be bound to
// an arbitrary network socket. The process of network socket initialization,
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java?rev=1460717&r1=1460716&r2=1460717&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java Mon Mar 25 15:34:27 2013
@@ -44,7 +44,6 @@ import org.apache.http.conn.ManagedHttpC
import org.apache.http.impl.io.DefaultHttpRequestWriterFactory;
import org.apache.http.io.HttpMessageParserFactory;
import org.apache.http.io.HttpMessageWriterFactory;
-import org.apache.http.util.Args;
/**
* @since 4.3
@@ -54,24 +53,19 @@ public class ManagedHttpClientConnection
private static final AtomicLong COUNTER = new AtomicLong();
- private static final int DEFAULT_BUFSIZE = 8 * 1024;
-
public static final ManagedHttpClientConnectionFactory INSTANCE = new ManagedHttpClientConnectionFactory();
private final Log log = LogFactory.getLog(ManagedHttpClientConnectionImpl.class);
private final Log headerlog = LogFactory.getLog("org.apache.http.headers");
private final Log wirelog = LogFactory.getLog("org.apache.http.wire");
- private final int bufferSize;
private final HttpMessageWriterFactory<HttpRequest> requestWriterFactory;
private final HttpMessageParserFactory<HttpResponse> responseParserFactory;
public ManagedHttpClientConnectionFactory(
- final int bufferSize,
final HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
final HttpMessageParserFactory<HttpResponse> responseParserFactory) {
super();
- this.bufferSize = Args.notNegative(bufferSize, "Buffer size");
this.requestWriterFactory = requestWriterFactory != null ? requestWriterFactory :
DefaultHttpRequestWriterFactory.INSTANCE;
this.responseParserFactory = responseParserFactory != null ? responseParserFactory :
@@ -79,22 +73,12 @@ public class ManagedHttpClientConnection
}
public ManagedHttpClientConnectionFactory(
- final HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
- final HttpMessageParserFactory<HttpResponse> responseParserFactory) {
- this(DEFAULT_BUFSIZE, requestWriterFactory, responseParserFactory);
- }
-
- public ManagedHttpClientConnectionFactory(
final HttpMessageParserFactory<HttpResponse> responseParserFactory) {
this(null, responseParserFactory);
}
- public ManagedHttpClientConnectionFactory(final int bufferSize) {
- this(bufferSize, null, null);
- }
-
public ManagedHttpClientConnectionFactory() {
- this(DEFAULT_BUFSIZE, null, null);
+ this(null, null);
}
public ManagedHttpClientConnection create(final ConnectionConfig config) {
@@ -120,7 +104,8 @@ public class ManagedHttpClientConnection
log,
headerlog,
wirelog,
- bufferSize,
+ config.getBufferSize(),
+ config.getFragmentSizeHint(),
chardecoder,
charencoder,
cconfig.getMessageConstraints(),
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionImpl.java?rev=1460717&r1=1460716&r2=1460717&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionImpl.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionImpl.java Mon Mar 25 15:34:27 2013
@@ -69,6 +69,7 @@ class ManagedHttpClientConnectionImpl ex
final Log headerlog,
final Log wirelog,
final int buffersize,
+ final int fragmentSizeHint,
final CharsetDecoder chardecoder,
final CharsetEncoder charencoder,
final MessageConstraints constraints,
@@ -76,7 +77,7 @@ class ManagedHttpClientConnectionImpl ex
final ContentLengthStrategy outgoingContentStrategy,
final HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
final HttpMessageParserFactory<HttpResponse> responseParserFactory) {
- super(buffersize, chardecoder, charencoder,
+ super(buffersize, fragmentSizeHint, chardecoder, charencoder,
constraints, incomingContentStrategy, outgoingContentStrategy,
requestWriterFactory, responseParserFactory);
this.id = id;
Modified: httpcomponents/httpclient/trunk/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/pom.xml?rev=1460717&r1=1460716&r2=1460717&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/pom.xml (original)
+++ httpcomponents/httpclient/trunk/pom.xml Mon Mar 25 15:34:27 2013
@@ -65,7 +65,7 @@
</scm>
<properties>
- <httpcore.version>4.3-alpha1</httpcore.version>
+ <httpcore.version>4.3-beta1</httpcore.version>
<commons-logging.version>1.1.1</commons-logging.version>
<commons-codec.version>1.6</commons-codec.version>
<ehcache.version>2.2.0</ehcache.version>