hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1133031 - in /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor: IOSessionImpl.java SSLIOSession.java
Date Tue, 07 Jun 2011 14:44:09 GMT
Author: olegk
Date: Tue Jun  7 14:44:09 2011
New Revision: 1133031

URL: http://svn.apache.org/viewvc?rev=1133031&view=rev
Log:
Conciser, more informative i/o session logging in HttpCore NIO

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java?rev=1133031&r1=1133030&r2=1133031&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java
Tue Jun  7 14:44:09 2011
@@ -251,7 +251,6 @@ public class IOSessionImpl implements IO
     }
 
     private static void formatOps(final StringBuilder buffer, int ops) {
-        buffer.append('[');
         if ((ops & SelectionKey.OP_READ) > 0) {
             buffer.append('r');
         }
@@ -264,21 +263,29 @@ public class IOSessionImpl implements IO
         if ((ops & SelectionKey.OP_CONNECT) > 0) {
             buffer.append('c');
         }
-        buffer.append(']');
     }
 
     @Override
     public synchronized String toString() {
         StringBuilder buffer = new StringBuilder();
         buffer.append("[");
+        switch (this.status) {
+        case ACTIVE:
+            buffer.append("ACTIVE");
+            break;
+        case CLOSING:
+            buffer.append("CLOSING");
+            break;
+        case CLOSED:
+            buffer.append("CLOSED");
+            break;
+        }
+        buffer.append("][");
         if (this.key.isValid()) {
-            buffer.append("interest ops: ");
             formatOps(buffer, this.interestOpsCallback != null ?
                     this.currentEventMask : this.key.interestOps());
-            buffer.append("; ready ops: ");
+            buffer.append(":");
             formatOps(buffer, this.key.readyOps());
-        } else {
-            buffer.append("invalid");
         }
         buffer.append("]");
         return buffer.toString();

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java?rev=1133031&r1=1133030&r2=1133031&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
Tue Jun  7 14:44:09 2011
@@ -462,7 +462,19 @@ public class SSLIOSession implements IOS
     public String toString() {
         StringBuilder buffer = new StringBuilder();
         buffer.append(this.session);
-        buffer.append("[SSL handshake status: ");
+        buffer.append("[");
+        switch (this.status) {
+        case ACTIVE:
+            buffer.append("ACTIVE");
+            break;
+        case CLOSING:
+            buffer.append("CLOSING");
+            break;
+        case CLOSED:
+            buffer.append("CLOSED");
+            break;
+        }
+        buffer.append("][");
         buffer.append(this.sslEngine.getHandshakeStatus());
         buffer.append("][");
         buffer.append(this.inEncrypted.position());



Mime
View raw message