diff --git a/www/apache22/Makefile b/www/apache22/Makefile index 94fb80cad021..d0ef09e69f77 100644 --- a/www/apache22/Makefile +++ b/www/apache22/Makefile @@ -1,226 +1,226 @@ # New ports collection makefile for: apache22 # Date created: Dec 11 2004 # Whom: Clement Laforet # # $FreeBSD$ # # For more information, please read Makefile.doc # PORTNAME= apache PORTVERSION= 2.2.11 -PORTREVISION?= 3 +PORTREVISION?= 4 CATEGORIES= www MASTER_SITES= ${MASTER_SITE_APACHE_HTTPD} DISTNAME= httpd-${PORTVERSION} DISTFILES= ${DISTNAME}.tar.bz2 DIST_SUBDIR= apache22 MAINTAINER?= apache@FreeBSD.org COMMENT?= Version 2.2.x of Apache web server with ${WITH_MPM:L} MPM. LIB_DEPENDS= expat.6:${PORTSDIR}/textproc/expat2 \ pcre.0:${PORTSDIR}/devel/pcre LATEST_LINK?= apache22 CONFLICTS= apache+mod_ssl-1.* apache+mod_ssl+ipv6-1.* apache+mod_ssl+modsnmp-1.* \ apache+mod_ssl+mod_snmp+ipv6-1.* apache+mod_ssl+mod_accel-1.* \ apache+mod_ssl+mod_snmp+mod_accel-1.* \ apache+ipv6-1.* apache+ssl-1.* apache-1.* apache_fp-1.* \ caudium-devel-1.* caudium10-1.* caudium12-* \ ru-apache+mod_ssl-1.* ru-apache-1.* \ apache-2.0.* apache-*-2.0.* apache-2.1.* apache-*-2.1.* SCRIPTS_ENV+= LIBTOOL=${LIBTOOL} LIBTOOLIZE=${LIBTOOLIZE} \ LIBTOOL_VERSION=${LIBTOOL_VERSION} AUTOCONF=${AUTOCONF} \ LIBTOOL_M4=${LOCALBASE}/share/aclocal/libtool${LIBTOOL_VERSION}.m4 \ AUTOHEADER=${AUTOHEADER} USE_APACHE= common22 USE_BZIP2= yes USE_ICONV= yes USE_AUTOTOOLS= autoconf:262 libtool:15 USE_PERL5= yes USE_RC_SUBR= apache22.sh htcacheclean.sh SUB_LIST+= RC_SUBR_SUFFIX=${RC_SUBR_SUFFIX} LIBTOOLFILES= configure MPM_ITK_VERSION?= 20080727-00 # for slave ports .if !defined(MASTERDIR) APACHEDIR= ${.CURDIR} .else APACHEDIR= ${MASTERDIR} .endif .if !defined(WITHOUT_APACHE_OPTIONS) OPTIONS= \ APR_FROM_PORTS "Use devel/apr as APR (beware!)" Off \ THREADS "Enable threads support in APR" Off \ MYSQL "Enable MySQL support for apr-dbd" Off \ PGSQL "Enable PostgreSQL support for apr-dbd" Off \ SQLITE "Enable SQLite support for apr-dbd" Off \ IPV6 "Enable IPv6 support" On \ BDB "Enable BerkeleyDB dbm" Off .include "${APACHEDIR}/Makefile.options" .endif CONFIGURE_ARGS= --prefix=${PREFIX_RELDEST} \ --enable-layout=FreeBSD \ --with-perl=${PERL5} \ --with-port=${WITH_HTTP_PORT} \ --with-expat=${LOCALBASE} \ --with-iconv=${LOCALBASE} \ --enable-http \ --with-pcre=${LOCALBASE} CONFIGURE_ENV= CC="${CC}" CPPFLAGS="${CPPFLAGS}" \ CFLAGS="${CFLAGS}" \ LDFLAGS="${LDFLAGS}" CONFIG_SHELL="${SH}" \ LOCALBASE="${LOCALBASE}" PREFIX_RELDEST= ${PREFIX:S,^${DESTDIR},,} MAKE_ENV+= EXPR_COMPAT=yes WITH_MPM?= prefork # or worker, event, itk WITH_HTTP_PORT?= 80 .if defined(WITH_STATIC_SUPPORT) CONFIGURE_ARGS+= --enable-static-support .endif # debug overrides CFLAGS .if defined(WITH_DEBUG) DEBUG_FLAGS?= -O0 -g -ggdb3 CFLAGS= ${DEBUG_FLAGS} CONFIGURE_ARGS+= --enable-maintainer-mode WITH_EXCEPTION_HOOK= YES .endif .if defined(WITH_EXCEPTION_HOOK) CONFIGURE_ARGS+= --enable-exception-hook .endif .include "${APACHEDIR}/Makefile.doc" .include "${APACHEDIR}/Makefile.modules" .include # OPTIONS fixups .if defined (WITH_AUTHNZ_LDAP) WITH_LDAP= yes .endif .include "${APACHEDIR}/Makefile.modules" .if (defined(WITH_SSL)|| !defined(WITHOUT_SSL_MODULES)) .include "${PORTSDIR}/Mk/bsd.openssl.mk" CFLAGS+= -I${OPENSSLINC} LDFLAGS+= -L${OPENSSLLIB} .endif .if defined(WITH_APR_FROM_PORTS) PLIST_SUB+= APR_PORTS="@comment " APR_PORT?= devel/apr LIB_DEPENDS+= apr-1:${PORTSDIR}/${APR_PORT} CONFIGURE_ARGS+= --with-apr=${LOCALBASE}/bin/apr-1-config \ --with-apr-util=${LOCALBASE}/bin/apu-1-config CONFIGURE_ENV+= LTFLAGS="--tag=CXX" .else USE_LDCONFIG= yes PLIST_SUB+= APR_PORTS="" CONFLICTS+= apr-1.* apr-db4[0-9]-1.* CONFIGURE_ENV+= USE_BUNDLED_APR=YES .endif # When using apr_mysql_db we _must_ rebuild makefiles .if defined(WITH_FULLBUILD) BUILD_DEPENDS= python:${PORTSDIR}/lang/python SCRIPTS_ENV+= FULLBUILD=on .endif .if defined (WITH_LDAP) || defined (WITH_LDAP_MODULES) USE_OPENLDAP= YES CONFIGURE_ARGS+= --with-ldap \ --with-ldap-lib="${LOCALBASE}/lib" \ --with-ldap-include="${LOCALBASE}/include" .endif .if defined(WITHOUT_IPV6) CONFIGURE_ARGS+= --disable-ipv6 .else CATEGORIES+= ipv6 . if defined(WITH_IPV6_V6ONLY) || defined(WITHOUT_V4MAPPED) CONFIGURE_ARGS+= --disable-v4-mapped . else CONFIGURE_ARGS+= --enable-v4-mapped . endif .endif .if defined(WITH_THREADS) CONFIGURE_ARGS+= --enable-threads . if ${ARCH} == i386 CONFIGURE_ARGS+= --enable-nonportable-atomics . endif .endif CONFIGURE_ARGS+= --with-mpm=${WITH_MPM:L} pre-everything:: @${ECHO_MSG} "" @${ECHO_MSG} " To enable a module category: WITH__MODULES" @${ECHO_MSG} " To disable a module category: WITHOUT__MODULES" @${ECHO_MSG} "" @${ECHO_MSG} " Per default categories are:" @${ECHO_MSG} " ${DEFAULT_MODULES_CATEGORIES}" @${ECHO_MSG} " Categories available:" @${ECHO_MSG} " ${ALL_MODULES_CATEGORIES}" @${ECHO_MSG} "" @${ECHO_MSG} " To see all available knobs, type make show-options" @${ECHO_MSG} " To see all modules in different categories, type make show-categories" @${ECHO_MSG} " You can check your modules configuration by using make show-modules" @${ECHO_MSG} "" show-options: @${SED} -ne 's/^##//p' ${APACHEDIR}/Makefile.doc post-patch: @${RM} -f ${WRKSRC}/docs/docroot/*.bak @${REINPLACE_CMD} -e 's," PLATFORM ",FreeBSD,' \ ${WRKSRC}/server/core.c @${REINPLACE_CMD} -e "s,%%OSVERSION%%,${OSVERSION}," \ ${WRKSRC}/srclib/apr/build/apr_hints.m4 @${INSTALL_DATA} ${WRKSRC}/NOTICE ${WRKSRC}/docs/manual pre-configure: @cd ${WRKSRC}; ${SETENV} ${SCRIPTS_ENV} ./buildconf post-configure: @FTPUSERS=`${EGREP} -v '^#' /etc/ftpusers| ${TR} -s "\n" " "` ;\ ${REINPLACE_CMD} -e "s,%%FTPUSERS%%,$$FTPUSERS," \ ${WRKSRC}/docs/conf/extra/httpd-userdir.conf @${REINPLACE_CMD} -e "s,%%WWWOWN%%,${WWWOWN}, ; \ s,%%WWWGRP%%,${WWWGRP}," \ ${WRKSRC}/docs/conf/httpd.conf @${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX}," \ ${WRKSRC}/support/envvars-std pre-install: @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL post-install: @${MKDIR} ${PREFIX}/etc/apache22/envvars.d @${MKDIR} ${PREFIX}/etc/apache22/Includes @${INSTALL_DATA} ${FILESDIR}/no-accf.conf ${PREFIX}/etc/apache22/Includes .if !defined(NOPORTDOCS) .for dir in style/lang style/xsl/util style/xsl @[ -d ${DOCSDIR}/${dir}/ ] && ${TOUCH} ${DOCSDIR}/${dir}/.keepme .endfor .endif @${CAT} ${PKGMESSAGE} .include diff --git a/www/apache22/files/patch-support:ab.c b/www/apache22/files/patch-support:ab.c new file mode 100644 index 000000000000..98b5539a74db --- /dev/null +++ b/www/apache22/files/patch-support:ab.c @@ -0,0 +1,262 @@ +--- support/ab.c.orig 2008-12-01 00:47:31.000000000 +0900 ++++ support/ab.c 2009-04-01 16:08:09.000000000 +0900 +@@ -208,13 +208,18 @@ + /* maximum number of requests on a time limited test */ + #define MAX_REQUESTS (INT_MAX > 50000 ? 50000 : INT_MAX) + +-/* good old state hostname */ +-#define STATE_UNCONNECTED 0 +-#define STATE_CONNECTING 1 /* TCP connect initiated, but we don't ++/* connection state ++ * don't add enums or rearrange or otherwise change values without ++ * visiting set_conn_state() ++ */ ++typedef enum { ++ STATE_UNCONNECTED = 0, ++ STATE_CONNECTING, /* TCP connect initiated, but we don't + * know if it worked yet + */ +-#define STATE_CONNECTED 2 /* we know TCP connect completed */ +-#define STATE_READ 3 ++ STATE_CONNECTED, /* we know TCP connect completed */ ++ STATE_READ ++} connect_state_e; + + #define CBUFFSIZE (2048) + +@@ -239,6 +244,7 @@ + done; /* Connection closed */ + + int socknum; ++ apr_int16_t reqevents; /* current poll events for this socket */ + #ifdef USE_SSL + SSL *ssl; + #endif +@@ -383,6 +389,56 @@ + exit(rv); + } + ++static void set_polled_events(struct connection *c, apr_int16_t new_reqevents) ++{ ++ apr_int16_t old_reqevents = c->reqevents; ++ apr_pollfd_t pfd; ++ apr_status_t rv; ++ char buf[120]; ++ ++ if (old_reqevents != new_reqevents) { ++ pfd.desc_type = APR_POLL_SOCKET; ++ pfd.desc.s = c->aprsock; ++ pfd.client_data = c; ++ ++ if (old_reqevents != 0) { ++ pfd.reqevents = old_reqevents; ++ rv = apr_pollset_remove(readbits, &pfd); ++ if (rv != APR_SUCCESS) { ++ apr_err("apr_pollset_remove()", rv); ++ } ++ } ++ ++ if (new_reqevents != 0) { ++ pfd.reqevents = new_reqevents; ++ rv = apr_pollset_add(readbits, &pfd); ++ if (rv != APR_SUCCESS) { ++ apr_err("apr_pollset_add()", rv); ++ exit(1); ++ } ++ } ++ ++ c->reqevents = new_reqevents; ++ } ++} ++ ++static void set_conn_state(struct connection *c, connect_state_e new_state) ++{ ++ apr_int16_t events_by_state[] = { ++ 0, /* for STATE_UNCONNECTED */ ++ APR_POLLOUT, /* for STATE_CONNECTING */ ++ APR_POLLIN, /* for STATE_CONNECTED; we don't poll in this state, ++ * so prepare for polling in the following state -- ++ * STATE_READ ++ */ ++ APR_POLLIN /* for STATE_READ */ ++ }; ++ ++ c->state = new_state; ++ ++ set_polled_events(c, events_by_state[new_state]); ++} ++ + /* --------------------------------------------------------- */ + /* write out request to a connection - assumes we can write + * (small) request out in one go into our new socket buffer +@@ -556,7 +612,6 @@ + + while (do_next) { + int ret, ecode; +- apr_pollfd_t new_pollfd; + + ret = SSL_do_handshake(c->ssl); + ecode = SSL_get_error(c->ssl, ret); +@@ -588,11 +643,7 @@ + do_next = 0; + break; + case SSL_ERROR_WANT_READ: +- new_pollfd.desc_type = APR_POLL_SOCKET; +- new_pollfd.reqevents = APR_POLLIN; +- new_pollfd.desc.s = c->aprsock; +- new_pollfd.client_data = c; +- apr_pollset_add(readbits, &new_pollfd); ++ set_polled_events(c, APR_POLLIN); + do_next = 0; + break; + case SSL_ERROR_WANT_WRITE: +@@ -668,16 +719,8 @@ + c->rwrite -= l; + } while (c->rwrite); + +- c->state = STATE_READ; + c->endwrite = lasttime = apr_time_now(); +- { +- apr_pollfd_t new_pollfd; +- new_pollfd.desc_type = APR_POLL_SOCKET; +- new_pollfd.reqevents = APR_POLLIN; +- new_pollfd.desc.s = c->aprsock; +- new_pollfd.client_data = c; +- apr_pollset_add(readbits, &new_pollfd); +- } ++ set_conn_state(c, STATE_READ); + } + + /* --------------------------------------------------------- */ +@@ -1191,21 +1234,12 @@ + #endif + if ((rv = apr_socket_connect(c->aprsock, destsa)) != APR_SUCCESS) { + if (APR_STATUS_IS_EINPROGRESS(rv)) { +- apr_pollfd_t new_pollfd; +- c->state = STATE_CONNECTING; ++ set_conn_state(c, STATE_CONNECTING); + c->rwrite = 0; +- new_pollfd.desc_type = APR_POLL_SOCKET; +- new_pollfd.reqevents = APR_POLLOUT; +- new_pollfd.desc.s = c->aprsock; +- new_pollfd.client_data = c; +- apr_pollset_add(readbits, &new_pollfd); + return; + } + else { +- apr_pollfd_t remove_pollfd; +- remove_pollfd.desc_type = APR_POLL_SOCKET; +- remove_pollfd.desc.s = c->aprsock; +- apr_pollset_remove(readbits, &remove_pollfd); ++ set_conn_state(c, STATE_UNCONNECTED); + apr_socket_close(c->aprsock); + err_conn++; + if (bad++ > 10) { +@@ -1213,14 +1247,14 @@ + "\nTest aborted after 10 failures\n\n"); + apr_err("apr_socket_connect()", rv); + } +- c->state = STATE_UNCONNECTED; ++ + start_connect(c); + return; + } + } + + /* connected first time */ +- c->state = STATE_CONNECTED; ++ set_conn_state(c, STATE_CONNECTED); /* will this waste a pollset call? */ + started++; + #ifdef USE_SSL + if (c->ssl) { +@@ -1269,21 +1303,15 @@ + } + } + +- { +- apr_pollfd_t remove_pollfd; +- remove_pollfd.desc_type = APR_POLL_SOCKET; +- remove_pollfd.desc.s = c->aprsock; +- apr_pollset_remove(readbits, &remove_pollfd); ++ set_conn_state(c, STATE_UNCONNECTED); + #ifdef USE_SSL +- if (c->ssl) { +- SSL_shutdown(c->ssl); +- SSL_free(c->ssl); +- c->ssl = NULL; +- } +-#endif +- apr_socket_close(c->aprsock); ++ if (c->ssl) { ++ SSL_shutdown(c->ssl); ++ SSL_free(c->ssl); ++ c->ssl = NULL; + } +- c->state = STATE_UNCONNECTED; ++#endif ++ apr_socket_close(c->aprsock); + + /* connect again */ + start_connect(c); +@@ -1401,10 +1429,7 @@ + } + else { + /* header is in invalid or too big - close connection */ +- apr_pollfd_t remove_pollfd; +- remove_pollfd.desc_type = APR_POLL_SOCKET; +- remove_pollfd.desc.s = c->aprsock; +- apr_pollset_remove(readbits, &remove_pollfd); ++ set_conn_state(c, STATE_UNCONNECTED); + apr_socket_close(c->aprsock); + err_response++; + if (bad++ > 10) { +@@ -1727,11 +1752,7 @@ + } + if (rv & APR_POLLOUT) { + if (c->state == STATE_CONNECTING) { +- apr_pollfd_t remove_pollfd; + rv = apr_socket_connect(c->aprsock, destsa); +- remove_pollfd.desc_type = APR_POLL_SOCKET; +- remove_pollfd.desc.s = c->aprsock; +- apr_pollset_remove(readbits, &remove_pollfd); + if (rv != APR_SUCCESS) { + apr_socket_close(c->aprsock); + err_conn++; +@@ -1740,12 +1761,12 @@ + "\nTest aborted after 10 failures\n\n"); + apr_err("apr_socket_connect()", rv); + } +- c->state = STATE_UNCONNECTED; ++ set_conn_state(c, STATE_UNCONNECTED); + start_connect(c); + continue; + } + else { +- c->state = STATE_CONNECTED; ++ set_conn_state(c, STATE_CONNECTED); + started++; + #ifdef USE_SSL + if (c->ssl) +@@ -1759,22 +1780,6 @@ + write_request(c); + } + } +- +- /* +- * When using a select based poll every time we check the bits +- * are reset. In 1.3's ab we copied the FD_SET's each time +- * through, but here we're going to check the state and if the +- * connection is in STATE_READ or STATE_CONNECTING we'll add the +- * socket back in as APR_POLLIN. +- */ +- if (c->state == STATE_READ) { +- apr_pollfd_t new_pollfd; +- new_pollfd.desc_type = APR_POLL_SOCKET; +- new_pollfd.reqevents = APR_POLLIN; +- new_pollfd.desc.s = c->aprsock; +- new_pollfd.client_data = c; +- apr_pollset_add(readbits, &new_pollfd); +- } + } + } while (lasttime < stoptime && done < requests); +