summaryrefslogtreecommitdiff
path: root/client/proxy.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-22 16:21:40 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-23 10:40:50 +0100
commitbec31179c24e6e4151e9657e49b4fb64575a8de0 (patch)
tree6e4099d7d37de109f7aa86e57a5c3ab7b5d6c66d /client/proxy.go
parenteb0c7e7251a0038963436dcd77e6d92311f0bf8f (diff)
Proxy: Only call ready when client is not connected
Diffstat (limited to 'client/proxy.go')
-rw-r--r--client/proxy.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/proxy.go b/client/proxy.go
index 31a17a6..721dcac 100644
--- a/client/proxy.go
+++ b/client/proxy.go
@@ -28,7 +28,16 @@ func (c *Client) StartProxyguard(ck *cookie.Cookie, listen string, tcpsp int, pe
var err error
proxyguard.UpdateLogger(&ProxyLogger{})
proxyguard.GotClientFD = gotFD
- proxyguard.ClientProxyReady = ready
+ proxyguard.ClientProxyReady = func() {
+ // already connected
+ // no need to signal to the client that the proxy is ready
+ if c.InState(StateConnected) {
+ log.Logger.Debugf("proxyguard is ready again when the client was already connected")
+ return
+ }
+ log.Logger.Debugf("forwarding proxyguard ready callback to client")
+ ready()
+ }
u, err := url.Parse(peer)
if err != nil {