Skip to content

Commit

Permalink
treat end of file reads as timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
nhnb committed Jan 24, 2024
1 parent d02ea29 commit 32e6b2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/marauroa/server/net/web/WebSocketChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
***************************************************************************/
package marauroa.server.net.web;

import java.io.EOFException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketTimeoutException;
Expand Down Expand Up @@ -112,7 +113,7 @@ public void onClose(Session session, CloseReason closeReason) {

@OnError
public void onError(Session session, Throwable cause) {
if (cause instanceof SocketTimeoutException) {
if (cause instanceof SocketTimeoutException || cause instanceof EOFException) {
onClose(session, new CloseReason(CloseCodes.UNEXPECTED_CONDITION, "Timeout"));
return;
}
Expand Down

0 comments on commit 32e6b2f

Please sign in to comment.