Project

General

Profile

Bug #8039 » drb.socket_shutdown_fix.patch

drbrain (Eric Hodel), 03/11/2013 01:43 PM

View differences:

lib/drb/drb.rb (working copy)
def set_sockopt(soc) # :nodoc:
soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
rescue Errno::EINVAL
# socket was closed
end
end
test/drb/test_drbtcp.rb (working copy)
require 'drb'
class TestDRbTCP < Test::Unit::TestCase
def test_set_sockopt
server = DRb::DRbServer.new('druby://:0')
host, port, = DRb::DRbTCPSocket.send(:parse_uri, server.uri)
socket = TCPSocket.open host, port
socket.shutdown
client = DRb::DRbTCPSocket.new(server.uri, socket)
assert client
client.close
server.stop_service
end
end
(1-1/2)