From: Tony Cook Date: Wed, 13 Jun 2012 09:32:33 +0000 (+1000) Subject: [rt.cpan.org #61577] propagate socket details on accept X-Git-Tag: upstream/5.20.0~6178^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76d04ca39f974c1aee23c29a9dda0a643740c988;p=platform%2Fupstream%2Fperl.git [rt.cpan.org #61577] propagate socket details on accept --- diff --git a/dist/IO/lib/IO/Socket.pm b/dist/IO/lib/IO/Socket.pm index 529423b..5d4b19e 100644 --- a/dist/IO/lib/IO/Socket.pm +++ b/dist/IO/lib/IO/Socket.pm @@ -249,6 +249,8 @@ sub accept { $peer = accept($new,$sock) or return; + ${*$new}{$_} = ${*$sock}{$_} for qw( io_socket_domain io_socket_type io_socket_proto ); + return wantarray ? ($new, $peer) : $new; } diff --git a/dist/IO/t/cachepropagate-tcp.t b/dist/IO/t/cachepropagate-tcp.t index 6bc2efe..b9104bb 100644 --- a/dist/IO/t/cachepropagate-tcp.t +++ b/dist/IO/t/cachepropagate-tcp.t @@ -43,7 +43,6 @@ SKIP: { my $new = $listener->accept(); - local $TODO = "this information isn't cached for accepted sockets"; is($new->sockdomain(), $d, 'domain match'); SKIP: { skip "no Socket::SO_PROTOCOL", 1 if !defined(eval { Socket::SO_PROTOCOL }); diff --git a/dist/IO/t/cachepropagate-unix.t b/dist/IO/t/cachepropagate-unix.t index 3e3a73a..2f8c55e 100644 --- a/dist/IO/t/cachepropagate-unix.t +++ b/dist/IO/t/cachepropagate-unix.t @@ -47,7 +47,6 @@ SKIP: { my $new = $listener->accept(); - $TODO = "this information isn't cached for accepted sockets"; is($new->sockdomain(), $d, 'domain match'); SKIP: { skip "no Socket::SO_PROTOCOL", 1 if !defined(eval { Socket::SO_PROTOCOL });