Skip to content

Instantly share code, notes, and snippets.

@mperham
Created November 10, 2008 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperham/23693 to your computer and use it in GitHub Desktop.
Save mperham/23693 to your computer and use it in GitHub Desktop.
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