diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2002-07-17 12:55:16 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2002-07-17 12:55:16 +0000 |
commit | 9674d4d6e47dab268475fd401e9474df2959a36d (patch) | |
tree | c9749195a010c681bc81203deced2addae365b43 /usr.sbin/httpd | |
parent | c6ebd0750a4d4cb174a2063283610bcf490f2001 (diff) |
use fdcache as well
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r-- | usr.sbin/httpd/src/modules/standard/Makefile.tmpl | 5 | ||||
-rw-r--r-- | usr.sbin/httpd/src/modules/standard/mod_log_agent.c | 9 | ||||
-rw-r--r-- | usr.sbin/httpd/src/modules/standard/mod_log_referer.c | 9 |
3 files changed, 19 insertions, 4 deletions
diff --git a/usr.sbin/httpd/src/modules/standard/Makefile.tmpl b/usr.sbin/httpd/src/modules/standard/Makefile.tmpl index 2211d16dd47..b100d6107ef 100644 --- a/usr.sbin/httpd/src/modules/standard/Makefile.tmpl +++ b/usr.sbin/httpd/src/modules/standard/Makefile.tmpl @@ -1,3 +1,4 @@ +# $OpenBSD: Makefile.tmpl,v 1.4 2002/07/17 12:55:15 henning Exp $ #Dependencies @@ -158,7 +159,7 @@ mod_log_agent.o: mod_log_agent.c $(INCDIR)/httpd.h \ $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ $(INCDIR)/ap_alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h \ $(INCDIR)/util_uri.h $(INCDIR)/http_config.h \ - $(INCDIR)/http_log.h + $(INCDIR)/http_log.h $(INCDIR)/fdcache.h mod_log_config.o: mod_log_config.c $(INCDIR)/httpd.h \ $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \ $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \ @@ -173,7 +174,7 @@ mod_log_referer.o: mod_log_referer.c $(INCDIR)/httpd.h \ $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ $(INCDIR)/ap_alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h \ $(INCDIR)/util_uri.h $(INCDIR)/http_config.h \ - $(INCDIR)/http_log.h + $(INCDIR)/http_log.h $(INCDIR)/fdcache.h mod_mime.o: mod_mime.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \ $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h \ $(OSDIR)/os.h $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \ diff --git a/usr.sbin/httpd/src/modules/standard/mod_log_agent.c b/usr.sbin/httpd/src/modules/standard/mod_log_agent.c index fde6b917eb4..da3a7e6dd71 100644 --- a/usr.sbin/httpd/src/modules/standard/mod_log_agent.c +++ b/usr.sbin/httpd/src/modules/standard/mod_log_agent.c @@ -1,3 +1,5 @@ +/* $OpenBSD: mod_log_agent.c,v 1.5 2002/07/17 12:55:15 henning Exp $ */ + /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -60,6 +62,7 @@ #include "httpd.h" #include "http_config.h" #include "http_log.h" +#include "fdcache.h" module agent_log_module; @@ -125,7 +128,11 @@ static void open_agent_log(server_rec *s, pool *p) cls->agent_fd = ap_piped_log_write_fd(pl); } else if (*cls->fname != '\0') { - if ((cls->agent_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) { + if (ap_server_chroot_desired()) + cls->agent_fd = fdcache_open(fname, xfer_flags, xfer_mode); + else + cls->agent_fd = ap_popenf(p, fname, xfer_flags, xfer_mode); + if (cls->agent_fd < 0) { ap_log_error(APLOG_MARK, APLOG_ERR, s, "could not open agent log file %s.", fname); exit(1); diff --git a/usr.sbin/httpd/src/modules/standard/mod_log_referer.c b/usr.sbin/httpd/src/modules/standard/mod_log_referer.c index 733fd18a2d6..ec11dfeb5c6 100644 --- a/usr.sbin/httpd/src/modules/standard/mod_log_referer.c +++ b/usr.sbin/httpd/src/modules/standard/mod_log_referer.c @@ -1,3 +1,5 @@ +/* $OpenBSD: mod_log_referer.c,v 1.5 2002/07/17 12:55:15 henning Exp $ */ + /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -60,6 +62,7 @@ #include "httpd.h" #include "http_config.h" #include "http_log.h" +#include "fdcache.h" module referer_log_module; @@ -142,7 +145,11 @@ static void open_referer_log(server_rec *s, pool *p) cls->referer_fd = ap_piped_log_write_fd(pl); } else if (*cls->fname != '\0') { - if ((cls->referer_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) { + if (ap_server_chroot_desired()) + cls->referer_fd = fdcache_open(fname, xfer_flags, xfer_mode); + else + cls->referer_fd = ap_popenf(p, fname, xfer_flags, xfer_mode); + if (cls->referer_fd < 0) { ap_log_error(APLOG_MARK, APLOG_ERR, s, "could not open referer log file %s.", fname); exit(1); |