[Pkg-apache-commits] [SCM] Debian packaging for the apr (Apache Portable Runtime) package branch, master, updated. 77ded69e10a5a7749932f9f19e12ba0275a1534f

Stefan Fritsch sf at sfritsch.de
Sat May 19 14:18:20 UTC 2012


The following commit has been merged in the master branch:
commit 3f356f8d7594c8b3088d1679596a9d7f9dd4c486
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Sat May 19 00:51:44 2012 +0200

    Remove sendfile LFS patch that was only necessary for 2.4 kernels

diff --git a/debian/changelog b/debian/changelog
index 0408913..55701f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ apr (1.4.6-2) UNRELEASED; urgency=low
   * Switch VCS to git.
   * Switch to source format 3.0, debhelper 9. Thanks to Jari Aalto for the
     patch. Closes: #664299
+  * Remove sendfile LFS patch that was only necessary for 2.4 kernels.
   * Bump Standards-Version (no changes).
 
  -- Stefan Fritsch <sf at debian.org>  Sun, 18 Mar 2012 23:35:00 +0100
diff --git a/debian/patches/sendfile_lfs.patch b/debian/patches/sendfile_lfs.patch
deleted file mode 100755
index c9f6be2..0000000
--- a/debian/patches/sendfile_lfs.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-From: <thom at debian.org> <peter at p12n.org>
-Subject: Detect sendfile64() at runtime (not present on 2.4 kernels.)
-
----
- network_io/unix/sendrecv.c |   98 ++++++++++++++++++++++++++++++---------------
- 1 file changed, 66 insertions(+), 32 deletions(-)
-
---- a/network_io/unix/sendrecv.c
-+++ b/network_io/unix/sendrecv.c
-@@ -247,39 +247,77 @@
- 
- #if defined(__linux__) && defined(HAVE_WRITEV)
- 
--apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
--                                 apr_hdtr_t *hdtr, apr_off_t *offset,
--                                 apr_size_t *len, apr_int32_t flags)
-+/* Helper function for apr_socket_sendfile.
-+ * Takes care of sendfile vs. sendfile64 (must be detected at runtime),
-+ * EINTR restarting, and other details.  NOTE: does not necessarily
-+ * update 'off', as callers don't need this.
-+ */
-+static
-+ssize_t do_sendfile(int out, int in, apr_off_t *off, apr_size_t len)
- {
--    int rv, nbytes = 0, total_hdrbytes, i;
--    apr_status_t arv;
--
--#if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILE64)
--    apr_off_t off = *offset;
--#define sendfile sendfile64
--
--#elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4
--    /* 64-bit apr_off_t but no sendfile64(): fail if trying to send
--     * past the 2Gb limit. */
--    off_t off;
--    
--    if ((apr_int64_t)*offset + *len > INT_MAX) {
--        return EINVAL;
--    }
--    
--    off = *offset;
--
-+#if !APR_HAS_LARGE_FILES
-+    ssize_t ret;
-+    do
-+	ret = sendfile(out, in, off, len);
-+    while (ret == -1 && errno == EINTR);
-+    return ret;
- #else
--    off_t off = *offset;
-+
-+#ifdef HAVE_SENDFILE64
-+    static int sendfile64_enosys;  /* sendfile64() syscall not found */
-+#endif
-+    off_t offtmp;
-+    ssize_t ret;
- 
-     /* 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;
-+     * noticably hurt performance to limit each call to <2Gb at a time,
-+     * so avoid that issue here.  (Round down to a common page size.) */
-+    if (sizeof(off_t) == 8 && len > INT_MAX)
-+        len = INT_MAX - 8191;
-+
-+    /* The simple and common case: we don't cross the LFS barrier */
-+    if (sizeof(off_t) == 8 || (apr_int64_t)*off + len <= INT_MAX) {
-+        offtmp = *off;
-+        do
-+            ret = sendfile(out, in, &offtmp, len);
-+        while (ret == -1 && errno == EINTR);
-+        return ret;
-+    }
-+
-+    /* From here down we know it's a 32-bit runtime */
-+#ifdef HAVE_SENDFILE64
-+    if (!sendfile64_enosys) {
-+        do
-+            ret = sendfile64(out, in, off, len);
-+        while (ret == -1 && errno == EINTR);
-+
-+        if (ret != -1 || errno != ENOSYS)
-+            return ret;
-+
-+        sendfile64_enosys = 1;
-     }
- #endif
-+    if (*off > INT_MAX) {
-+        errno = EINVAL;
-+        return -1;
-+    }
-+    offtmp = *off;
-+    do
-+	ret = sendfile(out, in, &offtmp, len);
-+    while (ret == -1 && errno == EINTR);
-+    return ret;
-+#endif /* APR_HAS_LARGE_FILES */
-+}
-+
-+
-+apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
-+                                 apr_hdtr_t *hdtr, apr_off_t *offset,
-+                                 apr_size_t *len, apr_int32_t flags)
-+{
-+    int rv, nbytes = 0, total_hdrbytes, i;
-+    apr_status_t arv;
-+    apr_off_t off = *offset;
- 
-     if (!hdtr) {
-         hdtr = &no_hdtr;
-@@ -325,12 +363,10 @@
-         goto do_select;
-     }
- 
--    do {
--        rv = sendfile(sock->socketdes,    /* socket */
-+    rv = do_sendfile(sock->socketdes,    /* socket */
-                       file->filedes, /* open file descriptor of the file to be sent */
-                       &off,    /* where in the file to start */
-                       *len);   /* number of bytes to send */
--    } while (rv == -1 && errno == EINTR);
- 
-     while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) 
-                       && (sock->timeout > 0)) {
-@@ -341,12 +377,10 @@
-             return arv;
-         }
-         else {
--            do {
--                rv = sendfile(sock->socketdes,    /* socket */
-+	    rv = do_sendfile(sock->socketdes,    /* socket */
-                               file->filedes, /* open file descriptor of the file to be sent */
-                               &off,    /* where in the file to start */
-                               *len);    /* number of bytes to send */
--            } while (rv == -1 && errno == EINTR);
-         }
-     }
- 
diff --git a/debian/patches/series b/debian/patches/series
index c0c1252..e14bbe8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,6 @@
 fix_apr-config.patch
 ship_find_apr.m4.patch
 fix-apr.pc.patch
-sendfile_lfs.patch
 sendfile_hurd.patch
 hurd_path_max.patch
 fix_doxygen.patch

-- 
Debian packaging for the apr (Apache Portable Runtime) package



More information about the Pkg-apache-commits mailing list