perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@apache.org>
Subject Re: svn commit: r935519 - in /perl/modperl/trunk: t/response/TestAPR/socket.pm xs/APR/Socket/APR__Socket.h xs/maps/apr_functions.map xs/tables/current/ModPerl/FunctionTable.pm
Date Mon, 19 Apr 2010 18:21:15 GMT
On 10-04-19 06:43 , torsten@apache.org wrote:
> Author: torsten
> Date: Mon Apr 19 10:43:15 2010
> New Revision: 935519
> 
> URL: http://svn.apache.org/viewvc?rev=935519&view=rev
> Log:
> make the UNIX-level file descriptor of an APR::Socket available

I am wondering what the usage for this would/could be?

Also, this is introducing a non-portable API, something APR tries really
hard to avoid.

> Modified:
>     perl/modperl/trunk/t/response/TestAPR/socket.pm
>     perl/modperl/trunk/xs/APR/Socket/APR__Socket.h
>     perl/modperl/trunk/xs/maps/apr_functions.map
>     perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm
> 
> Modified: perl/modperl/trunk/t/response/TestAPR/socket.pm
> URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPR/socket.pm?rev=935519&r1=935518&r2=935519&view=diff
> ==============================================================================
> --- perl/modperl/trunk/t/response/TestAPR/socket.pm (original)
> +++ perl/modperl/trunk/t/response/TestAPR/socket.pm Mon Apr 19 10:43:15 2010
> @@ -18,7 +18,7 @@ use APR::Const -compile => 'EMISMATCH';
>  sub handler {
>      my $r = shift;
>  
> -    my $tests = 4;
> +    my $tests = 5;
>  
>      plan $r, tests => $tests;
>  
> @@ -40,6 +40,15 @@ sub handler {
>      $socket->timeout_set($orig_val);
>      ok t_cmp($socket->timeout_get(), $orig_val, "timeout_get()");
>  
> +    my $fd=$socket->sock_get;
> +    t_debug "client socket fd=$fd";
> +    if ($^O eq 'MSWin32') {
> +        ok $fd==-1;
> +    }
> +    else {
> +        ok $fd>=0;
> +    }
> +
>      Apache2::Const::OK;
>  }
>  
> 
> Modified: perl/modperl/trunk/xs/APR/Socket/APR__Socket.h
> URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/APR/Socket/APR__Socket.h?rev=935519&r1=935518&r2=935519&view=diff
> ==============================================================================
> --- perl/modperl/trunk/xs/APR/Socket/APR__Socket.h (original)
> +++ perl/modperl/trunk/xs/APR/Socket/APR__Socket.h Mon Apr 19 10:43:15 2010
> @@ -116,3 +116,14 @@ apr_status_t mpxs_APR__Socket_poll(apr_s
>  
>      return apr_poll(&fd, 1, &nsds, timeout);
>  }
> +
> +static MP_INLINE int mpxs_APR__Socket_sock_get(pTHX_ apr_socket_t *sock)
> +{
> +#ifdef WIN32
> +    return -1;			/* not implemented */
> +#else
> +    apr_os_sock_t s;
> +    apr_os_sock_get(&s, sock);
> +    return s;
> +#endif
> +}

Will this work on *all* non WIN32 platforms ?

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/


Mime
View raw message