-
Notifications
You must be signed in to change notification settings - Fork 85
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
Send QUIT command when closing the connection without force: true. #154
base: master
Are you sure you want to change the base?
Conversation
@@ -203,7 +203,7 @@ class RespClient { | |||
Future<void> close({bool force = false}) async { | |||
_closing = true; | |||
|
|||
if (!_closing) { |
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.
How was this even supposed to work before?
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.
I think we have never sent the QUIT
message.
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.
I think I googled it and figured closing the outgoing stream while continuing to read ought to be just as reasonable.
But I'm okay, sending QUIT
, why not..
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
@@ -203,7 +203,7 @@ class RespClient { | |||
Future<void> close({bool force = false}) async { | |||
_closing = true; | |||
|
|||
if (!_closing) { |
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.
I think I googled it and figured closing the outgoing stream while continuing to read ought to be just as reasonable.
But I'm okay, sending QUIT
, why not..
Future<void> close({bool force = false}) async { | ||
_closing = true; | ||
|
||
if (!_closing) { | ||
if (!force) { | ||
// Always send QUIT message to be nice | ||
try { | ||
final quit = command(['QUIT']); |
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 will throw if _closing = true
I guess we need to set it later...
As we set
_closing = true
in the line above the if condition, I think the expression should depend on theforce
parameter.