[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73980] [Ruby trunk Bug#11958] TCPSocket.getsockopt().bool raises a TypeError on windows
From:
usa@...
Date:
2016-02-25 10:21:08 UTC
List:
ruby-core #73980
Issue #11958 has been updated by Usaku NAKAMURA.
Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED
ruby_2_1 r53931 merged revision(s) 53561.
----------------------------------------
Bug #11958: TCPSocket.getsockopt().bool raises a TypeError on windows
https://bugs.ruby-lang.org/issues/11958#change-57134
* Author: Marc Fournier
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.1.7p400 (2015-08-18 revision 51632) [x64-mingw32]
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
The following code snippet works as expected on linux (it returns "false"):
~~~ruby
require 'net/http'
http = Net::HTTP.new('192.168.111.21', 8080)
http.start
socket = http.instance_variable_get(:@socket).io
socket.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool
~~~
But on windows, it raises this error:
~~~
TypeError: size differ. expected as sizeof(int)=4 but 1
from (irb):8:in `bool'
from (irb):8
from irb:11:in `<main>'
~~~
(`TCPSocket.getsockopt().int` has the same problem.)
Digging a bit further, I noticed what `socket.getsockopt().data` returns is platform-specific, despite `Socket::Option.bool().data` being the same on both platforms.
On linux:
~~~ruby
socket.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).data
"\x00\x00\x00\x00"
Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false).data
"\x00\x00\x00\x00"
~~~
On windows:
~~~ruby
socket.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).data
"\x00"
Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false).data
"\x00\x00\x00\x00"
~~~
This might explain the `size differ. expected as sizeof(int)=4 but 1` raised by `getsockopt()` ?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>