In the first place a pipe can be in non-blocking mode and still have a timeout. In fact this is default functionality that APR has implemented. If a pipe has a timeout of 0 or greater, it is nonblocking. Take the case of mod_cgi. It specifically sets a timeout on the pipes so that apr_file_read() will handle re-reading the pipe if data is not ready yet. By having pipe_bucket_read() change the timeout to 0, just pulled a fast one on mod_cgi. With the timeout set to 0, apr_file_read() no longer handles the re-reading of the pipe and mod_cgi ends up with an EWOULDBLOCK errno that it didn't expect to get.
Brad Brad Nicholes Senior Software Engineer Novell, Inc., the leading provider of Net business solutions http://www.novell.com >>> Cliff Woolley <[EMAIL PROTECTED]> Friday, July 12, 2002 1:02:27 PM >>> On 12 Jul 2002 [EMAIL PROTECTED] wrote: > - apr_file_pipe_timeout_set(p, 0); > + // Only mess with the timeout if we are in a blocking state > + // otherwise we are already nonblocking so don't worry about it. > + if (timeout < 0) { > + apr_file_pipe_timeout_set(p, 0); > + } I'm totally confused by this. So you're saying you want to have a timeout in nonblocking mode? How is that possible? And why < and not > ? --Cliff
