[tor-commits] [flashproxy/master] Return EOF when reading a close frame.
dcf at torproject.org
dcf at torproject.org
Wed Jan 30 05:11:38 UTC 2013
commit a6dde961e9c807445ab7f38021cca491ab9cf539
Author: David Fifield <david at bamsoftware.com>
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
More information about the tor-commits
mailing list