[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [flashproxy/master] Return EOF when reading a close frame.



commit a6dde961e9c807445ab7f38021cca491ab9cf539
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Mon Nov 26 04:10:34 2012 -0800

    Return EOF when reading a close frame.
---
 websocket-transport/websocket.go |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/websocket-transport/websocket.go b/websocket-transport/websocket.go
index 7dc1a7e..e401640 100644
--- a/websocket-transport/websocket.go
+++ b/websocket-transport/websocket.go
@@ -135,6 +135,10 @@ func (ws *websocket) ReadMessage() (message websocketMessage, err error) {
 				err = errors.New("control frame has fin bit unset")
 				return
 			}
+			if frame.Opcode == 8 {
+				err = io.EOF
+				return
+			}
 			message.Opcode = frame.Opcode
 			message.Payload = frame.Payload
 			return message, nil



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits