From dd13e1cb62cadcbe6c4059adcbb49d2d3215aa31 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 1 Apr 2020 12:05:25 +0200 Subject: [PATCH] Add eventUpstreamConnected This is used in the next commit. --- user.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/user.go b/user.go index f976900..45613e7 100644 --- a/user.go +++ b/user.go @@ -14,6 +14,10 @@ type eventUpstreamMessage struct { uc *upstreamConn } +type eventUpstreamConnected struct { + uc *upstreamConn +} + type eventUpstreamDisconnected struct { uc *upstreamConn } @@ -75,6 +79,7 @@ func (net *network) run() { net.conn = uc net.lock.Unlock() + net.user.events <- eventUpstreamConnected{uc} if err := uc.readMessages(net.user.events); err != nil { uc.logger.Printf("failed to handle messages: %v", err) } @@ -167,6 +172,8 @@ func (u *user) run() { for e := range u.events { switch e := e.(type) { + case eventUpstreamConnected: + // Nothing to do case eventUpstreamDisconnected: uc := e.uc for _, log := range uc.logs {