httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <c...@stdlib.net>
Subject Re: [vote] 2.1.9 as beta
Date Wed, 02 Nov 2005 14:39:12 GMT
On Wed, Nov 02, 2005 at 01:34:56PM +0000, Joe Orton wrote:
> Seems to work OK for me with RHEL4/IA64 (2.6.9-22.0.1.EL) with my normal 
> sendfile test app over loopback.
> 
> open("6G.sparse", O_RDONLY)             = 3
> fstat(3, {st_mode=S_IFREG|0664, st_size=6442450945, ...}) = 0
> sendfile(1, 3, [0], 6442450945)         = 6442450945

Thanks, I'll try a new kernel/glibc at some point. In the meantime, I think
doing;

Index: core_filters.c
===================================================================
--- core_filters.c      (revision 330237)
+++ core_filters.c      (working copy)
@@ -561,9 +561,16 @@
                     (void)apr_socket_opt_set(s, APR_TCP_NOPUSH, 0);
                 }
                 if (rv != APR_SUCCESS) {
-                    return rv;
+                    /* There are cases in which a buggy sendfile can fail, but 
+                     * an ordinary write may succeed. Let the bucket pass through 
+                     * to the non-sendfile write. If it's really a problem with
+                     * the socket, we'll find out quickly. */
+                    did_sendfile = 0;
+                }
+                else {
+                    break;
                 }
-                break;
             }
         }
 #endif /* APR_HAS_SENDFILE */
 
is reasonable. 

Basically is sendfile() returns an error, rather than give up trying to write
the file, move on to using ordinary write/writev which may or may not work.  If
it's a real problem (ie a dead socket or something), we'll find out anyway, and
if it works we get one less annoyance for our users.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Mime
View raw message