Skip to content

Instantly share code, notes, and snippets.

@mperham
Created Nov 10, 2008
Embed
What would you like to do?
diff --git a/lib/starling/handler.rb b/lib/starling/handler.rb
index 4ab2960..1bde8ac 100644
--- a/lib/starling/handler.rb
+++ b/lib/starling/handler.rb
@@ -56,6 +56,7 @@ STAT queue_%s_age %d\r\n".freeze
SHUTDOWN_COMMAND = /\Ashutdown\r\n/m
+ QUIT_COMMAND = /\Aquit\r\n/m
@@next_session_id = 1
@@ -126,6 +127,9 @@ STAT queue_%s_age %d\r\n".freeze
Runner::shutdown
when DELETE_COMMAND
delete $1
+ when QUIT_COMMAND
+ # ignore the command, client is closing connection.
+ return nil
else
logger.warn "Unknown command: #{data}."
respond ERR_UNKNOWN_COMMAND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment