You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2005/08/31 11:46:21 UTC

svn commit: r264990 - in /httpd/httpd/branches/2.2.x: build/rpm/httpd.spec.in server/listen.c support/htcacheclean.c

Author: jorton
Date: Wed Aug 31 02:46:17 2005
New Revision: 264990

URL: http://svn.apache.org/viewcvs?rev=264990&view=rev
Log:
Merge r239381, r240092, r240096, r240349 from trunk:

* support/htcacheclean.c: Update htcacheclean defines to match
mod_disk_cache.c.

* server/listen.c (IS_INADDR_ANY, IS_IN6ADDR_ANY): New macros.
(open_listeners): Simplify using the new macros; no functional change.

* server/listen.c (open_listeners): If 0.0.0.0 is found before [::]
for the same port, switch them so that the bind to [::] is attempted
first.

* build/rpm/httpd.spec.in: Fix the RPM spec file: XML versions of the
doc files are no longer removed. Added httxt2dbm to the sbin
directory.

Submitted by: colm, jorton, minfrin
Reviewed by: colm, jorton, trawick, jerenkrantz

Modified:
    httpd/httpd/branches/2.2.x/build/rpm/httpd.spec.in
    httpd/httpd/branches/2.2.x/server/listen.c
    httpd/httpd/branches/2.2.x/support/htcacheclean.c

Modified: httpd/httpd/branches/2.2.x/build/rpm/httpd.spec.in
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/build/rpm/httpd.spec.in?rev=264990&r1=264989&r2=264990&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/build/rpm/httpd.spec.in (original)
+++ httpd/httpd/branches/2.2.x/build/rpm/httpd.spec.in Wed Aug 31 02:46:17 2005
@@ -203,7 +203,6 @@
 # docroot
 mkdir $RPM_BUILD_ROOT%{contentdir}/html
 rm -r $RPM_BUILD_ROOT%{contentdir}/manual/style
-rm $RPM_BUILD_ROOT%{contentdir}/manual/*/*.xml
 
 # logs
 rmdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/logs
@@ -324,6 +323,7 @@
 %{_sbindir}/logresolve
 %{_sbindir}/httpd
 %{_sbindir}/httpd.worker
+%{_sbindir}/httxt2dbm
 %{_sbindir}/apachectl
 %{_sbindir}/rotatelogs
 %attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
@@ -397,6 +397,10 @@
 %{_libdir}/httpd/build/mkdir.sh
 
 %changelog
+* Fri Aug 26 2005 Graham Leggett <mi...@apache.org> 2.1.7
+- Deleting the xml doc files is no longer necessary.
+- Add httxt2dbm to the sbin directory
+
 * Sat Jul 2 2005 Graham Leggett <mi...@apache.org> 2.1.7-dev
 - Fixed complaints about unpackaged files with new config file changes.
 

Modified: httpd/httpd/branches/2.2.x/server/listen.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/server/listen.c?rev=264990&r1=264989&r2=264990&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/listen.c (original)
+++ httpd/httpd/branches/2.2.x/server/listen.c Wed Aug 31 02:46:17 2005
@@ -346,6 +346,15 @@
 
     return NULL;
 }
+/* Evaluates to true if the (apr_sockaddr_t *) addr argument is the
+ * IPv4 match-any-address, 0.0.0.0. */
+#define IS_INADDR_ANY(addr) ((addr)->family == APR_INET \
+                             && (addr)->sa.sin.sin_addr.s_addr == INADDR_ANY)
+
+/* Evaluates to true if the (apr_sockaddr_t *) addr argument is the
+ * IPv6 match-any-address, [::]. */
+#define IS_IN6ADDR_ANY(addr) ((addr)->family == APR_INET6 \
+                              && IN6_IS_ADDR_UNSPECIFIED(&(addr)->sa.sin6.sin6_addr))
 
 /**
  * Create, open, listen, and bind all sockets.
@@ -374,22 +383,43 @@
         else {
 #if APR_HAVE_IPV6
             int v6only_setting;
+
+            /* If we have the unspecified IPv4 address (0.0.0.0) and
+             * the unspecified IPv6 address (::) is next, we need to
+             * swap the order of these in the list. We always try to
+             * bind to IPv6 first, then IPv4, since an IPv6 socket
+             * might be able to receive IPv4 packets if V6ONLY is not
+             * enabled, but never the other way around. */
+            if (lr->next != NULL
+                && IS_INADDR_ANY(lr->bind_addr)
+                && lr->bind_addr->port == lr->next->bind_addr->port
+                && IS_IN6ADDR_ANY(lr->next->bind_addr)) {
+                /* Exchange lr and lr->next */
+                ap_listen_rec *next = lr->next;
+                lr->next = next->next;
+                next->next = lr;
+                if (previous) {
+                    previous->next = next;
+                }
+                else {
+                    ap_listeners = next;
+                }
+                lr = next;
+            }
+
             /* If we are trying to bind to 0.0.0.0 and the previous listener
              * was :: on the same port and in turn that socket does not have
              * the IPV6_V6ONLY flag set; we must skip the current attempt to
              * listen (which would generate an error). IPv4 will be handled
              * on the established IPv6 socket.
              */
