Skip to content
Snippets Groups Projects
Commit 728fc76e authored by Bolke de Bruin's avatar Bolke de Bruin
Browse files

Avoid concurrency issues

parent 27d449d4
No related branches found
No related tags found
No related merge requests found
......@@ -220,7 +220,8 @@ func handleWebsocketProtocol(conn *websocket.Conn) {
case PKT_TYPE_DATA:
forwardDataPacket(remote, pkt)
case PKT_TYPE_KEEPALIVE:
conn.WriteMessage(mt, createPacket(PKT_TYPE_KEEPALIVE, []byte{}))
// do not write to make sure we do not create concurrency issues
// conn.WriteMessage(mt, createPacket(PKT_TYPE_KEEPALIVE, []byte{}))
case PKT_TYPE_CLOSE_CHANNEL:
remote.Close()
return
......@@ -314,7 +315,8 @@ func handleLegacyProtocol(w http.ResponseWriter, r *http.Request) {
case PKT_TYPE_DATA:
forwardDataPacket(remote, packet)
case PKT_TYPE_KEEPALIVE:
s.ConnOut.Write(createPacket(PKT_TYPE_KEEPALIVE, []byte{}))
// avoid concurrency issues
// s.ConnOut.Write(createPacket(PKT_TYPE_KEEPALIVE, []byte{}))
case PKT_TYPE_CLOSE_CHANNEL:
s.ConnIn.Close()
s.ConnOut.Close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment