diff options
author | mm <mm@FreeBSD.org> | 2013-07-21 19:17:23 +0800 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2013-07-21 19:17:23 +0800 |
commit | d553979203398ac601c3724956205e93098d9d4c (patch) | |
tree | 91cb0e57a00b4551dc992b5d3fe7bc92e4ff7f8d | |
parent | e17812497a5f1a677aff8391fe189ea9ab78695f (diff) | |
download | freebsd-ports-gnome-d553979203398ac601c3724956205e93098d9d4c.tar.gz freebsd-ports-gnome-d553979203398ac601c3724956205e93098d9d4c.tar.zst freebsd-ports-gnome-d553979203398ac601c3724956205e93098d9d4c.zip |
Update libevent-hiphop to support hiphop-php 2.1
-rw-r--r-- | devel/libevent-hiphop/Makefile | 1 | ||||
-rw-r--r-- | devel/libevent-hiphop/files/extra-patch-hiphop | 208 | ||||
-rw-r--r-- | devel/libevent/Makefile | 2 |
3 files changed, 67 insertions, 144 deletions
diff --git a/devel/libevent-hiphop/Makefile b/devel/libevent-hiphop/Makefile index 8a932fa48cbf..9db6fa51b137 100644 --- a/devel/libevent-hiphop/Makefile +++ b/devel/libevent-hiphop/Makefile @@ -6,6 +6,7 @@ # PKGNAMESUFFIX= -hiphop +PORTREVISION= 3 MAINTAINER= mm@FreeBSD.org COMMENT= Static libevent with custom patches for HipHop diff --git a/devel/libevent-hiphop/files/extra-patch-hiphop b/devel/libevent-hiphop/files/extra-patch-hiphop index 639575407f11..ce6e4d9d663c 100644 --- a/devel/libevent-hiphop/files/extra-patch-hiphop +++ b/devel/libevent-hiphop/files/extra-patch-hiphop @@ -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/event.c event.c #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/event.c event.c 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/event.c event.c 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/event.c event.c 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/evhttp.h evhttp.h * 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/evhttp.h evhttp.h * 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/evhttp.h evhttp.h + */ +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/evhttp.h evhttp.h /* 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/evhttp.h evhttp.h 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/evhttp.h evhttp.h 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/http-internal.h http-internal.h 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/http.c http.c #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/http.c http.c /* * 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/http.c http.c /* 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/http.c http.c 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/http.c http.c 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/http.c http.c 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/http.c http.c } 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/http.c http.c } 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/http.c http.c 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/http.c http.c 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/http.c http.c 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/http.c http.c { 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/http.c http.c 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/http.c http.c 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/http.c http.c 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/http.c http.c 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/http.c http.c + 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/http.c http.c /* * Network helper functions that we do not want to export to the rest of - * the world. - */ diff --git a/devel/libevent/Makefile b/devel/libevent/Makefile index f3278caec3bc..3464149c3233 100644 --- a/devel/libevent/Makefile +++ b/devel/libevent/Makefile @@ -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 |