You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(9) |
Sep
(48) |
Oct
(11) |
Nov
(101) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(2) |
Feb
(53) |
Mar
(18) |
Apr
(53) |
May
(91) |
Jun
(50) |
Jul
(33) |
Aug
(6) |
Sep
(10) |
Oct
(3) |
Nov
(12) |
Dec
(23) |
2009 |
Jan
(106) |
Feb
(37) |
Mar
(5) |
Apr
(133) |
May
(61) |
Jun
(10) |
Jul
(72) |
Aug
(21) |
Sep
(12) |
Oct
(46) |
Nov
(89) |
Dec
(44) |
2010 |
Jan
(56) |
Feb
(59) |
Mar
(52) |
Apr
(49) |
May
(57) |
Jun
(17) |
Jul
(21) |
Aug
(47) |
Sep
(54) |
Oct
(72) |
Nov
(81) |
Dec
(27) |
2011 |
Jan
(42) |
Feb
(61) |
Mar
(21) |
Apr
(65) |
May
(77) |
Jun
(38) |
Jul
(42) |
Aug
(73) |
Sep
(20) |
Oct
(44) |
Nov
(49) |
Dec
(24) |
2012 |
Jan
(48) |
Feb
(91) |
Mar
(50) |
Apr
(49) |
May
(34) |
Jun
(31) |
Jul
(46) |
Aug
(29) |
Sep
(8) |
Oct
(10) |
Nov
(58) |
Dec
(8) |
From: Nick M. <ni...@us...> - 2012-11-18 06:41:06
|
Author: Nick Mathewson <ni...@to...> Date: Sun, 18 Nov 2012 01:39:10 -0500 Subject: Increment libtool version for 2.0.21 too Commit: 64177777165d9684bafbfa946abd126f7ebff11f --- Makefile.am | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/Makefile.am b/Makefile.am index a08e3e1..42879a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,7 +38,7 @@ RELEASE = -release 2.0 # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 6:8:1 +VERSION_INFO = 6:9:1 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -61,6 +61,7 @@ VERSION_INFO = 6:8:1 # 2.0.18-stable-- 2.0 6:6:1 (No ABI change) # 2.0.19-stable-- 2.0 6:7:1 (No ABI change) # 2.0.20-stable-- 2.0 6:8:1 (No ABI change) +# 2.0.21-stable-- 2.0 6:9:1 (No ABI change) # # For Libevent 2.1: # 2.1.1-alpha -- 2.1 1:0:0 -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-18 06:40:09
|
Author: Nick Mathewson <ni...@to...> Date: Sun, 18 Nov 2012 01:38:07 -0500 Subject: Increment version to 2.0.21-stable Commit: 0ee10fdfee3a9f438e95efb915e4e1a4df2f4bd5 --- WIN32-Code/event2/event-config.h | 4 ++-- configure.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WIN32-Code/event2/event-config.h b/WIN32-Code/event2/event-config.h index ed11769..9d085c4 100644 --- a/WIN32-Code/event2/event-config.h +++ b/WIN32-Code/event2/event-config.h @@ -277,7 +277,7 @@ /* #undef _EVENT_HAVE_WORKING_KQUEUE */ /* Numeric representation of the version */ -#define _EVENT_NUMERIC_VERSION 0x02001401 +#define _EVENT_NUMERIC_VERSION 0x02001500 /* Name of package */ #define _EVENT_PACKAGE "libevent" @@ -334,7 +334,7 @@ #define _EVENT_TIME_WITH_SYS_TIME 1 /* Version number of package */ -#define _EVENT_VERSION "2.0.20-stable-dev" +#define _EVENT_VERSION "2.0.21-stable" /* Define to appropriate substitue if compiler doesnt have __func__ */ #define _EVENT___func__ __FUNCTION__ diff --git a/configure.in b/configure.in index 5ecf5f4..18165f3 100644 --- a/configure.in +++ b/configure.in @@ -11,9 +11,9 @@ AC_INIT(event.c) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE(libevent,2.0.20-stable-dev) +AM_INIT_AUTOMAKE(libevent,2.0.21-stable) AM_CONFIG_HEADER(config.h) -AC_DEFINE(NUMERIC_VERSION, 0x02001401, [Numeric representation of the version]) +AC_DEFINE(NUMERIC_VERSION, 0x02001500, [Numeric representation of the version]) dnl Initialize prefix. if test "$prefix" = "NONE"; then -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-18 06:40:08
|
Author: Nick Mathewson <ni...@to...> Date: Sun, 18 Nov 2012 01:36:33 -0500 Subject: Changelog for 2.0.21-stable Commit: 1c5517c97c1331ee2ebb424c9a297536b377c26c --- ChangeLog | 16 +++++++++++++++- README | 4 ++++ 2 files changed, 19 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index c06ad86..eb6530d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,18 @@ -Changes in version 2.0.21-stable (?? ??? 2012) +Changes in version 2.0.21-stable (18 Nov 2012) +BUGFIXES: + o ssl: Don't discard SSL read event when timeout and read come close together (576b29f) + o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch) + o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch) + o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev) + o build: Use python2 rather than python (0eb0109 Ross Lagerwall) + o build: Compile without warnings on mingw64 (94866c2) + o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4) + o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4) + o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez) + o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3) + o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier) + o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086) + o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9) Changes in version 2.0.20-stable (23 Aug 2012) diff --git a/README b/README index 9f719ce..23b769f 100644 --- a/README +++ b/README @@ -92,7 +92,9 @@ fixing bugs: Shuo Chen Ka-Hing Cheung Andrew Cox + George Danchev Andrew Danforth + Antony Dovgal Ed Day Christopher Davis Mike Davis @@ -100,6 +102,7 @@ fixing bugs: Mark Ellzey Shie Erlich Leonid Evdokimov + Juan Pablo Fernandez Christophe Fillot Mike Frysinger Remi Gacogne @@ -154,6 +157,7 @@ fixing bugs: Dave Pacheco Tassilo von Parseval Catalin Patulea + Patrick Pelletier Simon Perreault Pierre Phaneuf Ryan Phillips -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-18 06:40:07
|
Author: Nick Mathewson <ni...@to...> Date: Sun, 18 Nov 2012 01:36:03 -0500 Subject: Make ssl version check in unit tests work Commit: f38e07886829bb4613d3fa08c06d65b2d18ae584 --- test/regress_ssl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/test/regress_ssl.c b/test/regress_ssl.c index 271a962..1ce5f6a 100644 --- a/test/regress_ssl.c +++ b/test/regress_ssl.c @@ -159,7 +159,7 @@ init_ssl(void) SSL_load_error_strings(); OpenSSL_add_all_algorithms(); if (SSLeay() != OPENSSL_VERSION_NUMBER) { - TT_DECLARE("WARN", ("Version mismatch for openssl: compiled with %lx but running with %lx", OPENSSL_VERSION_NUMBER, SSLeay())); + TT_DECLARE("WARN", ("Version mismatch for openssl: compiled with %lx but running with %lx", (unsigned long)OPENSSL_VERSION_NUMBER, (unsigned long)SSLeay())); } } -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 23:37:22
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 18:34:43 -0500 Subject: Make bufferevent_set_timeouts(bev, NULL, NULL) have plausible semantics Commit: 9dee36bc8b72be6c00089af857c1d119886c3ed7 --- bufferevent_openssl.c | 23 +++++++++++++++++------ bufferevent_sock.c | 19 ++++++++++++++----- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index 55173d9..99ed5f8 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -1221,14 +1221,25 @@ be_openssl_adj_timeouts(struct bufferevent *bev) { struct bufferevent_openssl *bev_ssl = upcast(bev); - if (bev_ssl->underlying) + if (bev_ssl->underlying) { return bufferevent_generic_adj_timeouts_(bev); - else { + } else { int r1=0, r2=0; - if (event_pending(&bev->ev_read, EV_READ, NULL)) - r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read); - if (event_pending(&bev->ev_write, EV_WRITE, NULL)) - r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write); + if (event_pending(&bev->ev_read, EV_READ, NULL)) { + if (evutil_timerisset(&bev->timeout_read)) { + r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read); + } else { + event_remove_timer(&bev->ev_read); + } + } + if (event_pending(&bev->ev_write, EV_WRITE, NULL)) { + if (evutil_timerisset(&bev->timeout_write)) { + r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write); + } else { + event_remove_timer(&bev->ev_write); + } + } + return (r1<0 || r2<0) ? -1 : 0; } } diff --git a/bufferevent_sock.c b/bufferevent_sock.c index eaaf941..5a85743 100644 --- a/bufferevent_sock.c +++ b/bufferevent_sock.c @@ -600,12 +600,21 @@ static int be_socket_adj_timeouts(struct bufferevent *bufev) { int r = 0; - if (event_pending(&bufev->ev_read, EV_READ, NULL)) - if (be_socket_add(&bufev->ev_read, &bufev->timeout_read) < 0) - r = -1; + if (event_pending(&bufev->ev_read, EV_READ, NULL)) { + if (evutil_timerisset(&bufev->timeout_read)) { + if (be_socket_add(&bufev->ev_read, &bufev->timeout_read) < 0) + r = -1; + } else { + event_remove_timer(&bufev->ev_read); + } + } if (event_pending(&bufev->ev_write, EV_WRITE, NULL)) { - if (be_socket_add(&bufev->ev_write, &bufev->timeout_write) < 0) - r = -1; + if (evutil_timerisset(&bufev->timeout_write)) { + if (be_socket_add(&bufev->ev_write, &bufev->timeout_write) < 0) + r = -1; + } else { + event_remove_timer(&bufev->ev_write); + } } return r; } -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 23:37:21
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 16:15:03 -0500 Subject: Add an event_remove_timer() to remove timer on an event without deleting it Commit: e3b2e0869ec4718eb0985444adf24e8c30bdeb92 --- event-internal.h | 1 + event.c | 39 ++++++++++++++++++++++++++++ include/event2/event.h | 14 ++++++++- test/regress.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 2 deletions(-) diff --git a/event-internal.h b/event-internal.h index 36ece84..614f5d8 100644 --- a/event-internal.h +++ b/event-internal.h @@ -383,6 +383,7 @@ int evsig_restore_handler_(struct event_base *base, int evsignal); int event_add_nolock_(struct event *ev, const struct timeval *tv, int tv_is_absolute); int event_del_nolock_(struct event *ev); +int event_remove_timer_nolock_(struct event *ev); void event_active_nolock_(struct event *ev, int res, short count); int event_callback_activate_(struct event_base *, struct event_callback *); diff --git a/event.c b/event.c index fc3ceef..0fdd5d3 100644 --- a/event.c +++ b/event.c @@ -2193,6 +2193,45 @@ evthread_notify_base(struct event_base *base) return base->th_notify_fn(base); } +/* Implementation function to remove a timeout on a currently pending event. + */ +int +event_remove_timer_nolock_(struct event *ev) +{ + struct event_base *base = ev->ev_base; + + EVENT_BASE_ASSERT_LOCKED(base); + event_debug_assert_is_setup_(ev); + + event_debug(("event_remove_timer_nolock: event: %p", ev)); + + /* If it's not pending on a timeout, we don't need to do anything. */ + if (ev->ev_flags & EVLIST_TIMEOUT) { + event_queue_remove_timeout(base, ev); + } + + return (0); +} + +int +event_remove_timer(struct event *ev) +{ + int res; + + if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) { + event_warnx("%s: event has no event_base set.", __func__); + return -1; + } + + EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock); + + res = event_remove_timer_nolock_(ev); + + EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock); + + return (res); +} + /* Implementation function to add an event. Works just like event_add, * except: 1) it requires that we have the lock. 2) if tv_is_absolute is set, * we treat tv as an absolute time, not as an interval to add to the current diff --git a/include/event2/event.h b/include/event2/event.h index 3eed812..4f177d9 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -1037,8 +1037,7 @@ int event_base_once(struct event_base *, evutil_socket_t, short, event_callback_ in calls to event_assign() until it is no longer pending. If the event in the ev argument already has a scheduled timeout, calling - event_add() replaces the old timeout with the new one, or clears the old - timeout if the timeout argument is NULL. + event_add() replaces the old timeout with the new one if tv is non-NULL. @param ev an event struct initialized via event_set() @param timeout the maximum amount of time to wait for the event, or NULL @@ -1049,6 +1048,17 @@ int event_base_once(struct event_base *, evutil_socket_t, short, event_callback_ int event_add(struct event *ev, const struct timeval *timeout); /** + Remove a timer from a pending event without removing the event itself. + + If the event has a scheduled timeout, this function unschedules it but + leaves the event otherwise pending. + + @param ev an event struct initialized via event_assign() or event_new() + @return 0 on success, or -1 if an error occurrect. +*/ +int event_remove_timer(struct event *ev); + +/** Remove an event from the set of monitored events. The function event_del() will cancel the event in the argument ev. If the diff --git a/test/regress.c b/test/regress.c index 460ed58..e9e23ce 100644 --- a/test/regress.c +++ b/test/regress.c @@ -1410,6 +1410,71 @@ end: ; } + +static void incr_arg_cb(evutil_socket_t fd, short what, void *arg) +{ + int *intptr = arg; + (void) fd; (void) what; + ++*intptr; +} +static void remove_timers_cb(evutil_socket_t fd, short what, void *arg) +{ + struct event **ep = arg; + (void) fd; (void) what; + event_remove_timer(ep[0]); + event_remove_timer(ep[1]); +} +static void send_a_byte_cb(evutil_socket_t fd, short what, void *arg) +{ + evutil_socket_t *sockp = arg; + (void) fd; (void) what; + write(*sockp, "A", 1); +} +static void read_not_timeout_cb(evutil_socket_t fd, short what, void *arg) +{ + int *intp = arg; + (void) fd; (void) what; + *intp |= what; +} + +static void +test_event_remove_timeout(void *ptr) +{ + struct basic_test_data *data = ptr; + struct event_base *base = data->base; + struct event *ev[4]; + int ev0_fired=0, ev1_fired=0; + struct timeval ms25 = { 0, 25*1000 }, + ms75 = { 0, 75*1000 }, + ms125 = { 0, 125*1000 }; + + event_base_assert_ok_(base); + + ev[0] = event_new(base, data->pair[0], EV_READ, + read_not_timeout_cb, &ev0_fired); + ev[1] = evtimer_new(base, incr_arg_cb, &ev1_fired); + ev[2] = evtimer_new(base, remove_timers_cb, ev); + ev[3] = evtimer_new(base, send_a_byte_cb, &data->pair[1]); + tt_assert(base); + event_add(ev[2], &ms25); /* remove timers */ + event_add(ev[0], &ms75); /* read */ + event_add(ev[1], &ms75); /* timer */ + event_add(ev[3], &ms125); /* timeout. */ + event_base_assert_ok_(base); + + event_base_dispatch(base); + + tt_int_op(ev1_fired, ==, 0); + tt_int_op(ev0_fired, ==, EV_READ); + + event_base_assert_ok_(base); +end: + event_free(ev[0]); + event_free(ev[1]); + event_free(ev[2]); + event_free(ev[3]); +} + static void test_event_base_new(void *ptr) { @@ -2559,6 +2624,7 @@ struct testcase_t main_testcases[] = { BASIC(bad_assign, TT_FORK|TT_NEED_BASE|TT_NO_LOGS), BASIC(bad_reentrant, TT_FORK|TT_NEED_BASE|TT_NO_LOGS), BASIC(active_later, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR), + BASIC(event_remove_timeout, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR), /* These are still using the old API */ LEGACY(persistent_timeout, TT_FORK|TT_NEED_BASE), -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 21:19:27
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 16:17:07 -0500 Subject: Fix a couple of compile warnings in the unit tests Commit: 5a9a0141896c658af8dd31aa28cf258e510add55 --- test/regress.c | 3 +-- test/regress_ssl.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/regress.c b/test/regress.c index 7d3540e..460ed58 100644 --- a/test/regress.c +++ b/test/regress.c @@ -2264,13 +2264,12 @@ test_event_once_never(void *ptr) { struct basic_test_data *data = ptr; struct timeval tv; - int r; /* Have one trigger in 10 seconds (don't worry, because) */ tv.tv_sec = 10; tv.tv_usec = 0; called = 0; - r = event_base_once(data->base, -1, EV_TIMEOUT, + event_base_once(data->base, -1, EV_TIMEOUT, timeout_called_once_cb, NULL, &tv); /* But shut down the base in 75 msec. */ diff --git a/test/regress_ssl.c b/test/regress_ssl.c index 005e061..acf2bd6 100644 --- a/test/regress_ssl.c +++ b/test/regress_ssl.c @@ -159,7 +159,7 @@ init_ssl(void) SSL_load_error_strings(); OpenSSL_add_all_algorithms(); if (SSLeay() != OPENSSL_VERSION_NUMBER) { - TT_DECLARE("WARN", ("Version mismatch for openssl: compiled with %lx but running with %lx", OPENSSL_VERSION_NUMBER, SSLeay())); + TT_DECLARE("WARN", ("Version mismatch for openssl: compiled with %lx but running with %lx", (unsigned long)OPENSSL_VERSION_NUMBER, (unsigned long) SSLeay())); } } -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 17:07:39
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 11:55:27 -0500 Subject: Avoid crash when event_pending() called with no event_base set on event Commit: e3cccf380c23891089d7c3a4637cac50010a600d Instead, give a warning and return 0. Reported by Antony Dovgal on github as https://github.com/libevent/libevent/issues/19 --- event.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/event.c b/event.c index 91cb0cc..a979f1f 100644 --- a/event.c +++ b/event.c @@ -1850,6 +1850,11 @@ event_pending(const struct event *ev, short event, struct timeval *tv) { int flags = 0; + if (EVUTIL_FAILURE_CHECK(ev->ev_base == NULL)) { + event_warnx("%s: event has no event_base set.", __func__); + return 0; + } + EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock); _event_debug_assert_is_setup(ev); -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 17:07:14
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 11:55:27 -0500 Subject: Avoid crash when event_pending() called with no event_base set on event Commit: e3cccf380c23891089d7c3a4637cac50010a600d Instead, give a warning and return 0. Reported by Antony Dovgal on github as https://github.com/libevent/libevent/issues/19 --- event.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/event.c b/event.c index 91cb0cc..a979f1f 100644 --- a/event.c +++ b/event.c @@ -1850,6 +1850,11 @@ event_pending(const struct event *ev, short event, struct timeval *tv) { int flags = 0; + if (EVUTIL_FAILURE_CHECK(ev->ev_base == NULL)) { + event_warnx("%s: event has no event_base set.", __func__); + return 0; + } + EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock); _event_debug_assert_is_setup(ev); -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:57:35
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 11:51:42 -0500 Subject: Use EVUTIL_SOCKET_ERROR() wrapper to save/restor errno in evhttp_connection_fail_ Commit: 7afbd60266372af1f73d401127832983230ab420 --- http.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/http.c b/http.c index 03305e5..22a46a9 100644 --- a/http.c +++ b/http.c @@ -681,7 +681,7 @@ void evhttp_connection_fail_(struct evhttp_connection *evcon, enum evhttp_connection_error error) { - const int errsave = errno; + const int errsave = EVUTIL_SOCKET_ERROR(); struct evhttp_request* req = TAILQ_FIRST(&evcon->requests); void (*cb)(struct evhttp_request *, void *); void *cb_arg; @@ -731,7 +731,7 @@ evhttp_connection_fail_(struct evhttp_connection *evcon, * Let's restore the original errno, so that the user's * callback can have a better idea of what the error was. */ - errno = errsave; + EVUTIL_SET_SOCKET_ERROR(errsave); /* inform the user */ if (cb != NULL) -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:57:34
|
Author: Patrick Pelletier <co...@fu...> Date: Tue, 13 Nov 2012 21:22:39 -0800 Subject: preserve errno in evhttp_connection_fail_ for inspection by the callback Commit: 36d0ee5c9faa59b2bb0289ec84189eb2aeb6ba18 --- http.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/http.c b/http.c index 34d1dc9..0a9390f 100644 --- a/http.c +++ b/http.c @@ -681,6 +681,7 @@ void evhttp_connection_fail_(struct evhttp_connection *evcon, enum evhttp_connection_error error) { + const int errsave = errno; struct evhttp_request* req = TAILQ_FIRST(&evcon->requests); void (*cb)(struct evhttp_request *, void *); void *cb_arg; @@ -726,6 +727,12 @@ evhttp_connection_fail_(struct evhttp_connection *evcon, if (TAILQ_FIRST(&evcon->requests) != NULL) evhttp_connection_connect_(evcon); + /* The call to evhttp_connection_reset_ overwrote errno. + * Let's restore the original errno, so that the user's + * callback can have a better idea of what the error was. + */ + errno = errsave; + /* inform the user */ if (cb != NULL) (*cb)(NULL, cb_arg); -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:48:46
|
Author: Jay R. Wren <jr...@xm...> Date: Wed, 10 Oct 2012 13:16:02 -0400 Subject: add evhttp_request_get_response_code_line Commit: 4f4d0c93183b446d73edc3c59ac7751822620b07 This is needed to be able to read the response code line especially when acting as an http client using evhttp_make_request. (patched by nickm to make the return value const) --- http.c | 6 ++++++ include/event2/http.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/http.c b/http.c index 7c93609..b8f1a06 100644 --- a/http.c +++ b/http.c @@ -3813,6 +3813,12 @@ evhttp_request_get_response_code(const struct evhttp_request *req) return req->response_code; } +const char * +evhttp_request_get_response_code_line(const struct evhttp_request *req) +{ + return req->response_code_line; +} + /** Returns the input headers */ struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req) { diff --git a/include/event2/http.h b/include/event2/http.h index 109b73b..28d0f56 100644 --- a/include/event2/http.h +++ b/include/event2/http.h @@ -602,6 +602,7 @@ const struct evhttp_uri *evhttp_request_get_evhttp_uri(const struct evhttp_reque enum evhttp_cmd_type evhttp_request_get_command(const struct evhttp_request *req); int evhttp_request_get_response_code(const struct evhttp_request *req); +const char * evhttp_request_get_response_code_line(const struct evhttp_request *req); /** Returns the input headers */ struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req); -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:42:30
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 11:41:59 -0500 Subject: Move evutil_rtrim_lws_ to evutil.c where it belongs Commit: 61b93af5618fb164ceb64dc96e6a47347043c629 --- evutil.c | 21 +++++++++++++++++++++ http.c | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/evutil.c b/evutil.c index 6af2bcc..efeb253 100644 --- a/evutil.c +++ b/evutil.c @@ -2199,6 +2199,27 @@ int evutil_ascii_strncasecmp(const char *s1, const char *s2, size_t n) return 0; } +void +evutil_rtrim_lws_(char *str) +{ + char *cp; + + if (str == NULL) + return; + + if ((cp = strchr(str, '\0')) == NULL || (cp == str)) + return; + + --cp; + + while (*cp == ' ' || *cp == '\t') { + *cp = '\0'; + if (cp == str) + break; + --cp; + } +} + static int evutil_issetugid(void) { diff --git a/http.c b/http.c index c4c72f6..7c93609 100644 --- a/http.c +++ b/http.c @@ -219,27 +219,6 @@ strsep(char **s, const char *del) } #endif -void -evutil_rtrim_lws_(char *str) -{ - char *cp; - - if (str == NULL) - return; - - if ((cp = strchr(str, '\0')) == NULL || (cp == str)) - return; - - --cp; - - while (*cp == ' ' || *cp == '\t') { - *cp = '\0'; - if (cp == str) - break; - --cp; - } -} - static size_t html_replace(const char ch, const char **escaped) { -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:42:29
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 11:38:53 -0500 Subject: Remove internal ws from multiline http headers correctly Commit: c6ff3812704a75ec4920578a32aad488745830eb According to RFC2616: All linear white space, including folding, has the same semantics as SP. A recipient MAY replace any linear white space with a single SP before interpreting the field value or forwarding the message downstream. --- http.c | 13 ++++++++++--- test/regress_http.c | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/http.c b/http.c index 42a44f7..c4c72f6 100644 --- a/http.c +++ b/http.c @@ -1870,7 +1870,7 @@ evhttp_parse_firstline_(struct evhttp_request *req, struct evbuffer *buffer) } static int -evhttp_append_to_last_header(struct evkeyvalq *headers, const char *line) +evhttp_append_to_last_header(struct evkeyvalq *headers, char *line) { struct evkeyval *header = TAILQ_LAST(headers, evkeyvalq); char *newval; @@ -1880,13 +1880,20 @@ evhttp_append_to_last_header(struct evkeyvalq *headers, const char *line) return (-1); old_len = strlen(header->value); + + /* Strip space from start and end of line. */ + while (*line == ' ' || *line == '\t') + ++line; + evutil_rtrim_lws_(line); + line_len = strlen(line); - newval = mm_realloc(header->value, old_len + line_len + 1); + newval = mm_realloc(header->value, old_len + line_len + 2); if (newval == NULL) return (-1); - memcpy(newval + old_len, line, line_len + 1); + newval[old_len] = ' '; + memcpy(newval + old_len + 1, line, line_len + 1); header->value = newval; return (0); diff --git a/test/regress_http.c b/test/regress_http.c index cc755de..adc78ab 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -256,6 +256,9 @@ http_errorcb(struct bufferevent *bev, short what, void *arg) event_base_loopexit(arg, NULL); } +static int found_multi = 0; +static int found_multi2 = 0; + static void http_basic_cb(struct evhttp_request *req, void *arg) { @@ -267,14 +270,23 @@ http_basic_cb(struct evhttp_request *req, void *arg) /* For multi-line headers test */ { const char *multi = - evhttp_find_header(evhttp_request_get_input_headers(req),"X-multi"); + evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi"); if (multi) { + found_multi = !strcmp(multi,"aaaaaaaa a END"); if (strcmp("END", multi + strlen(multi) - 3) == 0) test_ok++; if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Last")) test_ok++; } } + { + const char *multi2 = + evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi-Extra-WS"); + if (multi2) { + found_multi2 = !strcmp(multi2,"libevent 2.1"); + } + } + /* injecting a bad content-length */ if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Negative")) @@ -3276,6 +3288,8 @@ http_multi_line_header_test(void *arg) "GET /test HTTP/1.1\r\n" "Host: somehost\r\n" "Connection: close\r\n" + "X-Multi-Extra-WS: libevent \r\n" + "\t\t\t2.1 \r\n" "X-Multi: aaaaaaaa\r\n" " a\r\n" "\tEND\r\n" @@ -3283,9 +3297,12 @@ http_multi_line_header_test(void *arg) "\r\n"; bufferevent_write(bev, http_start_request, strlen(http_start_request)); + found_multi = found_multi2 = 0; event_base_dispatch(data->base); + tt_int_op(found_multi, ==, 1); + tt_int_op(found_multi2, ==, 1); tt_int_op(test_ok, ==, 4); end: if (bev) -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:42:28
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 11:29:34 -0500 Subject: Remove trailing tabs in HTTP headers as well. Commit: ac42519769ed0cf3bffc70317802231bd434c11e --- http.c | 6 +++--- test/regress_util.c | 10 +++++++++- util-internal.h | 5 +++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 96c5305..42a44f7 100644 --- a/http.c +++ b/http.c @@ -220,7 +220,7 @@ strsep(char **s, const char *del) #endif void -evutil_rtrim_(char *str) +evutil_rtrim_lws_(char *str) { char *cp; @@ -232,7 +232,7 @@ evutil_rtrim_(char *str) --cp; - while (*cp == ' ') { + while (*cp == ' ' || *cp == '\t') { *cp = '\0'; if (cp == str) break; @@ -1934,7 +1934,7 @@ evhttp_parse_headers_(struct evhttp_request *req, struct evbuffer* buffer) goto error; svalue += strspn(svalue, " "); - evutil_rtrim_(svalue); + evutil_rtrim_lws_(svalue); if (evhttp_add_header(headers, skey, svalue) == -1) goto error; diff --git a/test/regress_util.c b/test/regress_util.c index 2f20e94..6c8374d 100644 --- a/test/regress_util.c +++ b/test/regress_util.c @@ -441,7 +441,7 @@ test_evutil_rtrim(void *ptr) do { \ if (cp) mm_free(cp); \ cp = s ? mm_strdup(s) : NULL; \ - evutil_rtrim_(cp); \ + evutil_rtrim_lws_(cp); \ if (result == NULL) \ tt_ptr_op(cp, ==, NULL); \ else \ @@ -461,6 +461,14 @@ test_evutil_rtrim(void *ptr) TEST_TRIM("a ", "a"); TEST_TRIM("abcdef gH ", "abcdef gH"); + TEST_TRIM("\t\t", ""); + TEST_TRIM(" \t", ""); + TEST_TRIM("\t", ""); + TEST_TRIM("a \t", "a"); + TEST_TRIM("a\t ", "a"); + TEST_TRIM("a\t", "a"); + TEST_TRIM("abcdef gH \t ", "abcdef gH"); + end: if (cp) mm_free(cp); diff --git a/util-internal.h b/util-internal.h index dff3d70..fa29f27 100644 --- a/util-internal.h +++ b/util-internal.h @@ -218,8 +218,9 @@ int EVUTIL_ISUPPER_(char c); char EVUTIL_TOUPPER_(char c); char EVUTIL_TOLOWER_(char c); -/** Remove all trailing whitespace from the end of a string */ -void evutil_rtrim_(char *); +/** Remove all trailing horizontal whitespace (space or tab) from the end of a + * string */ +void evutil_rtrim_lws_(char *); /** Helper macro. If we know that a given pointer points to a field in a -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:42:27
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 11:13:29 -0500 Subject: Clean up rtrim implementation Commit: aa59d805f518d14305310db1096b8eb1904cdec3 If I understand the C standard correctly, you can't actually point at a position immediately _before_ the start of an object; only at the position immediately after. According to J.2 in the standard, in its big list of undefined behavior: "The behavior is undefined in the following circumstances: ... — Addition or subtraction of a pointer into, or just beyond, an array object and an integer type produces a result that does not point into, or just beyond, the same array object (6.5.6)." So we've got to fix rtrim to not do that. Also, make it unit tested, and give it an evutil_*_ name. --- http.c | 21 ++++++++++++++------- test/regress_util.c | 33 +++++++++++++++++++++++++++++++++ util-internal.h | 4 ++++ 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/http.c b/http.c index a6d9ab3..96c5305 100644 --- a/http.c +++ b/http.c @@ -219,18 +219,25 @@ strsep(char **s, const char *del) } #endif -static void -rtrim(char *str) +void +evutil_rtrim_(char *str) { char *cp; - if( str == NULL ) + if (str == NULL) + return; + + if ((cp = strchr(str, '\0')) == NULL || (cp == str)) return; - cp = strchr(str, '\0') - 1; + --cp; - while (cp >= str && *cp == ' ') - *cp-- = '\0'; + while (*cp == ' ') { + *cp = '\0'; + if (cp == str) + break; + --cp; + } } static size_t @@ -1927,7 +1934,7 @@ evhttp_parse_headers_(struct evhttp_request *req, struct evbuffer* buffer) goto error; svalue += strspn(svalue, " "); - rtrim(svalue); + evutil_rtrim_(svalue); if (evhttp_add_header(headers, skey, svalue) == -1) goto error; diff --git a/test/regress_util.c b/test/regress_util.c index 41bc818..2f20e94 100644 --- a/test/regress_util.c +++ b/test/regress_util.c @@ -434,6 +434,38 @@ end: ; } +static void +test_evutil_rtrim(void *ptr) +{ +#define TEST_TRIM(s, result) \ + do { \ + if (cp) mm_free(cp); \ + cp = s ? mm_strdup(s) : NULL; \ + evutil_rtrim_(cp); \ + if (result == NULL) \ + tt_ptr_op(cp, ==, NULL); \ + else \ + tt_str_op(cp, ==, result); \ + } while(0) + + char *cp = NULL; + (void) ptr; + + TEST_TRIM(NULL, NULL); + TEST_TRIM("", ""); + TEST_TRIM("a", "a"); + TEST_TRIM("abcdef ghi", "abcdef ghi"); + + TEST_TRIM(" ", ""); + TEST_TRIM(" ", ""); + TEST_TRIM("a ", "a"); + TEST_TRIM("abcdef gH ", "abcdef gH"); + +end: + if (cp) + mm_free(cp); +} + static int logsev = 0; static char *logmsg = NULL; @@ -1348,6 +1380,7 @@ struct testcase_t util_testcases[] = { { "evutil_snprintf", test_evutil_snprintf, 0, NULL, NULL }, { "evutil_strtoll", test_evutil_strtoll, 0, NULL, NULL }, { "evutil_casecmp", test_evutil_casecmp, 0, NULL, NULL }, + { "evutil_rtrim", test_evutil_rtrim, 0, NULL, NULL }, { "strlcpy", test_evutil_strlcpy, 0, NULL, NULL }, { "log", test_evutil_log, TT_FORK, NULL, NULL }, { "upcast", test_evutil_upcast, 0, NULL, NULL }, diff --git a/util-internal.h b/util-internal.h index da1fb83..dff3d70 100644 --- a/util-internal.h +++ b/util-internal.h @@ -218,6 +218,10 @@ int EVUTIL_ISUPPER_(char c); char EVUTIL_TOUPPER_(char c); char EVUTIL_TOLOWER_(char c); +/** Remove all trailing whitespace from the end of a string */ +void evutil_rtrim_(char *); + + /** Helper macro. If we know that a given pointer points to a field in a structure, return a pointer to the structure itself. Used to implement our half-baked C OO. Example: -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 16:42:26
|
Author: Artem Germanov <root@cent56.(none)> Date: Sun, 20 May 2012 21:08:52 -0700 Subject: ignore LWS after field-content in headers Commit: 370a2c02133c11d4eaab4aa552e49e9ed8b24658 --- http.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/http.c b/http.c index 34d1dc9..a6d9ab3 100644 --- a/http.c +++ b/http.c @@ -219,6 +219,20 @@ strsep(char **s, const char *del) } #endif +static void +rtrim(char *str) +{ + char *cp; + + if( str == NULL ) + return; + + cp = strchr(str, '\0') - 1; + + while (cp >= str && *cp == ' ') + *cp-- = '\0'; +} + static size_t html_replace(const char ch, const char **escaped) { @@ -1913,6 +1927,7 @@ evhttp_parse_headers_(struct evhttp_request *req, struct evbuffer* buffer) goto error; svalue += strspn(svalue, " "); + rtrim(svalue); if (evhttp_add_header(headers, skey, svalue) == -1) goto error; -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:56:14
|
Author: Patrick Pelletier <co...@fu...> Date: Wed, 7 Nov 2012 19:48:22 -0800 Subject: remove stray 'x' so print_err will compile when uncommented Commit: ac356502d313ff7712a43e2e8361d7302d8f8c0c --- bufferevent_openssl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index e01909e..7582d9b 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -87,7 +87,7 @@ print_err(int val) int err; printf("Error was %d\n", val); - while ((err = ERR_get_error()))x { + while ((err = ERR_get_error())) { const char *msg = (const char*)ERR_reason_error_string(err); const char *lib = (const char*)ERR_lib_error_string(err); const char *func = (const char*)ERR_func_error_string(err); -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:54:33
|
Author: Azat Khuzhin <a3a...@gm...> Date: Tue, 18 Sep 2012 15:17:29 +0400 Subject: Fix typo : events instead of evets Commit: 05f1aca5980279a710d94c57074d238f61403b24 --- include/event2/event.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/event2/event.h b/include/event2/event.h index 36a42df..6e2ded4 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -90,7 +90,7 @@ remain allocated as long as it is active, so it should generally be allocated on the heap. - @section loop Dispaching evets. + @section loop Dispaching events. Finally, you call event_base_dispatch() to loop and dispatch events. You can also use event_base_loop() for more fine-grained control. -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:51:49
|
Author: Patrick Pelletier <co...@fu...> Date: Tue, 23 Oct 2012 22:09:45 -0700 Subject: fix a few trivial documentation typos Commit: 09098f70a2a48ad90f4b36c6b7da346ce1cead0b --- README | 2 +- configure.ac | 2 +- whatsnew-2.1.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index c79fb7b..313a803 100644 --- a/README +++ b/README @@ -23,7 +23,7 @@ Install as root via # make install -Before, reporting any problems, please run the regression tests. +Before reporting any problems, please run the regression tests. To enable the low-level tracing build the library as: diff --git a/configure.ac b/configure.ac index 3f91ce0..1defb5c 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,7 @@ AC_ARG_ENABLE([verbose-debug], AC_PROG_LIBTOOL -dnl Uncomment "AC_DISABLE_SHARED" to make shared librraries not get +dnl Uncomment "AC_DISABLE_SHARED" to make shared libraries not get dnl built by default. You can also turn shared libs on and off from dnl the command line with --enable-shared and --disable-shared. dnl AC_DISABLE_SHARED diff --git a/whatsnew-2.1.txt b/whatsnew-2.1.txt index d02c518..ae69093 100644 --- a/whatsnew-2.1.txt +++ b/whatsnew-2.1.txt @@ -385,6 +385,6 @@ 5. Testing - Libevent's test coverage level is more or less unchanged sine before: + Libevent's test coverage level is more or less unchanged since before: we still have over 80% line coverage in our tests on Linux and OSX. There are some under-tested modules, though: we need to fix those. -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:50:25
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 10:48:13 -0500 Subject: Use correct openssl libs and includes in pkgconfig file Commit: d70af27d0152d0a87a25127faf215604beb8ffe0 Previously we were saying -lssl -lcrypto unconditionally when we should have been saying OPENSSL_LIBS. Based on a patch from Patrick Pelletier --- libevent_openssl.pc.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libevent_openssl.pc.in b/libevent_openssl.pc.in index 9624cf2..a65d1e0 100644 --- a/libevent_openssl.pc.in +++ b/libevent_openssl.pc.in @@ -11,6 +11,6 @@ Version: @VERSION@ Requires: libevent Conflicts: Libs: -L${libdir} -levent_openssl -Libs.private: @LIBS@ -lssl -lcrypto -Cflags: -I${includedir} +Libs.private: @LIBS@ @OPENSSL_LIBS@ +Cflags: -I${includedir} @OPENSSL_INCS@ -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:50:24
|
Author: Patrick Pelletier <co...@fu...> Date: Wed, 7 Nov 2012 19:48:22 -0800 Subject: remove stray 'x' so print_err will compile when uncommented Commit: ac356502d313ff7712a43e2e8361d7302d8f8c0c --- bufferevent_openssl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index e01909e..7582d9b 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -87,7 +87,7 @@ print_err(int val) int err; printf("Error was %d\n", val); - while ((err = ERR_get_error()))x { + while ((err = ERR_get_error())) { const char *msg = (const char*)ERR_reason_error_string(err); const char *lib = (const char*)ERR_lib_error_string(err); const char *func = (const char*)ERR_func_error_string(err); -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:50:23
|
Author: Derrick Pallas <de...@pa...> Date: Sat, 10 Nov 2012 11:22:15 -0800 Subject: Fix event_dlist definition when sys/queue not included Commit: 81b6209e10f7325de0b533bcbc256caddfe1f209 This header adds TAILQ_HEAD and TAILQ_ENTRY if sys/queue is not included. There is a similar macro that adds LIST_ENTRY but not LIST_HEAD, even though LIST_HEAD is used later. This change pulls in the correct definition (swiped from sys/queue) for LIST_HEAD and cleans up the one spot where it is used. The change can be tested by adding #undef LIST_HEAD #undef LIST_ENTRY right before the #ifndef checks and removing #define EVENT_DEFINED_LISTENTRY_ #define EVENT_DEFINED_LISTHEAD_ so that the macros persist later. --- include/event2/event_struct.h | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/event2/event_struct.h b/include/event2/event_struct.h index cf7b3df..8d04284 100644 --- a/include/event2/event_struct.h +++ b/include/event2/event_struct.h @@ -91,7 +91,15 @@ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } -#endif /* !TAILQ_ENTRY */ +#endif /* !LIST_ENTRY */ + +#ifndef LIST_HEAD +#define EVENT_DEFINED_LISTHEAD_ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ + } +#endif /* !LIST_HEAD */ struct event_callback { TAILQ_ENTRY(event_callback) evcb_active_next; @@ -150,13 +158,15 @@ TAILQ_HEAD (event_list, event); #undef TAILQ_HEAD #endif +LIST_HEAD (event_dlist, event); + #ifdef EVENT_DEFINED_LISTENTRY_ #undef LIST_ENTRY -struct event_dlist; -#undef EVENT_DEFINED_LISTENTRY_ -#else -LIST_HEAD (event_dlist, event); -#endif /* EVENT_DEFINED_LISTENTRY_ */ +#endif + +#ifdef EVENT_DEFINED_LISTHEAD_ +#undef LIST_HEAD +#endif #ifdef __cplusplus } -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:31:28
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 10:28:19 -0500 Subject: Make rpcgen_wrapper.sh work on systems without a "python2" binary Commit: f3009e48c7b1cde00da44b8af2159278e2394a6a --- test/rpcgen_wrapper.sh | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/test/rpcgen_wrapper.sh b/test/rpcgen_wrapper.sh index a60331c..d2101b0 100755 --- a/test/rpcgen_wrapper.sh +++ b/test/rpcgen_wrapper.sh @@ -26,9 +26,17 @@ exit_failed() { exit 1 } +if [ -x /usr/bin/python2 ] ; then + PYTHON2=/usr/bin/python2 +elif [ "x`which python2`" != x ] ; then + PYTHON2=python2 +else + PYTHON2=python +fi + srcdir=$1 srcdir=${srcdir:-.} -${srcdir}/../event_rpcgen.py ${srcdir}/regress.rpc +${PYTHON2} ${srcdir}/../event_rpcgen.py ${srcdir}/regress.rpc case "$?" in 0) exit_updated -- 1.7.4.1 |
From: Nick M. <ni...@us...> - 2012-11-16 15:30:36
|
Author: Nick Mathewson <ni...@to...> Date: Fri, 16 Nov 2012 10:28:19 -0500 Subject: Make rpcgen_wrapper.sh work on systems without a "python2" binary Commit: f3009e48c7b1cde00da44b8af2159278e2394a6a --- test/rpcgen_wrapper.sh | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/test/rpcgen_wrapper.sh b/test/rpcgen_wrapper.sh index a60331c..d2101b0 100755 --- a/test/rpcgen_wrapper.sh +++ b/test/rpcgen_wrapper.sh @@ -26,9 +26,17 @@ exit_failed() { exit 1 } +if [ -x /usr/bin/python2 ] ; then + PYTHON2=/usr/bin/python2 +elif [ "x`which python2`" != x ] ; then + PYTHON2=python2 +else + PYTHON2=python +fi + srcdir=$1 srcdir=${srcdir:-.} -${srcdir}/../event_rpcgen.py ${srcdir}/regress.rpc +${PYTHON2} ${srcdir}/../event_rpcgen.py ${srcdir}/regress.rpc case "$?" in 0) exit_updated -- 1.7.4.1 |