hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r942047 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
Date Fri, 07 May 2010 10:19:08 GMT
Author: olegk
Date: Fri May  7 10:19:08 2010
New Revision: 942047

URL: http://svn.apache.org/viewvc?rev=942047&view=rev
Log:
HTTPCORE-226: Improved compatibility of NIO components with Google Android

Modified:
    httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java

Modified: httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?rev=942047&r1=942046&r2=942047&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Fri May  7 10:19:08 2010
@@ -1,5 +1,8 @@
 Changes since 4.1-BETA1 
 
+* [HTTPCORE-226] Improved compatibility of NIO components with Google Android.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * ByteArrayBuffer, CharArrayBuffer, BasicHeader, BufferedHeader, HeaderGroup made Serializable.
   Contributed by Oleg Kalnichevski <olegk at apache.org>
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java?rev=942047&r1=942046&r2=942047&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
Fri May  7 10:19:08 2010
@@ -364,7 +364,7 @@ public abstract class AbstractIOReactor 
             try {
                 channel = entry.getChannel();
                 channel.configureBlocking(false);
-                key = channel.register(this.selector, 0);
+                key = channel.register(this.selector, SelectionKey.OP_READ);
             } catch (ClosedChannelException ex) {
                 SessionRequestImpl sessionRequest = entry.getSessionRequest();
                 if (sessionRequest != null) {

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java?rev=942047&r1=942046&r2=942047&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
Fri May  7 10:19:08 2010
@@ -247,22 +247,17 @@ public class DefaultConnectingIOReactor 
                 return;
             }
 
+            SessionRequestHandle requestHandle = new SessionRequestHandle(request);
             SelectionKey key;
             try {
-                key = socketChannel.register(this.selector, 0);
+                key = socketChannel.register(this.selector, SelectionKey.OP_CONNECT, requestHandle);
                 request.setKey(key);
+            } catch (CancelledKeyException ex) {
+                // Ignore cancelled keys
             } catch (IOException ex) {
                 throw new IOReactorException("Failure registering channel " +
                         "with the selector", ex);
             }
-
-            SessionRequestHandle requestHandle = new SessionRequestHandle(request);
-            try {
-                key.attach(requestHandle);
-                key.interestOps(SelectionKey.OP_CONNECT);
-            } catch (CancelledKeyException ex) {
-                // Ignore cancelled keys
-            }
         }
     }
 



Mime
View raw message