mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/webrick/server.rb (GenericServer#start): should rescue
Exception to avoid unexpected aborting. [ruby-core:01853] * lib/webrick/server.rb (GenericServer#start_thread): should check that peeraddr isn't nil before printing. * lib/webrick/httpresponse.rb (HTTPResponse#start_thread): should rescue Exception to avoid unexpected aborting of thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dc9603bd5c
commit
8e1714488a
3 changed files with 23 additions and 6 deletions
|
|
@ -102,7 +102,7 @@ module WEBrick
|
|||
rescue Errno::EBADF, IOError => ex
|
||||
# if the listening socket was closed in GenericServer#shutdown,
|
||||
# IO::select raise it.
|
||||
rescue => ex
|
||||
rescue Exception => ex
|
||||
msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
|
||||
@logger.error msg
|
||||
end
|
||||
|
|
@ -148,14 +148,20 @@ module WEBrick
|
|||
@logger.debug "accept: #{addr[3]}:#{addr[1]}"
|
||||
call_callback(:AcceptCallback, sock)
|
||||
block ? block.call(sock) : run(sock)
|
||||
rescue ServerError, Errno::ENOTCONN => ex
|
||||
rescue Errno::ENOTCONN
|
||||
@logger.debug "Errno::ENOTCONN raised"
|
||||
rescue ServerError => ex
|
||||
msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
|
||||
@logger.error msg
|
||||
rescue Exception => ex
|
||||
@logger.error ex
|
||||
ensure
|
||||
Thread.current[:WEBrickSocket] = nil
|
||||
@logger.debug "close: #{addr[3]}:#{addr[1]}"
|
||||
if addr
|
||||
@logger.debug "close: #{addr[3]}:#{addr[1]}"
|
||||
else
|
||||
@logger.debug "close: <address unknown>"
|
||||
end
|
||||
sock.close
|
||||
end
|
||||
@tokens.push(nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue