diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-07-22 14:15:10 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-07-22 14:15:10 (GMT) |
commit | 34d536887eeb88e7b3d407a31332a13bb0bff5f5 (patch) | |
tree | a71af14b00ccbcbcc283a9275a63867d389408cb /src/rhimportd/ctrlWebSocket.go | |
parent | 458d8f30caca4267bae3733ab3ba1ba55419a14d (diff) |
make uploadWeb part of session store - not finished yet
Diffstat (limited to 'src/rhimportd/ctrlWebSocket.go')
-rw-r--r-- | src/rhimportd/ctrlWebSocket.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/rhimportd/ctrlWebSocket.go b/src/rhimportd/ctrlWebSocket.go index 1f04b84..e764085 100644 --- a/src/rhimportd/ctrlWebSocket.go +++ b/src/rhimportd/ctrlWebSocket.go @@ -415,17 +415,8 @@ func webSocketHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport // rhdl.Printf("Websocket Client %s got: %+v", ws.RemoteAddr(), reqdata) reqchan <- *reqdata case websocket.BinaryMessage: - data, err := ioutil.ReadAll(r) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - rhdl.Println("WebSocket Client", ws.RemoteAddr(), "disconnected:", err) - sendWebSocketErrorResponse(ws, http.StatusInternalServerError, err.Error()) - return - } - // rhdl.Printf("WebSocket Client %s: got binary message (%d bytes)", ws.RemoteAddr(), len(data)) - binchan <- data + sendWebSocketErrorResponse(ws, http.StatusBadRequest, "binary messages are not allowed") + io.Copy(ioutil.Discard, r) // consume all the data } } } |