Author: markt
Date: Fri Jun 19 13:26:52 2015
New Revision: 1686410

URL: http://svn.apache.org/r1686410
Log:
More renaming since the extractor will be used to extract more than just the 
SNI information

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
    tomcat/trunk/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java?rev=1686410&r1=1686409&r2=1686410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java Fri Jun 
19 13:26:52 2015
@@ -36,7 +36,7 @@ import javax.net.ssl.SSLException;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.ByteBufferUtils;
-import org.apache.tomcat.util.net.TLSClientHelloExtractor.SNIResult;
+import org.apache.tomcat.util.net.TLSClientHelloExtractor.ExtractorResult;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -316,7 +316,7 @@ public class SecureNio2Channel extends N
 
         TLSClientHelloExtractor extractor = new 
TLSClientHelloExtractor(netInBuffer);
 
-        while (extractor.getResult() == SNIResult.UNDERFLOW &&
+        while (extractor.getResult() == ExtractorResult.UNDERFLOW &&
                 netInBuffer.capacity() < endpoint.getSniParseLimit()) {
             // extractor needed more data to process but netInBuffer was full 
so
             // expand the buffer and read some more data.
@@ -331,7 +331,7 @@ public class SecureNio2Channel extends N
 
         String hostName = null;
         switch (extractor.getResult()) {
-        case FOUND:
+        case COMPLETE:
             hostName = extractor.getSNIValue();
             break;
         case NOT_PRESENT:

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java?rev=1686410&r1=1686409&r2=1686410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java Fri Jun 
19 13:26:52 2015
@@ -33,7 +33,7 @@ import javax.net.ssl.SSLException;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.ByteBufferUtils;
-import org.apache.tomcat.util.net.TLSClientHelloExtractor.SNIResult;
+import org.apache.tomcat.util.net.TLSClientHelloExtractor.ExtractorResult;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -254,7 +254,7 @@ public class SecureNioChannel extends Ni
         sc.read(netInBuffer);
         TLSClientHelloExtractor extractor = new 
TLSClientHelloExtractor(netInBuffer);
 
-        while (extractor.getResult() == SNIResult.UNDERFLOW &&
+        while (extractor.getResult() == ExtractorResult.UNDERFLOW &&
                 netInBuffer.capacity() < endpoint.getSniParseLimit()) {
             // extractor needed more data to process but netInBuffer was full 
so
             // expand the buffer and read some more data.
@@ -269,7 +269,7 @@ public class SecureNioChannel extends Ni
 
         String hostName = null;
         switch (extractor.getResult()) {
-        case FOUND:
+        case COMPLETE:
             hostName = extractor.getSNIValue();
             break;
         case NOT_PRESENT:

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java?rev=1686410&r1=1686409&r2=1686410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java 
Fri Jun 19 13:26:52 2015
@@ -31,7 +31,7 @@ public class TLSClientHelloExtractor {
     private static final Log log = 
LogFactory.getLog(TLSClientHelloExtractor.class);
     private static final StringManager sm = 
StringManager.getManager(TLSClientHelloExtractor.class);
 
-    private final SNIResult result;
+    private final ExtractorResult result;
     private final String sniValue;
 
     private static final int TLS_RECORD_HEADER_LEN = 5;
@@ -53,7 +53,7 @@ public class TLSClientHelloExtractor {
         // the buffer state can be restored at the end of this method.
         int pos = netInBuffer.position();
         int limit = netInBuffer.limit();
-        SNIResult result = SNIResult.NOT_PRESENT;
+        ExtractorResult result = ExtractorResult.NOT_PRESENT;
         String sniValue = null;
         try {
             // Switch to read mode.
@@ -109,7 +109,7 @@ public class TLSClientHelloExtractor {
                 sniValue = readSniExtension(netInBuffer);
             }
             if (sniValue != null) {
-                result = SNIResult.FOUND;
+                result = ExtractorResult.COMPLETE;
             }
         } finally {
             this.result = result;
@@ -121,13 +121,13 @@ public class TLSClientHelloExtractor {
     }
 
 
-    public SNIResult getResult() {
+    public ExtractorResult getResult() {
         return result;
     }
 
 
     public String getSNIValue() {
-        if (result == SNIResult.FOUND) {
+        if (result == ExtractorResult.COMPLETE) {
             return sniValue;
         } else {
             throw new IllegalStateException();
@@ -135,13 +135,13 @@ public class TLSClientHelloExtractor {
     }
 
 
-    private static SNIResult handleIncompleteRead(ByteBuffer bb) {
+    private static ExtractorResult handleIncompleteRead(ByteBuffer bb) {
         if (bb.limit() == bb.capacity()) {
             // Buffer not big enough
-            return SNIResult.UNDERFLOW;
+            return ExtractorResult.UNDERFLOW;
         } else {
             // Need to read more data into buffer
-            return SNIResult.NEED_READ;
+            return ExtractorResult.NEED_READ;
         }
     }
 
@@ -221,8 +221,8 @@ public class TLSClientHelloExtractor {
     }
 
 
-    public static enum SNIResult {
-        FOUND,
+    public static enum ExtractorResult {
+        COMPLETE,
         NOT_PRESENT,
         UNDERFLOW,
         NEED_READ



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to