[macruby-changes] [MacRuby/MacRuby] 1576cc: raise an IOError when use a closed socket because ...

noreply at github.com noreply at github.com
Mon May 23 21:05:46 PDT 2011


Branch: refs/heads/master
Home:   https://github.com/MacRuby/MacRuby

Commit: 1576cc3491ee43384a7dd6a12a20fae831b52c8c
    https://github.com/MacRuby/MacRuby/commit/1576cc3491ee43384a7dd6a12a20fae831b52c8c
Author: Watson <watson1978 at gmail.com>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M ext/socket/socket.c

Log Message:
-----------
raise an IOError when use a closed socket because Segfault occurs.

Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
require 'socket'

s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
s.close
assert_raise(IOError){ s.send("test data", 0) }

s = Socket.allocate
assert_raise(IOError){ s.send("test data", 0) }

puts :ok
}}}




More information about the macruby-changes mailing list