Author: markt Date: Sun Feb 26 23:05:04 2012 New Revision: 1293953 URL: http://svn.apache.org/viewvc?rev=1293953&view=rev Log: Fix web socket for APR/native (actually a generic upgrade issue)
Modified: tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java?rev=1293953&r1=1293952&r2=1293953&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java Sun Feb 26 23:05:04 2012 @@ -67,8 +67,12 @@ public class UpgradeAprProcessor extends @Override public int read() throws IOException { byte[] bytes = new byte[1]; - Socket.recv(socket, bytes, 0, 1); - return bytes[0]; + int result = Socket.recv(socket, bytes, 0, 1); + if (result == -1) { + return -1; + } else { + return bytes[0] & 0xFF; + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org