summaryrefslogtreecommitdiff
path: root/lib/webrick/server.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-13 06:21:50 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-13 06:21:50 +0000
commitdeb0519aec1e68bdcf019d99e3e8be55fd5b2faf (patch)
tree84d30af3bd7bb57ab3fd222e8c43a94992809d40 /lib/webrick/server.rb
parentd2e69f8584577240d59560d0f68300af59430a4c (diff)
* lib/webrick/server.rb (WEBrick::GenericServer#stop): fix r35303;
this method is to deny new connections, not shutdown yet. * lib/webrick/server.rb (WEBrick::GenericServer#start): re-raise exception only when the exception is Interrupt (^C). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/server.rb')
-rw-r--r--lib/webrick/server.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index 22b91ad..bd9dcb0 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -133,16 +133,17 @@ module WEBrick
rescue Errno::EBADF, IOError => ex
# if the listening socket was closed in GenericServer#shutdown,
# IO::select raise it.
- rescue StandardError => ex
- msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
- @logger.error msg
- rescue Exception => ex
+ rescue Interrupt => ex # ^C
@logger.fatal ex
raise
+ rescue Exception => ex
+ msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
+ @logger.error msg
end
end
ensure
+ @status = :Shutdown
@logger.info "going to shutdown ..."
thgroup.list.each{|th| th.join if th[:WEBrickThread] }
call_callback(:StopCallback)
@@ -157,7 +158,7 @@ module WEBrick
def stop
if @status == :Running
- @status = :Stop
+ @status = :Shutdown
end
end