This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[rt.cpan.org #61577] sockdomain and socktype undef on newly accepted sockets
authorTony Cook <tony@develop-help.com>
Wed, 13 Jun 2012 09:27:22 +0000 (19:27 +1000)
committerTony Cook <tony@develop-help.com>
Mon, 2 Jul 2012 08:23:05 +0000 (18:23 +1000)
commit93a5d7bfc07a41ef26fb3e3b298a7d88c3741ed1
tree72cfa169ec125060ce3fb0613f32196d01f4d410
parent49f4c4e423fa15e3da8c813a7526bb78740f9018
[rt.cpan.org #61577] sockdomain and socktype undef on newly accepted sockets

There appears to be a flaw in IO::Socket where some IO::Socket objects
are unable to properly report their socktype, sockdomain, or protocol
(they return undef, even when the underlying socket is sufficiently
initialized to have these properties).

The attached patch should cover IO::Socket objects created via accept(),
new_from_fd(), new(), and anywhere else whose details haven't been
properly cached.

No new code should be executed on IO::Socket objects whose details are
already cached and present.

These tests were original written by Daniel Kahn Gillmor
<dkg@fifthhorseman.net>, I've mangled them for use in a hopefully
final fix for the issue.
MANIFEST
META.yml
dist/IO/t/cachepropagate-tcp.t [new file with mode: 0644]
dist/IO/t/cachepropagate-udp.t [new file with mode: 0644]
dist/IO/t/cachepropagate-unix.t [new file with mode: 0644]