diff options
author | danfe <danfe@FreeBSD.org> | 2016-07-02 16:54:56 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2016-07-02 16:54:56 +0800 |
commit | 690efdba93e86be29d28f5850304d3657be8fbb4 (patch) | |
tree | ac02025b783179baf3c6bb7d0766f48812b8d8fd | |
parent | 6b26b75811bc8f16f44efa8ec8de84aeb7509e0f (diff) | |
download | freebsd-ports-graphics-690efdba93e86be29d28f5850304d3657be8fbb4.tar.gz freebsd-ports-graphics-690efdba93e86be29d28f5850304d3657be8fbb4.tar.zst freebsd-ports-graphics-690efdba93e86be29d28f5850304d3657be8fbb4.zip |
Add two more configuration options (defaults were not changed):
- LOG_UNKNOWN: whether to log unknown request headers. Most sites will not
want to log them, which will save them a bit of CPU time;
- FLUSH_LOG: whether to fflush() the log file after each request. If this
is turned off there's a slight savings in CPU cycles.
-rw-r--r-- | www/thttpd/Makefile | 11 | ||||
-rw-r--r-- | www/thttpd/files/extra-patch-log_unknown_headers | 12 |
2 files changed, 21 insertions, 2 deletions
diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile index ce4a4f0b669..376190dcd1d 100644 --- a/www/thttpd/Makefile +++ b/www/thttpd/Makefile @@ -19,18 +19,21 @@ SUB_FILES= pkg-message thttpd.conf.sample SUB_LIST= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} CPE_VENDOR= acme -OPTIONS_DEFINE= SENDFILE IPREAL INDEXES HTACCESS STATS -OPTIONS_DEFAULT= SENDFILE IPREAL STATS +OPTIONS_DEFINE= SENDFILE IPREAL INDEXES HTACCESS STATS LOG_UNKNOWN FLUSH_LOG +OPTIONS_DEFAULT= SENDFILE IPREAL STATS FLUSH_LOG SENDFILE_DESC= Use sendfile(2) to serve files IPREAL_DESC= Respect (pass on) "X-Forwarded-For" header INDEXES_DESC= Generate index pages for directories HTACCESS_DESC= IP-based authorization (.htaccess) support STATS_DESC= Collect internal stats and print to system log +LOG_UNKNOWN_DESC= Log unknown request headers +FLUSH_LOG_DESC= fflush() the log file after each request SENDFILE_EXTRA_PATCHES= ${FILESDIR}/extra-patch-config.h IPREAL_EXTRA_PATCHES= ${FILESDIR}/extra-patch-ip_real HTACCESS_EXTRA_PATCHES= ${FILESDIR}/extra-patch-htaccess +LOG_UNKNOWN_EXTRA_PATCHES= ${FILESDIR}/extra-patch-log_unknown_headers post-patch: # To avoid conflict with other ports that also install htpasswd(1) @@ -48,6 +51,10 @@ post-patch-STATS-off: @${REINPLACE_CMD} -e '/STATS_TIME/s|.*|/* & */|' \ ${WRKSRC}/config.h +post-patch-FLUSH_LOG-off: + @${REINPLACE_CMD} -e '/FLUSH_LOG_EVERY_TIME/s|.*|/* & */|' \ + ${WRKSRC}/config.h + post-install: ${INSTALL_DATA} ${WRKDIR}/thttpd.conf.sample ${STAGEDIR}${PREFIX}/etc ${PRINTF} "/var/log/thttpd.log\t ${WWWOWN}:${WWWGRP}\t640 7 * @T00\ diff --git a/www/thttpd/files/extra-patch-log_unknown_headers b/www/thttpd/files/extra-patch-log_unknown_headers new file mode 100644 index 00000000000..2a96bff73e9 --- /dev/null +++ b/www/thttpd/files/extra-patch-log_unknown_headers @@ -0,0 +1,12 @@ +--- config.h.orig 2011-09-11 16:41:37 UTC ++++ config.h +@@ -341,9 +342,7 @@ + /* CONFIGURE: Whether to log unknown request headers. Most sites will not + ** want to log them, which will save them a bit of CPU time. + */ +-#ifdef notdef + #define LOG_UNKNOWN_HEADERS +-#endif + + /* CONFIGURE: Whether to fflush() the log file after each request. If + ** this is turned off there's a slight savings in CPU cycles. |