Author: markt
Date: Sat Mar 28 21:47:55 2015
New Revision: 1669838
URL: http://svn.apache.org/r1669838
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=57762
Dropped connections are reported as a success with EOF rather than as a failure.
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java?rev=1669838&r1=1669837&r2=1669838&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java Sat Mar 28
21:47:55 2015
@@ -16,6 +16,7 @@
*/
package org.apache.tomcat.websocket;
+import java.io.EOFException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.CompletionHandler;
@@ -109,6 +110,16 @@ public class WsFrameClient extends WsFra
@Override
public void completed(Integer result, Void attachment) {
+ if (result.intValue() == -1) {
+ // BZ 57762. A dropped connection will get reported as EOF
+ // rather than as an error so handle it here.
+ if (isOpen()) {
+ // No close frame was received
+ close(new EOFException());
+ }
+ // No data to process
+ return;
+ }
response.flip();
try {
processSocketRead();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]