Skip to content

Commit

Permalink
allow manual close of client connection - closes igrigorik#11
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed May 8, 2011
1 parent a1b44cc commit 2924095
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/em-proxy/connection.rb
Expand Up @@ -88,15 +88,15 @@ def unbind
def unbind_backend(name)
debug [:unbind_backend, name]
@servers[name] = nil

# if all connections are terminated downstream, then notify client
close_connection_after_writing if @servers.values.compact.size.zero?
close = :close

if @on_finish
@on_finish.call(name)
close = @on_finish.call(name)
end

# not sure if this is required
# @on_finish.call(:done) if @servers.values.compact.size.zero?
# if all connections are terminated downstream, then notify client
if @servers.values.compact.size.zero? and close != :keep
close_connection_after_writing
end
end

Expand Down

0 comments on commit 2924095

Please sign in to comment.