Hi Asankha and all,
I just published the latest HttpCore snapshots to the Maven2 snapshot
repository. The patch attached below fixes the breakage in Synapse due
to some minor API changes in HttpCore.
I have one test that fails for me, though, when I run the latest Synapse
snapshot. As far as I can tell the changes in HttpCore are unlikely to
be the reason.
==============================================================================
Test set: org.apache.synapse.n2n.SynapseCommodityServiceTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.407
sec <<< FAILURE!
testN2N(org.apache.synapse.n2n.SynapseCommodityServiceTest) Time
elapsed: 0.388 sec <<< ERROR!
java.lang.NumberFormatException: multiple points
at
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1084)
at java.lang.Float.parseFloat(Float.java:394)
==============================================================================
I also have the first cut at NIO SSL ready for review and testing. These
are the details of the new module:
GroupId: org.apache.httpcomponents
ArtifactId: jakarta-httpcore-niossl
Version: 4.0-alpha4-SNAPSHOT
I have run a number of tests on NIO SSL and it appears to be holding up
quite well for a first cut. At any rate, more real-life testing and some
feedback, positive or negative, would be highly welcome.
I should also mention that at the moment the SSL I/O session executes
all potentially blocking SSL handshake tasks on the main I/O thread [1].
I am aware of this problem and will be working on fixing this
deficiency. However, I would like to reduce the complexity of the
problem somewhat in order to be able to concentrate on the essential
transport aspects first (which are already complex enough), get them
reliably and then deal with non-essential aspects such as using helper
threads to run potentially blocking SSL handshake tasks off the main I/O
thread.
Cheers
Oleg
[1] https://issues.apache.org/jira/browse/HTTPCORE-26
Index: modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
===================================================================
--- modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java (revision 505951)
+++ modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java (working copy)
@@ -26,16 +26,16 @@
import org.apache.axis2.transport.TransportSender;
import org.apache.axis2.transport.OutTransportInfo;
import org.apache.axiom.om.OMOutputFormat;
+import org.apache.http.impl.nio.DefaultClientIOEventDispatch;
+import org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor;
import org.apache.http.nio.NHttpClientHandler;
import org.apache.http.nio.NHttpClientConnection;
-import org.apache.http.nio.impl.reactor.DefaultConnectingIOReactor;
-import org.apache.http.nio.impl.DefaultClientIOEventDispatch;
import org.apache.http.nio.reactor.ConnectingIOReactor;
import org.apache.http.nio.reactor.IOEventDispatch;
import org.apache.http.nio.reactor.SessionRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpHost;
-import org.apache.http.impl.DefaultHttpParams;
+import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpProtocolParams;
@@ -114,7 +114,7 @@
* @return the applicable HTTP protocol parameters
*/
private HttpParams getClientParameters() {
- HttpParams params = new DefaultHttpParams(null);
+ HttpParams params = new BasicHttpParams();
params
.setIntParameter(HttpConnectionParams.SO_TIMEOUT, 30000)
.setIntParameter(HttpConnectionParams.CONNECTION_TIMEOUT, 10000)
Index: modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java
===================================================================
--- modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java (revision 505951)
+++ modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java (working copy)
@@ -23,15 +23,15 @@
import org.apache.axis2.transport.TransportListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpProtocolParams;
+import org.apache.http.impl.nio.DefaultServerIOEventDispatch;
+import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
import org.apache.http.nio.reactor.IOEventDispatch;
import org.apache.http.nio.reactor.ListeningIOReactor;
-import org.apache.http.nio.impl.DefaultServerIOEventDispatch;
-import org.apache.http.nio.impl.reactor.DefaultListeningIOReactor;
import org.apache.http.nio.NHttpServiceHandler;
-import org.apache.http.impl.DefaultHttpParams;
import java.io.InterruptedIOException;
import java.io.IOException;
@@ -88,7 +88,7 @@
* @return the applicable HTTP protocol parameters
*/
private HttpParams getServerParameters() {
- HttpParams params = new DefaultHttpParams(null);
+ HttpParams params = new BasicHttpParams();
params
.setIntParameter(HttpConnectionParams.SO_TIMEOUT, 30000)
.setIntParameter(HttpConnectionParams.SOCKET_BUFFER_SIZE, 8 * 1024)
Index: modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java
===================================================================
--- modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java (revision 505951)
+++ modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java (working copy)
@@ -111,7 +111,10 @@
// create the default response to this request
HttpVersion httpVersion = request.getRequestLine().getHttpVersion();
- HttpResponse response = responseFactory.newHttpResponse(httpVersion, HttpStatus.SC_OK);
+ HttpResponse response = responseFactory.newHttpResponse(
+ httpVersion,
+ HttpStatus.SC_OK,
+ context);
response.setParams(this.params);
// create a basic HttpEntity using the source channel of the response pipe
@@ -237,9 +240,13 @@
* @param e the exception encountered
*/
public void exception(final NHttpServerConnection conn, final HttpException e) {
+ HttpContext context = conn.getContext();
HttpRequest request = conn.getHttpRequest();
HttpVersion ver = request.getRequestLine().getHttpVersion();
- HttpResponse response = responseFactory.newHttpResponse(ver, HttpStatus.SC_BAD_REQUEST);
+ HttpResponse response = responseFactory.newHttpResponse(
+ ver,
+ HttpStatus.SC_BAD_REQUEST,
+ context);
byte[] msg = EncodingUtils.getAsciiBytes("Malformed HTTP request: " + e.getMessage());
ByteArrayEntity entity = new ByteArrayEntity(msg);
entity.setContentType("text/plain; charset=US-ASCII");
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]