-            if (previous != NULL &&
-                lr->bind_addr->family == APR_INET &&
-                lr->bind_addr->sa.sin.sin_addr.s_addr == INADDR_ANY &&
-                lr->bind_addr->port == previous->bind_addr->port &&
-                previous->bind_addr->family == APR_INET6 &&
-                IN6_IS_ADDR_UNSPECIFIED(
-                    &previous->bind_addr->sa.sin6.sin6_addr) &&
-                apr_socket_opt_get(previous->sd, APR_IPV6_V6ONLY,
-                                   &v6only_setting) == APR_SUCCESS &&
-                v6only_setting == 0) {
+            if (previous != NULL
+                && IS_INADDR_ANY(lr->bind_addr)
+                && lr->bind_addr->port == previous->bind_addr->port
+                && IS_IN6ADDR_ANY(previous->bind_addr)
+                && apr_socket_opt_get(previous->sd, APR_IPV6_V6ONLY,
+                                      &v6only_setting) == APR_SUCCESS
+                && v6only_setting == 0) {
 
                 /* Remove the current listener from the list */
                 previous->next = lr->next;
@@ -407,12 +437,10 @@
                  * error. The user will still get a warning from make_sock
                  * though.
                  */
-                if (lr->next != NULL && lr->bind_addr->family == APR_INET6 &&
-                    IN6_IS_ADDR_UNSPECIFIED(
-                        &lr->bind_addr->sa.sin6.sin6_addr) &&
-                    lr->bind_addr->port == lr->next->bind_addr->port &&
-                    lr->next->bind_addr->family == APR_INET && 
-                    lr->next->bind_addr->sa.sin.sin_addr.s_addr == INADDR_ANY) {
+                if (lr->next != NULL
+                    && IS_IN6ADDR_ANY(lr->bind_addr)
+                    && lr->bind_addr->port == lr->next->bind_addr->port
+                    && IS_INADDR_ANY(lr->next->bind_addr)) {
 
                     /* Remove the current listener from the list */
                     if (previous) {

Modified: httpd/httpd/branches/2.2.x/support/htcacheclean.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/htcacheclean.c?rev=264990&r1=264989&r2=264990&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/htcacheclean.c (original)
+++ httpd/httpd/branches/2.2.x/support/htcacheclean.c Wed Aug 31 02:46:17 2005
@@ -44,8 +44,8 @@
 
 /* mod_disk_cache.c extract start */
 
-#define VARY_FORMAT_VERSION 1
-#define DISK_FORMAT_VERSION 2
+#define VARY_FORMAT_VERSION 3
+#define DISK_FORMAT_VERSION 4
 
 typedef struct {
     /* Indicates the format of the header struct stored on-disk. */