jprq
jprq copied to clipboard
Data race on shared maps -> server crash
Every connection is handled in its own goroutine (server/server/tcpserver.go), yet the shared maps are read and written with no mutex anywhere on the Jprq struct.
+1 More specifically: serveEventConn and servePubliConn methods are not synchronized. serveEventConn actively modfies the following maps: cnameMap, httpTunnels, and tcpTunnels on each TunnelRequest event. And at the same time servePublicConn is reading from those maps.