* 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
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Thu Dec 4 08:29:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Thu Dec 4 03:48:59 2003 Tanaka Akira <akr@m17n.org>
|
Thu Dec 4 03:48:59 2003 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* lib/pathname.rb (Pathname#link, Pathname#symlink): obsoleted.
|
* lib/pathname.rb (Pathname#link, Pathname#symlink): obsoleted.
|
||||||
|
@ -84,10 +84,10 @@ module WEBrick
|
|||||||
setup_header()
|
setup_header()
|
||||||
send_header(socket)
|
send_header(socket)
|
||||||
send_body(socket)
|
send_body(socket)
|
||||||
rescue Errno::EPIPE
|
rescue Errno::EPIPE, Errno::ECONNRESET, Errno::ENOTCONN => ex
|
||||||
@logger.error("HTTPResponse#send_response: EPIPE occured.")
|
@logger.debug(ex)
|
||||||
@keep_alive = false
|
@keep_alive = false
|
||||||
rescue => ex
|
rescue Exception => ex
|
||||||
@logger.error(ex)
|
@logger.error(ex)
|
||||||
@keep_alive = false
|
@keep_alive = false
|
||||||
end
|
end
|
||||||
|
@ -102,7 +102,7 @@ module WEBrick
|
|||||||
rescue Errno::EBADF, IOError => ex
|
rescue Errno::EBADF, IOError => ex
|
||||||
# if the listening socket was closed in GenericServer#shutdown,
|
# if the listening socket was closed in GenericServer#shutdown,
|
||||||
# IO::select raise it.
|
# IO::select raise it.
|
||||||
rescue => ex
|
rescue Exception => ex
|
||||||
msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
|
msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
|
||||||
@logger.error msg
|
@logger.error msg
|
||||||
end
|
end
|
||||||
@ -148,14 +148,20 @@ module WEBrick
|
|||||||
@logger.debug "accept: #{addr[3]}:#{addr[1]}"
|
@logger.debug "accept: #{addr[3]}:#{addr[1]}"
|
||||||
call_callback(:AcceptCallback, sock)
|
call_callback(:AcceptCallback, sock)
|
||||||
block ? block.call(sock) : run(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]}"
|
msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
|
||||||
@logger.error msg
|
@logger.error msg
|
||||||
rescue Exception => ex
|
rescue Exception => ex
|
||||||
@logger.error ex
|
@logger.error ex
|
||||||
ensure
|
ensure
|
||||||
Thread.current[:WEBrickSocket] = nil
|
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
|
sock.close
|
||||||
end
|
end
|
||||||
@tokens.push(nil)
|
@tokens.push(nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user