diff options
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") |