apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r399750 - /apr/apr/trunk/network_io/unix/sendrecv.c
Date Thu, 04 May 2006 16:17:36 GMT
Author: jorton
Date: Thu May  4 09:17:36 2006
New Revision: 399750

URL: http://svn.apache.org/viewcvs?rev=399750&view=rev
Log:
* network_io/unix/sendrecv.c [__linux__] (apr_socket_sendfile): Limit
each call to 2Gb.

Modified:
    apr/apr/trunk/network_io/unix/sendrecv.c

Modified: apr/apr/trunk/network_io/unix/sendrecv.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/unix/sendrecv.c?rev=399750&r1=399749&r2=399750&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sendrecv.c (original)
+++ apr/apr/trunk/network_io/unix/sendrecv.c Thu May  4 09:17:36 2006
@@ -269,6 +269,14 @@
 
 #else
     off_t off = *offset;
+
+    /* Multiple reports have shown sendfile failing with EINVAL if
+     * passed a >=2Gb count value on some 64-bit kernels.  It won't
+     * noticably hurt performance to limit each call to <2Gb at a
+     * time, so avoid that issue here: */
+    if (sizeof(off_t) == 8 && *len > INT_MAX) {
+        *len = INT_MAX;
+    }
 #endif
 
     if (!hdtr) {



Mime
View raw message