Author: markt
Date: Tue Oct 22 12:54:33 2013
New Revision: 1534619
URL: http://svn.apache.org/r1534619
Log:
Latest attempt to address issues with APR/native, SSL and the drawboard example
Modified:
tomcat/trunk/java/org/apache/coyote/http11/upgrade/AprServletInputStream.java
tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
Modified:
tomcat/trunk/java/org/apache/coyote/http11/upgrade/AprServletInputStream.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/AprServletInputStream.java?rev=1534619&r1=1534618&r2=1534619&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/coyote/http11/upgrade/AprServletInputStream.java
(original)
+++
tomcat/trunk/java/org/apache/coyote/http11/upgrade/AprServletInputStream.java
Tue Oct 22 12:54:33 2013
@@ -21,6 +21,8 @@ import java.io.IOException;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.jni.OS;
import org.apache.tomcat.jni.Socket;
import org.apache.tomcat.jni.Status;
@@ -28,6 +30,8 @@ import org.apache.tomcat.util.net.Socket
public class AprServletInputStream extends AbstractServletInputStream {
+ private static final Log log =
LogFactory.getLog(AprServletInputStream.class);
+
private final SocketWrapper<Long> wrapper;
private final long socket;
private volatile boolean eagain = false;
@@ -92,6 +96,16 @@ public class AprServletInputStream exten
} else if (-result == Status.EAGAIN) {
eagain = true;
return 0;
+ } else if (-result == Status.APR_EGENERAL && wrapper.isSecure()) {
+ // Not entirely sure why this is necessary. Testing to date has not
+ // identified any issues with this but log it so it can be tracked
+ // if it is suspected of causing issues in the future.
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("apr.read.sslGeneralError",
+ Long.valueOf(socket), wrapper));
+ }
+ eagain = true;
+ return 0;
} else if (-result == Status.APR_EOF) {
throw new EOFException(sm.getString("apr.clientAbort"));
} else if ((OS.IS_WIN32 || OS.IS_WIN64) &&
Modified:
tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties?rev=1534619&r1=1534618&r2=1534619&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
Tue Oct 22 12:54:33 2013
@@ -26,6 +26,7 @@ upgrade.sis.write.ise=It is illegal to c
apr.clientAbort=The client aborted the connection.
apr.read.error=Unexpected error [{0}] reading data from the APR/native socket
[{1}] with wrapper [{2}].
+apr.read.sslGeneralError=An APR general error was returned by the SSL read
operation on APR/native socket [{0}] with wrapper [{1}]. It will be treated as
EAGAIN and the socket returned to the poller.
apr.write.error=Unexpected error [{0}] writing data to the APR/native socket
[{1}] with wrapper [{2}].
apr.closed=The socket [{0}] associated with this connection has been closed.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]