]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r239381, r240092, r240096, r240349 from trunk:
authorJoe Orton <jorton@apache.org>
Wed, 31 Aug 2005 09:46:17 +0000 (09:46 +0000)
committerJoe Orton <jorton@apache.org>
Wed, 31 Aug 2005 09:46:17 +0000 (09:46 +0000)
* 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

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@264990 13f79535-47bb-0310-9956-ffa450edef68

build/rpm/httpd.spec.in
server/listen.c
support/htcacheclean.c

index 834ae6fb3d93df334f3dea129a1fb822676ec0b2..6bf56045d6c2017c547b288ba95b206c04bcde1a 100644 (file)
@@ -203,7 +203,6 @@ echo %{mmn} > $RPM_BUILD_ROOT%{_includedir}/httpd/.mmn
 # 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 @@ rm -rf $RPM_BUILD_ROOT
 %{_sbindir}/logresolve
 %{_sbindir}/httpd
 %{_sbindir}/httpd.worker
+%{_sbindir}/httxt2dbm
 %{_sbindir}/apachectl
 %{_sbindir}/rotatelogs
 %attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
@@ -397,6 +397,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/httpd/build/mkdir.sh
 
 %changelog
+* Fri Aug 26 2005 Graham Leggett <minfrin@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 <minfrin@apache.org> 2.1.7-dev
 - Fixed complaints about unpackaged files with new config file changes.
 
index 6a3ee9e7bf9ae12ffcfb1a676d8dbb3944003059..ab4e7de3d9c08656e42f9c11ab73d9013b8fd690 100644 (file)
@@ -346,6 +346,15 @@ static const char *alloc_listener(process_rec *process, char *addr,
 
     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 @@ static int open_listeners(apr_pool_t *pool)
         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 @@ static int open_listeners(apr_pool_t *pool)
                  * 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) {
index 83b0b3affbd473ba40835e078ee32cd267d77c96..6fa1842ca49d01d9f02f980e4a1a55f67f35cf2a 100644 (file)
@@ -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. */