summaryrefslogtreecommitdiffstats
path: root/lib/webrick
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-22 11:12:06 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-22 11:12:06 +0000
commit7fd8040c7817540f4175c13e6664a463cffdcbdb (patch)
tree4d3bfc69c17e6ccccb62391d1a91e98567af921d /lib/webrick
parentc1368025b565bcc34f30bad022b50fdd89c56858 (diff)
downloadruby-7fd8040c7817540f4175c13e6664a463cffdcbdb.tar.gz
ruby-7fd8040c7817540f4175c13e6664a463cffdcbdb.tar.xz
ruby-7fd8040c7817540f4175c13e6664a463cffdcbdb.zip
* lib/webrick/server.rb (WEBrick::GenericServer#shutdown):
rescue Errno::ENOTCONN and close. [ruby-dev:35896] * test/openssl/test_ssl.rb (OpenSSL#start_server): ditto. [ruby-dev:35897] * lib/net/imap.rb (Net::IMAP#disconnect): ditto. [ruby-dev:35898] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick')
-rw-r--r--lib/webrick/server.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index 68501517c..d0b6f2b69 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -130,9 +130,17 @@ module WEBrick
addr = s.addr
@logger.debug("close TCPSocket(#{addr[2]}, #{addr[1]})")
end
- s.shutdown
- unless @config[:ShutdownSocketWithoutClose]
+ begin
+ s.shutdown
+ rescue Errno::ENOTCONN
+ # when `Errno::ENOTCONN: Socket is not connected' on some platforms,
+ # call #close instead of #shutdown.
+ # (ignore @config[:ShutdownSocketWithoutClose])
s.close
+ else
+ unless @config[:ShutdownSocketWithoutClose]
+ s.close
+ end
end
}
@listeners.clear