You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Joe Orton <jo...@manyfish.co.uk> on 2004/05/07 00:41:44 UTC

O_NONBLOCK issue

Having looked at this more I don't understand why it's failing, and the
Solaris build environment I was using is acting up so I can't get
anything to build...

apr_socket_recv, and hence the socket bucket ->read function, looks like
it should do the right thing for a non-blocking socket, and that's all
that's being used here; I think it must be some more subtle issue than I
expected.

Has anyone tried reproducing this on Linux with an httpd modified to set
APR_SO_NONBLOCK at an appropriate place?  That might make it easier to
debug...

joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: O_NONBLOCK issue

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> Having looked at this more I don't understand why it's failing, and the
> Solaris build environment I was using is acting up so I can't get
> anything to build...

Is it a mod_perl problem?

> apr_socket_recv, and hence the socket bucket ->read function, looks like
> it should do the right thing for a non-blocking socket, and that's all
> that's being used here; I think it must be some more subtle issue than I
> expected.

Hmm, I think it's not so much of a problem with socket read/write setup, since 
we can document that one needs to set the socket to non-blocking mode before 
using it. It's much more of an issue with filters, which fail for the same reason.

> Has anyone tried reproducing this on Linux with an httpd modified to set
> APR_SO_NONBLOCK at an appropriate place?  That might make it easier to
> debug...

Do you know already what's the appropriate place?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: O_NONBLOCK issue

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> I think I understand the issue now (but my coffee has nearly run out),
> and I've asked dev@apr for clarification. 

It's strange that your emails arrive with 3 days delay, Joe

> Meanwhile there is an double
> negative bug in echo_block.pm: it tries to clear the NONBLOCK flag, then
> fails if it is cleared.
> 
> --- protocol/TestProtocol/echo_block.pm	4 May 2004 06:14:44 -0000	1.2
> +++ protocol/TestProtocol/echo_block.pm	7 May 2004 00:21:44 -0000
> @@ -27,9 +27,9 @@
>      if ($nonblocking) {
>          $socket->opt_set(APR::SO_NONBLOCK => 0);
>  
> -        # test that we really are in the non-blocking mode
> +        # test that we really are in blocking mode
>          $socket->opt_get(APR::SO_NONBLOCK)
> -            or die "failed to set non-blocking mode";
> +            and die "failed to set blocking mode";
>      }
>  
>      while (1) {

Yes, thank you, that has already been fixed :)

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: O_NONBLOCK issue

Posted by Joe Orton <jo...@manyfish.co.uk>.
I think I understand the issue now (but my coffee has nearly run out),
and I've asked dev@apr for clarification.  Meanwhile there is an double
negative bug in echo_block.pm: it tries to clear the NONBLOCK flag, then
fails if it is cleared.

--- protocol/TestProtocol/echo_block.pm	4 May 2004 06:14:44 -0000	1.2
+++ protocol/TestProtocol/echo_block.pm	7 May 2004 00:21:44 -0000
@@ -27,9 +27,9 @@
     if ($nonblocking) {
         $socket->opt_set(APR::SO_NONBLOCK => 0);
 
-        # test that we really are in the non-blocking mode
+        # test that we really are in blocking mode
         $socket->opt_get(APR::SO_NONBLOCK)
-            or die "failed to set non-blocking mode";
+            and die "failed to set blocking mode";
     }
 
     while (1) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org