From owner-svn-ports-all@FreeBSD.ORG Sun Jul 21 11:17:24 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AF8422D9; Sun, 21 Jul 2013 11:17:24 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 92A462EA; Sun, 21 Jul 2013 11:17:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LBHO7p090062; Sun, 21 Jul 2013 11:17:24 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LBHO7r090059; Sun, 21 Jul 2013 11:17:24 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307211117.r6LBHO7r090059@svn.freebsd.org> From: Martin Matuska Date: Sun, 21 Jul 2013 11:17:24 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r323374 - in head/devel: libevent libevent-hiphop libevent-hiphop/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 11:17:24 -0000 Author: mm Date: Sun Jul 21 11:17:23 2013 New Revision: 323374 URL: http://svnweb.freebsd.org/changeset/ports/323374 Log: Update libevent-hiphop to support hiphop-php 2.1 Modified: head/devel/libevent-hiphop/Makefile head/devel/libevent-hiphop/files/extra-patch-hiphop head/devel/libevent/Makefile Modified: head/devel/libevent-hiphop/Makefile ============================================================================== --- head/devel/libevent-hiphop/Makefile Sun Jul 21 11:17:02 2013 (r323373) +++ head/devel/libevent-hiphop/Makefile Sun Jul 21 11:17:23 2013 (r323374) @@ -6,6 +6,7 @@ # PKGNAMESUFFIX= -hiphop +PORTREVISION= 3 MAINTAINER= mm@FreeBSD.org COMMENT= Static libevent with custom patches for HipHop Modified: head/devel/libevent-hiphop/files/extra-patch-hiphop ============================================================================== --- head/devel/libevent-hiphop/files/extra-patch-hiphop Sun Jul 21 11:17:02 2013 (r323373) +++ head/devel/libevent-hiphop/files/extra-patch-hiphop Sun Jul 21 11:17:23 2013 (r323374) @@ -1,9 +1,19 @@ -diff -rp -U 5 libevent-1.4.14-stable/event.c event.c ---- libevent-1.4.14-stable/event.c 2010-06-07 14:40:35.000000000 -0700 -+++ event.c 2010-06-18 16:30:57.000000000 -0700 -@@ -136,14 +136,16 @@ detect_monotonic(void) - } - +diff -Naur libevent-1.4.14b-stable.orig/configure.in libevent-1.4.14b-stable/configure.in +--- libevent-1.4.14b-stable.orig/configure.in 2013-07-21 13:11:09.912418409 +0200 ++++ configure.in 2013-07-21 13:11:22.891418321 +0200 +@@ -3,7 +3,7 @@ + AC_INIT(event.c) + + AM_INIT_AUTOMAKE(libevent,1.4.14b-stable) +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADERS(config.h) + dnl AM_MAINTAINER_MODE + + AC_CANONICAL_HOST +diff -Naur libevent-1.4.14b-stable.orig/event.c libevent-1.4.14b-stable/event.c +--- libevent-1.4.14b-stable.orig/event.c 2013-07-21 13:11:09.910418559 +0200 ++++ event.c 2013-07-21 13:11:22.891418321 +0200 +@@ -138,10 +138,12 @@ static int gettime(struct event_base *base, struct timeval *tp) { @@ -16,11 +26,7 @@ diff -rp -U 5 libevent-1.4.14-stable/eve #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) if (use_monotonic) { - struct timespec ts; - -@@ -479,11 +481,11 @@ event_base_loop(struct event_base *base, - struct timeval tv; - struct timeval *tv_p; +@@ -481,7 +483,7 @@ int res, done; /* clear time cache */ @@ -29,11 +35,7 @@ diff -rp -U 5 libevent-1.4.14-stable/eve if (base->sig.ev_signal_added) evsignal_base = base; - done = 0; - while (!done) { -@@ -531,17 +533,17 @@ event_base_loop(struct event_base *base, - - /* update last old time */ +@@ -533,13 +535,13 @@ gettime(base, &base->event_tv); /* clear time cache */ @@ -49,11 +51,7 @@ diff -rp -U 5 libevent-1.4.14-stable/eve timeout_process(base); - if (base->event_count_active) { - event_process_active(base); -@@ -550,11 +552,11 @@ event_base_loop(struct event_base *base, - } else if (flags & EVLOOP_NONBLOCK) - done = 1; +@@ -552,7 +554,7 @@ } /* clear time cache */ @@ -62,15 +60,10 @@ diff -rp -U 5 libevent-1.4.14-stable/eve event_debug(("%s: asked to terminate loop.", __func__)); return (0); - } - -Only in libevent-1.4.14-stable-fb: event.c.orig -diff -rp -U 5 libevent-1.4.14-stable/evhttp.h evhttp.h ---- libevent-1.4.14-stable/evhttp.h 2010-06-07 14:40:35.000000000 -0700 -+++ evhttp.h 2010-06-18 16:36:24.000000000 -0700 -@@ -79,16 +79,54 @@ struct evhttp *evhttp_new(struct event_b - * to multiple different ports. - * +diff -Naur libevent-1.4.14b-stable.orig/evhttp.h libevent-1.4.14b-stable/evhttp.h +--- libevent-1.4.14b-stable.orig/evhttp.h 2013-07-21 13:11:09.911418522 +0200 ++++ evhttp.h 2013-07-21 13:11:22.892439129 +0200 +@@ -81,12 +81,50 @@ * @param http a pointer to an evhttp object * @param address a string containing the IP address to listen(2) on * @param port the port number to listen on @@ -122,11 +115,7 @@ diff -rp -U 5 libevent-1.4.14-stable/evh * Makes an HTTP server accept connections on the specified socket * * This may be useful to create a socket and then fork multiple instances - * of an http server, or when a socket has been communicated via file - * descriptor passing in situations where an http servers does not have -@@ -103,10 +141,25 @@ int evhttp_bind_socket(struct evhttp *ht - * @see evhttp_free(), evhttp_bind_socket() - */ +@@ -105,6 +143,21 @@ int evhttp_accept_socket(struct evhttp *http, int fd); /** @@ -148,11 +137,7 @@ diff -rp -U 5 libevent-1.4.14-stable/evh * Free the previously created HTTP server. * * Works only if no requests are currently being served. - * - * @param http the evhttp server object to be freed -@@ -132,10 +185,25 @@ void evhttp_set_gencb(struct evhttp *, - * @param http an evhttp object - * @param timeout_in_secs the timeout, in seconds +@@ -134,6 +187,28 @@ */ void evhttp_set_timeout(struct evhttp *, int timeout_in_secs); @@ -171,14 +156,17 @@ diff -rp -U 5 libevent-1.4.14-stable/evh + */ +int evhttp_get_connection_limit(struct evhttp *http); + ++/** ++ * Return the number of connections in this instance. ++ * ++ * @param http an evhttp object ++ */ ++int evhttp_get_connection_count(struct evhttp *http); ++ /* Request/Response functionality */ /** - * Send an HTML error message to the client. - * -@@ -155,10 +223,23 @@ void evhttp_send_error(struct evhttp_req - * @param databuf the body of the response - */ +@@ -157,6 +232,19 @@ void evhttp_send_reply(struct evhttp_request *req, int code, const char *reason, struct evbuffer *databuf); @@ -198,11 +186,7 @@ diff -rp -U 5 libevent-1.4.14-stable/evh /* Low-level response interface, for streaming/chunked replies */ void evhttp_send_reply_start(struct evhttp_request *, int, const char *); void evhttp_send_reply_chunk(struct evhttp_request *, struct evbuffer *); - void evhttp_send_reply_end(struct evhttp_request *); - -@@ -208,10 +289,11 @@ struct { - char *remote_host; - u_short remote_port; +@@ -210,6 +298,7 @@ enum evhttp_request_kind kind; enum evhttp_cmd_type type; @@ -210,11 +194,7 @@ diff -rp -U 5 libevent-1.4.14-stable/evh char *uri; /* uri after HTTP request was parsed */ - char major; /* HTTP Major number */ - char minor; /* HTTP Minor number */ -@@ -222,10 +304,12 @@ struct { - struct evbuffer *input_buffer; /* read data */ - ev_int64_t ntoread; +@@ -224,6 +313,8 @@ int chunked:1, /* a chunked request */ userdone:1; /* the user has sent all data */ @@ -223,14 +203,10 @@ diff -rp -U 5 libevent-1.4.14-stable/evh struct evbuffer *output_buffer; /* outgoing post or data */ /* Callback */ - void (*cb)(struct evhttp_request *, void *); - void *cb_arg; -diff -rp -U 5 libevent-1.4.14-stable/http-internal.h http-internal.h ---- libevent-1.4.14-stable/http-internal.h 2010-06-07 14:40:35.000000000 -0700 -+++ http-internal.h 2010-06-18 16:30:57.000000000 -0700 -@@ -114,10 +114,13 @@ struct evhttp { - TAILQ_HEAD(boundq, evhttp_bound_socket) sockets; - +diff -Naur libevent-1.4.14b-stable.orig/http-internal.h libevent-1.4.14b-stable/http-internal.h +--- libevent-1.4.14b-stable.orig/http-internal.h 2013-07-21 13:11:09.910418559 +0200 ++++ http-internal.h 2013-07-21 13:11:22.892439129 +0200 +@@ -116,6 +116,9 @@ TAILQ_HEAD(httpcbq, evhttp_cb) callbacks; struct evconq connections; @@ -240,14 +216,10 @@ diff -rp -U 5 libevent-1.4.14-stable/htt int timeout; void (*gencb)(struct evhttp_request *req, void *); - void *gencbarg; - -diff -rp -U 5 libevent-1.4.14-stable/http.c http.c ---- libevent-1.4.14-stable/http.c 2010-06-07 14:40:35.000000000 -0700 -+++ http.c 2010-06-18 16:35:23.000000000 -0700 -@@ -217,10 +217,17 @@ static int evhttp_decode_uri_internal(co - char *ret, int always_decode_plus); - +diff -Naur libevent-1.4.14b-stable.orig/http.c libevent-1.4.14b-stable/http.c +--- libevent-1.4.14b-stable.orig/http.c 2013-07-21 13:11:09.911418522 +0200 ++++ http.c 2013-07-21 13:11:22.894418945 +0200 +@@ -219,6 +219,13 @@ void evhttp_read(int, short, void *); void evhttp_write(int, short, void *); @@ -261,11 +233,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt #ifndef HAVE_STRSEP /* strsep replacement for platforms that lack it. Only works if * del is one character long. */ - static char * - strsep(char **s, const char *del) -@@ -476,21 +483,19 @@ evhttp_make_header_response(struct evhtt - */ - if (req->minor == 0 && is_keepalive) +@@ -478,7 +485,6 @@ evhttp_add_header(req->output_headers, "Connection", "keep-alive"); @@ -273,9 +241,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt /* * we need to add the content length if the * user did not give it, this is required for - * persistent connections to work. - */ - evhttp_maybe_add_content_length_header( +@@ -488,7 +494,6 @@ req->output_headers, (long)EVBUFFER_LENGTH(req->output_buffer)); } @@ -283,11 +249,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt /* Potentially add headers for unidentified content. */ if (EVBUFFER_LENGTH(req->output_buffer)) { - if (evhttp_find_header(req->output_headers, - "Content-Type") == NULL) { -@@ -685,18 +690,18 @@ evhttp_connection_fail(struct evhttp_con - - void +@@ -687,14 +692,14 @@ evhttp_write(int fd, short what, void *arg) { struct evhttp_connection *evcon = arg; @@ -304,11 +266,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt if (n == -1) { event_debug(("%s: evbuffer_write", __func__)); evhttp_connection_fail(evcon, EVCON_HTTP_EOF); - return; - } -@@ -704,10 +709,11 @@ evhttp_write(int fd, short what, void *a - if (n == 0) { - event_debug(("%s: write nothing", __func__)); +@@ -706,6 +711,7 @@ evhttp_connection_fail(evcon, EVCON_HTTP_EOF); return; } @@ -316,11 +274,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt if (EVBUFFER_LENGTH(evcon->output_buffer) != 0) { evhttp_add_event(&evcon->ev, - evcon->timeout, HTTP_WRITE_TIMEOUT); - return; -@@ -1010,15 +1016,13 @@ evhttp_connection_free(struct evhttp_con - */ - while ((req = TAILQ_FIRST(&evcon->requests)) != NULL) { +@@ -1012,11 +1018,9 @@ TAILQ_REMOVE(&evcon->requests, req, next); evhttp_request_free(req); } @@ -335,11 +289,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt if (event_initialized(&evcon->close_ev)) event_del(&evcon->close_ev); - - if (event_initialized(&evcon->ev)) -@@ -1099,14 +1103,20 @@ evhttp_connection_reset(struct evhttp_co - EVUTIL_CLOSESOCKET(evcon->fd); - evcon->fd = -1; +@@ -1101,10 +1105,16 @@ } evcon->state = EVCON_DISCONNECTED; @@ -360,11 +310,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt } static void - evhttp_detect_close_cb(int fd, short what, void *arg) - { -@@ -1276,23 +1286,56 @@ evhttp_parse_request_line(struct evhttp_ - /* Parse the request line */ - method = strsep(&line, " "); +@@ -1278,19 +1288,52 @@ if (line == NULL) return (-1); uri = strsep(&line, " "); @@ -419,11 +365,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt } else { event_debug(("%s: bad method %s on request %p from %s", __func__, method, req, req->remote_host)); - return (-1); - } -@@ -1961,14 +2004,48 @@ evhttp_send_reply(struct evhttp_request - evhttp_response_code(req, code, reason); - +@@ -1963,10 +2006,44 @@ evhttp_send(req, databuf); } @@ -468,11 +410,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt evhttp_response_code(req, code, reason); if (req->major == 1 && req->minor == 1) { /* use chunked encoding for HTTP/1.1 */ - evhttp_add_header(req->output_headers, "Transfer-Encoding", - "chunked"); -@@ -1984,10 +2061,12 @@ evhttp_send_reply_chunk(struct evhttp_re - struct evhttp_connection *evcon = req->evcon; - +@@ -1986,6 +2063,8 @@ if (evcon == NULL) return; @@ -481,11 +419,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt if (req->chunked) { evbuffer_add_printf(evcon->output_buffer, "%x\r\n", (unsigned)EVBUFFER_LENGTH(databuf)); - } - evbuffer_add_buffer(evcon->output_buffer, databuf); -@@ -2005,11 +2084,18 @@ evhttp_send_reply_end(struct evhttp_requ - if (evcon == NULL) { - evhttp_request_free(req); +@@ -2007,7 +2086,14 @@ return; } @@ -501,11 +435,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt req->userdone = 1; if (req->chunked) { - evbuffer_add(req->evcon->output_buffer, "0\r\n\r\n", 5); - evhttp_write_buffer(req->evcon, evhttp_send_done, NULL); -@@ -2291,33 +2377,63 @@ accept_socket(int fd, short what, void * - - evhttp_get_request(http, nfd, (struct sockaddr *)&ss, addrlen); +@@ -2293,7 +2379,8 @@ } int @@ -515,7 +445,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt { int fd; int res; - +@@ -2301,7 +2388,7 @@ if ((fd = bind_socket(address, port, 1 /*reuse*/)) == -1) return (-1); @@ -524,7 +454,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt event_warn("%s: listen", __func__); EVUTIL_CLOSESOCKET(fd); return (-1); - } +@@ -2309,13 +2396,42 @@ res = evhttp_accept_socket(http, fd); @@ -568,11 +498,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt int evhttp_accept_socket(struct evhttp *http, int fd) { - struct evhttp_bound_socket *bound; - struct event *ev; -@@ -2343,10 +2459,29 @@ evhttp_accept_socket(struct evhttp *http - TAILQ_INSERT_TAIL(&http->sockets, bound, next); - +@@ -2345,6 +2461,25 @@ return (0); } @@ -598,11 +524,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt static struct evhttp* evhttp_new_object(void) { - struct evhttp *http = NULL; - -@@ -2525,10 +2660,15 @@ evhttp_request_new(void (*cb)(struct evh - } - +@@ -2527,6 +2662,11 @@ void evhttp_request_free(struct evhttp_request *req) { @@ -614,11 +536,7 @@ diff -rp -U 5 libevent-1.4.14-stable/htt if (req->remote_host != NULL) free(req->remote_host); if (req->uri != NULL) - free(req->uri); - if (req->response_code_line != NULL) -@@ -2655,17 +2795,76 @@ evhttp_get_request(struct evhttp *http, - - /* +@@ -2657,13 +2797,78 @@ * if we want to accept more than one request on a connection, * we need to know which http server it belongs to. */ @@ -663,6 +581,12 @@ diff -rp -U 5 libevent-1.4.14-stable/htt + return olimit; +} + ++int ++evhttp_get_connection_count(struct evhttp *http) ++{ ++ return http != NULL ? http->connection_count : 0; ++} ++ +void +evhttp_server_add_connection(struct evhttp *http, + struct evhttp_connection *evcon) @@ -693,5 +617,3 @@ diff -rp -U 5 libevent-1.4.14-stable/htt /* * Network helper functions that we do not want to export to the rest of - * the world. - */ Modified: head/devel/libevent/Makefile ============================================================================== --- head/devel/libevent/Makefile Sun Jul 21 11:17:02 2013 (r323373) +++ head/devel/libevent/Makefile Sun Jul 21 11:17:23 2013 (r323374) @@ -7,7 +7,7 @@ PORTNAME= libevent PORTVERSION= 1.4.14b -PORTREVISION= 2 +PORTREVISION?= 2 CATEGORIES= devel MASTER_SITES= http://monkey.org/~provos/ DISTNAME= ${PORTNAME}-${DISTVERSION}-stable