httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject [PATCH] fix fd leaks
Date Thu, 06 Mar 2003 15:31:05 GMT
Hi, here is a version of the patch in #17206 which removes the current
the fd leaks.  Most of these were introduced in this commit

http://marc.theaimsgroup.com/?l=apache-cvs&m=99531770520998&w=2

though the pod leak has been around longer. I haven't checked whether
the mod_file_cache change in that commit should be reverted as well. The
patch is against 2.0 HEAD.

Submitted by: Christian Kratzer, Bjoern A. Zeeb

Index: modules/loggers/mod_log_config.c
===================================================================
RCS file: /store/cvs/root/httpd-2.0/modules/loggers/mod_log_config.c,v
retrieving revision 1.99
diff -u -r1.99 mod_log_config.c
--- modules/loggers/mod_log_config.c	14 Feb 2003 04:17:34 -0000	1.99
+++ modules/loggers/mod_log_config.c	6 Mar 2003 15:38:07 -0000
@@ -1291,7 +1291,6 @@
                             "could not open transfer log file %s.", fname);
             return NULL;
         }
-        apr_file_inherit_set(fd);
         return fd;
     }
 }
Index: modules/mappers/mod_rewrite.c
===================================================================
RCS file: /store/cvs/root/httpd-2.0/modules/mappers/mod_rewrite.c,v
retrieving revision 1.148
diff -u -r1.148 mod_rewrite.c
--- modules/mappers/mod_rewrite.c	1 Mar 2003 18:35:50 -0000	1.148
+++ modules/mappers/mod_rewrite.c	6 Mar 2003 15:38:08 -0000
@@ -3429,7 +3429,6 @@
                          "file %s", fname);
             exit(1);
         }
-        apr_file_inherit_set(conf->rewritelogfp);
     }
     return;
 }
Index: server/log.c
===================================================================
RCS file: /store/cvs/root/httpd-2.0/server/log.c,v
retrieving revision 1.130
diff -u -r1.130 log.c
--- server/log.c	10 Feb 2003 16:27:28 -0000	1.130
+++ server/log.c	6 Mar 2003 15:38:08 -0000
@@ -320,8 +320,6 @@
                          ap_server_argv0, fname);
             return DONE;
         }
-
-        apr_file_inherit_set(s->error_log);
     }
 
     return OK;
Index: server/mpm_common.c
===================================================================
RCS file: /store/cvs/root/httpd-2.0/server/mpm_common.c,v
retrieving revision 1.103
diff -u -r1.103 mpm_common.c
--- server/mpm_common.c	3 Feb 2003 17:53:19 -0000	1.103
+++ server/mpm_common.c	6 Mar 2003 15:38:08 -0000
@@ -410,6 +410,10 @@
     apr_sockaddr_info_get(&(*pod)->sa, ap_listeners->bind_addr->hostname,
                           APR_UNSPEC, ap_listeners->bind_addr->port, 0, p);
 
+    /* close these before exec. */
+    apr_file_unset_inherit((*pod)->pod_in);
+    apr_file_unset_inherit((*pod)->pod_out);
+
     return APR_SUCCESS;
 }
 
Index: server/mpm/worker/pod.c
===================================================================
RCS file: /store/cvs/root/httpd-2.0/server/mpm/worker/pod.c,v
retrieving revision 1.7
diff -u -r1.7 pod.c
--- server/mpm/worker/pod.c	3 Feb 2003 17:53:26 -0000	1.7
+++ server/mpm/worker/pod.c	6 Mar 2003 15:38:08 -0000
@@ -76,6 +76,10 @@
 */
     (*pod)->p = p;
     
+    /* close these before exec. */
+    apr_file_unset_inherit((*pod)->pod_in);
+    apr_file_unset_inherit((*pod)->pod_out);
+
     return APR_SUCCESS;
 }
 

Mime
View raw message