mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-07-21 18:15:54 +02:00
Avoid concurrency issues
This commit is contained in:
parent
27d449d438
commit
728fc76e8b
1 changed files with 4 additions and 2 deletions
6
rdg.go
6
rdg.go
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue