On Wed, Apr 07, 2004 at 01:44:23PM -0700, Stas Bekman wrote:
> Joe Orton wrote:
> >The issue with the echo.t test on Solaris is that the socket is in
> >non-blocking mode on the server, so on the second recv() the server just
> >returns EINTR as there's no data available.
> 
> Coolio, Joe. So should we set some socket args to make it blocking before 
> calling recv()?

Yeah, I reckon so.  Fixes echo.t on Solaris and still works on Linux:

--- t/protocol/TestProtocol/echo.pm     11 Apr 2002 11:08:43 -0000      1.2
+++ t/protocol/TestProtocol/echo.pm     7 Apr 2004 20:50:55 -0000
@@ -7,6 +7,7 @@
 use APR::Socket ();
 
 use Apache::Const -compile => 'OK';
+use APR::Const -compile => qw(:socket);
 
 use constant BUFF_LEN => 1024;
 
@@ -15,6 +16,8 @@
     my APR::Socket $socket = $c->client_socket;
 
     my $buff;
+
+    $socket->opt_set(APR::SO_NONBLOCK, 0);
 
     for (;;) {
         my($rlen, $wlen);

> >but... the fact that this works on Linux means that the socket has been
> >left in blocking mode there, and it shouldn't be AFAIK, so I'm confused 
> >about that.
> 
> Nothing on the modperl side, that's what httpd gives to us.

Hmmm, right. It's supposed to be like that.  You get a non-blocking
socket on some platforms, and a blocking socket on others.  Screwy, eh?

But for echo_filter.pm, the ap_brigade_get() is being passed
AP_BLOCK_READ by default, so now I'll go and find out why that doesn't
work as you'd expect...

joe

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to