From owner-svn-ports-branches@freebsd.org Sat Aug 6 06:50:10 2016 Return-Path: Delivered-To: svn-ports-branches@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B60BB0EE1; Sat, 6 Aug 2016 06:50:10 +0000 (UTC) (envelope-from ohauer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B21A179C; Sat, 6 Aug 2016 06:50:10 +0000 (UTC) (envelope-from ohauer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u766o91Q063480; Sat, 6 Aug 2016 06:50:09 GMT (envelope-from ohauer@FreeBSD.org) Received: (from ohauer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u766o95C063478; Sat, 6 Aug 2016 06:50:09 GMT (envelope-from ohauer@FreeBSD.org) Message-Id: <201608060650.u766o95C063478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ohauer set sender to ohauer@FreeBSD.org using -f From: Olli Hauer Date: Sat, 6 Aug 2016 06:50:09 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r419731 - in branches/2016Q3/devel/apr1: . files X-SVN-Group: ports-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-branches@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the branches of the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2016 06:50:10 -0000 Author: ohauer Date: Sat Aug 6 06:50:09 2016 New Revision: 419731 URL: https://svnweb.freebsd.org/changeset/ports/419731 Log: MFH: r419646 - add patch to modify apr1 poll() emulation to match behavior expected by serf serf depends on the poll emulation in apr returning a POLLERR event if a non-blocking connect() attempt fails in order to trigger an IPv6 -> IPv4 fallback, or a fallback to another address for a multi-homed host. On FreeBSD, the poll emulation is done using kqueue, and the result returned by the poll() emulation is POLLIN + POLLHUP. - upstream apache PR: https://bz.apache.org/bugzilla/show_bug.cgi?id=59914 PR: 211430 Submitted by: Don Lewis (truckman@) Approved by: ports-secteam (junovitch) Added: branches/2016Q3/devel/apr1/files/patch-apr_poll_unix_kqueue.c - copied unchanged from r419646, head/devel/apr1/files/patch-apr_poll_unix_kqueue.c Modified: branches/2016Q3/devel/apr1/Makefile Directory Properties: branches/2016Q3/ (props changed) Modified: branches/2016Q3/devel/apr1/Makefile ============================================================================== --- branches/2016Q3/devel/apr1/Makefile Sat Aug 6 03:48:52 2016 (r419730) +++ branches/2016Q3/devel/apr1/Makefile Sat Aug 6 06:50:09 2016 (r419731) @@ -3,6 +3,7 @@ PORTNAME= apr PORTVERSION= ${APR_VERSION}.${APU_VERSION} +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= APACHE/apr DISTFILES= apr-${APR_VERSION}.tar.gz \ @@ -40,7 +41,7 @@ NSS_DESC= NSS crypto driver SSL_DESC= OpenSSL crypto driver # APR-Util Options -BDB_USE= BDB=5+ +BDB_USES= bdb:5+ FREETDS_LIB_DEPENDS= libsybdb.so:databases/freetds GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm LDAP_USE= OPENLDAP=yes @@ -48,7 +49,7 @@ MYSQL_USE= MYSQL=yes NSS_LIB_DEPENDS= libnss3.so:security/nss PGSQL_USES= pgsql SQLITE_USES= sqlite -SSL_USE= OPENSSL=yes +SSL_USES= ssl APR_WRKDIR= ${WRKDIR}/apr-${APR_VERSION} APU_WRKDIR= ${WRKDIR}/apr-util-${APU_VERSION} @@ -204,7 +205,6 @@ do-install: @${ECHO_MSG} "# ===> ${.TARGET} apr-util-${APU_VERSION}" (cd ${APU_WRKDIR} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${INSTALL_TARGET} ${MAKE_ARGS}) -post-install: -${FIND} ${STAGEDIR}${PREFIX}/lib/ -name \*.so | ${XARGS} ${STRIP_CMD} test: build Copied: branches/2016Q3/devel/apr1/files/patch-apr_poll_unix_kqueue.c (from r419646, head/devel/apr1/files/patch-apr_poll_unix_kqueue.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q3/devel/apr1/files/patch-apr_poll_unix_kqueue.c Sat Aug 6 06:50:09 2016 (r419731, copy of r419646, head/devel/apr1/files/patch-apr_poll_unix_kqueue.c) @@ -0,0 +1,77 @@ +# upstram PR: https://bz.apache.org/bugzilla/show_bug.cgi?id=59914 +# FreeBSD PR: 211430 +======================================================================== +--- apr-1.5.2/poll/unix/kqueue.c.orig 2015-03-20 01:34:07 UTC ++++ apr-1.5.2/poll/unix/kqueue.c +@@ -25,21 +25,40 @@ + + #ifdef HAVE_KQUEUE + +-static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) ++static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags, ++ int fflags, intptr_t data) + { + apr_int16_t rv = 0; + +- if (event == EVFILT_READ) +- rv |= APR_POLLIN; +- else if (event == EVFILT_WRITE) +- rv |= APR_POLLOUT; +- if (flags & EV_EOF) +- rv |= APR_POLLHUP; +- /* APR_POLLPRI, APR_POLLERR, and APR_POLLNVAL are not handled by this +- * implementation. ++ /* APR_POLLPRI and APR_POLLNVAL are not handled by this implementation. + * TODO: See if EV_ERROR + certain system errors in the returned data field + * should map to APR_POLLNVAL. + */ ++ if (event == EVFILT_READ) { ++ if (data > 0 || fflags == 0) ++ rv |= APR_POLLIN; ++ else ++ rv |= APR_POLLERR; ++ /* ++ * Don't return POLLHUP if connect fails. Apparently Linux ++ * does not, and this is expected by serf in order for IPv6 to ++ * IPv4 or multihomed host fallback to work. ++ * ++ * ETIMEDOUT is ambiguous here since we don't know if a ++ * connection was established. We don't want to return ++ * POLLHUP here if the connection attempt timed out, but ++ * we do if the connection was successful but later dropped. ++ * For now, favor the latter. ++ */ ++ if ((flags & EV_EOF) != 0 && fflags != ECONNREFUSED && ++ fflags != ENETUNREACH && fflags != EHOSTUNREACH) ++ rv |= APR_POLLHUP; ++ } else if (event == EVFILT_WRITE) { ++ if (data > 0 || fflags == 0) ++ rv |= APR_POLLOUT; ++ else ++ rv |= APR_POLLERR; ++ } + return rv; + } + +@@ -290,7 +309,9 @@ static apr_status_t impl_pollset_poll(ap + pollset->p->result_set[j] = fd; + pollset->p->result_set[j].rtnevents = + get_kqueue_revent(pollset->p->ke_set[i].filter, +- pollset->p->ke_set[i].flags); ++ pollset->p->ke_set[i].flags, ++ pollset->p->ke_set[i].fflags, ++ pollset->p->ke_set[i].data); + j++; + } + } +@@ -471,7 +492,9 @@ static apr_status_t impl_pollcb_poll(apr + apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.ke[i].udata); + + pollfd->rtnevents = get_kqueue_revent(pollcb->pollset.ke[i].filter, +- pollcb->pollset.ke[i].flags); ++ pollcb->pollset.ke[i].flags, ++ pollcb->pollset.ke[i].fflags, ++ pollcb->pollset.ke[i].data); + + rv = func(baton, pollfd); +