rpms/apr/devel apr-0.9.6-procexit.patch, NONE, 1.1 apr-0.9.6-tcpopts.patch, NONE, 1.1

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Sep 15 13:47:23 UTC 2005


Author: jorton

Update of /cvs/dist/rpms/apr/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv14204

Added Files:
	apr-0.9.6-procexit.patch apr-0.9.6-tcpopts.patch 
Log Message:
- actually add the patches


apr-0.9.6-procexit.patch:
 proc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

--- NEW FILE apr-0.9.6-procexit.patch ---
--- apr-0.9.6/threadproc/unix/proc.c.procexit
+++ apr-0.9.6/threadproc/unix/proc.c
@@ -378,7 +378,7 @@
                 if (attr->errfn) {
                     attr->errfn(pool, errno, "change of working directory failed");
                 }
-                exit(-1);   /* We have big problems, the child should exit. */
+                _exit(-1);   /* We have big problems, the child should exit. */
             }
         }
 
@@ -386,7 +386,7 @@
             if (attr->errfn) {
                 attr->errfn(pool, errno, "setting of resource limits failed");
             }
-            exit(-1);   /* We have big problems, the child should exit. */
+            _exit(-1);   /* We have big problems, the child should exit. */
         }
 
         if (attr->cmdtype == APR_SHELLCMD ||
@@ -478,8 +478,8 @@
             attr->errfn(pool, errno, desc);
         }
 
-        exit(-1);  /* if we get here, there is a problem, so exit with an
-                    * error code. */
+        _exit(-1);  /* if we get here, there is a problem, so exit with an
+                     * error code. */
     }
 
     /* Parent process */

apr-0.9.6-tcpopts.patch:
 build/apr_network.m4      |   54 ++++++++++++++++++++++++++++++++++++++++++++++
 configure.in              |    1 
 network_io/unix/sockopt.c |    6 +++++
 test/testsockopt.c        |    1 
 4 files changed, 61 insertions(+), 1 deletion(-)

--- NEW FILE apr-0.9.6-tcpopts.patch ---

http://svn.apache.org/viewcvs?rev=240047&view=rev

Allow setting TCP_NODELAY and TCP_CORK at the same time, which 
is allowed in 2.6 albeit is ineffective until 2.6.13-ish.

--- apr-0.9.6/build/apr_network.m4.tcpopts
+++ apr-0.9.6/build/apr_network.m4
@@ -349,6 +349,60 @@
 ])
 
 dnl
+dnl Determine whether TCP_NODELAY and TCP_CORK can both be set
+dnl on a TCP socket.
+dnl
+AC_DEFUN([APR_CHECK_TCP_NODELAY_WITH_CORK], [
+AC_CACHE_CHECK([whether TCP_NODELAY and TCP_CORK can both be enabled],
+[apr_cv_tcp_nodelay_with_cork],
+[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+]], [[
+    int fd, flag, rc;
+
+    fd = socket(AF_INET, SOCK_STREAM, 0);
+    if (fd < 0) {
+       exit(1);
+    }
+
+    flag = 1;
+    rc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof flag);
+    if (rc < 0) {
+        perror("setsockopt TCP_NODELAY");
+        exit(2);
+    }
+
+    flag = 1;
+    rc = setsockopt(fd, IPPROTO_TCP, TCP_CORK, &flag, sizeof flag);
+    if (rc < 0) {
+        perror("setsockopt TCP_CORK");
+        exit(3);
+    }
+
+    exit(0);
+]])], [apr_cv_tcp_nodelay_with_cork=yes], [apr_cv_tcp_nodelay_with_cork=no])])
+
+if test "$apr_cv_tcp_nodelay_with_cork" = "yes"; then
+  AC_DEFINE([HAVE_TCP_NODELAY_WITH_CORK], 1,
+            [Define if TCP_NODELAY and TCP_CORK can be enabled at the same time])
+fi
+])
+
+
+dnl
 dnl see if O_NONBLOCK setting is inherited from listening sockets
 dnl
 AC_DEFUN(APR_CHECK_O_NONBLOCK_INHERITED,[
--- apr-0.9.6/network_io/unix/sockopt.c.tcpopts
+++ apr-0.9.6/network_io/unix/sockopt.c
@@ -238,6 +238,7 @@
     case APR_TCP_NOPUSH:
 #if APR_TCP_NOPUSH_FLAG
         if (apr_is_option_set(sock->netmask, APR_TCP_NOPUSH) != on) {
+#ifndef HAVE_TCP_NODELAY_WITH_CORK
             int optlevel = IPPROTO_TCP;
             int optname = TCP_NODELAY;
 
@@ -263,12 +264,16 @@
             } else if (on) {
                 apr_set_option(&sock->netmask, APR_RESET_NODELAY, 0);
             }
+#endif /* HAVE_TCP_NODELAY_WITH_CORK */
+
             /* OK, now we can just set the TCP_NOPUSH flag accordingly...*/
             if (setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG,
                            (void*)&on, sizeof(int)) == -1) {
                 return errno;
             }
             apr_set_option(&sock->netmask, APR_TCP_NOPUSH, on);
+
+#ifndef HAVE_TCP_NODELAY_WITH_CORK
             if (!on && apr_is_option_set(sock->netmask, APR_RESET_NODELAY)) {
                 int tmpflag = 1;
                 if (setsockopt(sock->socketdes, optlevel, optname,
@@ -278,6 +283,7 @@
                 apr_set_option(&sock->netmask, APR_RESET_NODELAY,0);
                 apr_set_option(&sock->netmask, APR_TCP_NODELAY, 1);
             }
+#endif /* HAVE_TCP_NODELAY_WITH_CORK */
         }
 #else
         return APR_ENOTIMPL;
--- apr-0.9.6/test/testsockopt.c.tcpopts
+++ apr-0.9.6/test/testsockopt.c
@@ -102,7 +102,6 @@
 
     rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
-    CuAssertIntEquals(tc, 0, ck);
 
     rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0);
     CuAssertIntEquals(tc, APR_SUCCESS, rv);
--- apr-0.9.6/configure.in.tcpopts
+++ apr-0.9.6/configure.in
@@ -1767,6 +1767,7 @@
 
 APR_CHECK_TCP_NODELAY_INHERITED
 APR_CHECK_O_NONBLOCK_INHERITED
+APR_CHECK_TCP_NODELAY_WITH_CORK
 
 # Look for a way of corking TCP...
 APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h)




More information about the fedora-cvs-commits mailing list