-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial memberlist.Transport implementation allowing us to use an upgrader for ListenTCP/ListenUDP #7
Conversation
f298138
to
3535792
Compare
transport/tcp.go
Outdated
WithField(RemoteAddrLabel, conn.RemoteAddr()). | ||
Print("Connection Terminated") | ||
|
||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this break
do really what you want? Didn't you mean:
mainfor:for {
....
break mainfor
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, but what about using return
instead? @karasz
transport/tcp.go
Outdated
// continue | ||
case <-ctx.Done(): | ||
// sorry pal, we are cancelled | ||
defer conn.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer
in for
is calling for trouble afaik
maybe
-defer conn.Close-
t.error(ctx.Err()).
WithField(ListenerAddrLabel, ln.Addr()).
WithField(RemoteAddrLabel, conn.RemoteAddr()).
Print("Connection Terminated")
+conn.Close()+
break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combined with return
becomes more explicit that it only happens once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still not fixed, line 60 is unchanged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not in a loop because there is a return right after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than what was commented this LGTM
Signed-off-by: Alejandro Mery <[email protected]>
Signed-off-by: Alejandro Mery <[email protected]>
Signed-off-by: Alejandro Mery <[email protected]>
…ion before started Signed-off-by: Alejandro Mery <[email protected]>
Signed-off-by: Alejandro Mery <[email protected]>
3535792
to
57aaec3
Compare
amended. also updated it to use the new slog/handlers/discard instead of slog/noop @karasz |
Signed-off-by: Alejandro Mery <[email protected]>
57aaec3
to
519b520
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now
No description provided.