diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-30 14:21:09 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-30 14:21:09 (GMT) |
commit | 634ccd50a99d1510037cf3f61686e6abebe5a562 (patch) | |
tree | 8b355d0135172242bf05dca6eb6f32941c204f0c /src/helsinki.at/rhimportd | |
parent | e9a1f32139ea729d0cd57a99132adc837d62690b (diff) |
implemented cancel command
Diffstat (limited to 'src/helsinki.at/rhimportd')
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlWebSocket.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSocket.go b/src/helsinki.at/rhimportd/ctrlWebSocket.go index 1e8cfff..df58f3f 100644 --- a/src/helsinki.at/rhimportd/ctrlWebSocket.go +++ b/src/helsinki.at/rhimportd/ctrlWebSocket.go @@ -183,6 +183,12 @@ func webSocketSessionHandler(reqchan <-chan webSocketRequestData, ws *websocket. } else { sendWebSocketResponse(ws, &webSocketResponseData{ResponseCode: code, Type: "ACK", Id: session.id}) } + case "cancel": + if session.id == "" { + sendWebSocketErrorResponse(ws, "", http.StatusBadRequest, "This connection doesn't handle any session") + return + } + session.session.Cancel() case "reconnect": if session.id != "" { sendWebSocketErrorResponse(ws, "", http.StatusBadRequest, "This connection already handles a session") |