diff -Nru libevent-2.0.16-stable/aclocal.m4 libevent-2.0.21-stable/aclocal.m4 --- libevent-2.0.16-stable/aclocal.m4 2011-11-18 20:19:59.000000000 +0000 +++ libevent-2.0.21-stable/aclocal.m4 2012-11-19 15:13:14.000000000 +0000 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -557,12 +567,15 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -729,12 +742,15 @@ fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -757,13 +773,14 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -771,13 +788,13 @@ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -853,12 +870,14 @@ fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -881,13 +900,13 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -896,13 +915,13 @@ AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -924,10 +943,11 @@ # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff -Nru libevent-2.0.16-stable/arc4random.c libevent-2.0.21-stable/arc4random.c --- libevent-2.0.16-stable/arc4random.c 2011-03-03 17:55:15.000000000 +0000 +++ libevent-2.0.21-stable/arc4random.c 2012-02-12 02:10:22.000000000 +0000 @@ -1,6 +1,7 @@ /* Portable arc4random.c based on arc4random.c from OpenBSD. * Portable version by Chris Davis, adapted for Libevent by Nick Mathewson * Copyright (c) 2010 Chris Davis, Niels Provos, and Nick Mathewson + * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson * * Note that in Libevent, this file isn't compiled directly. Instead, * it's included from evutil_rand.c @@ -166,7 +167,7 @@ } #endif -#if defined(_EVENT_HAVE_SYS_SYSCTL_H) +#if defined(_EVENT_HAVE_SYS_SYSCTL_H) && defined(_EVENT_HAVE_SYSCTL) #if _EVENT_HAVE_DECL_CTL_KERN && _EVENT_HAVE_DECL_KERN_RANDOM && _EVENT_HAVE_DECL_RANDOM_UUID #define TRY_SEED_SYSCTL_LINUX static int @@ -259,7 +260,7 @@ unsigned char entropy[64]; int bytes, n, i, nybbles; for (bytes = 0; bytes - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -2263,6 +2263,8 @@ } chain = chain->next; } + if (! i) + return 0; #ifdef WIN32 { DWORD bytesSent; @@ -2582,14 +2584,21 @@ chain = buffer->first; } + if (n_vec == 0 && len < 0) { + /* If no vectors are provided and they asked for "everything", + * pretend they asked for the actual available amount. */ + len = buffer->total_len - len_so_far; + } + while (chain) { if (len >= 0 && len_so_far >= len) break; if (idxbuffer + chain->misalign; vec[idx].iov_len = chain->off; - } else if (len<0) + } else if (len<0) { break; + } ++idx; len_so_far += chain->off; chain = chain->next; diff -Nru libevent-2.0.16-stable/bufferevent_async.c libevent-2.0.21-stable/bufferevent_async.c --- libevent-2.0.16-stable/bufferevent_async.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent_async.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * All rights reserved. * diff -Nru libevent-2.0.16-stable/bufferevent.c libevent-2.0.21-stable/bufferevent.c --- libevent-2.0.16-stable/bufferevent.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent.c 2012-08-23 15:31:15.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2002-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos, Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/bufferevent_filter.c libevent-2.0.21-stable/bufferevent_filter.c --- libevent-2.0.16-stable/bufferevent_filter.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent_filter.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * Copyright (c) 2002-2006 Niels Provos * All rights reserved. * diff -Nru libevent-2.0.16-stable/bufferevent-internal.h libevent-2.0.21-stable/bufferevent-internal.h --- libevent-2.0.16-stable/bufferevent-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/bufferevent_openssl.c libevent-2.0.21-stable/bufferevent_openssl.c --- libevent-2.0.16-stable/bufferevent_openssl.c 2011-11-18 19:35:07.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent_openssl.c 2012-11-17 00:22:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -87,7 +87,7 @@ 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); @@ -556,15 +556,23 @@ bev_ssl->counts.n_read = num_r; } -/* returns -1 on internal error, 0 on stall, 1 on progress */ +#define OP_MADE_PROGRESS 1 +#define OP_BLOCKED 2 +#define OP_ERR 4 + +/* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if + we're now blocked); and OP_ERR (if an error occurred). */ static int -do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) -{ +do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) { /* Requires lock */ struct bufferevent *bev = &bev_ssl->bev.bev; struct evbuffer *input = bev->input; - int r, n, i, n_used = 0, blocked = 0, atmost; + int r, n, i, n_used = 0, atmost; struct evbuffer_iovec space[2]; + int result = 0; + + if (bev_ssl->bev.read_suspended) + return 0; atmost = _bufferevent_get_read_max(&bev_ssl->bev); if (n_to_read > atmost) @@ -572,16 +580,17 @@ n = evbuffer_reserve_space(input, n_to_read, space, 2); if (n < 0) - return -1; + return OP_ERR; for (i=0; ibev.read_suspended) break; r = SSL_read(bev_ssl->ssl, space[i].iov_base, space[i].iov_len); if (r>0) { + result |= OP_MADE_PROGRESS; if (bev_ssl->read_blocked_on_write) if (clear_rbow(bev_ssl) < 0) - return -1; + return OP_ERR | result; ++n_used; space[i].iov_len = r; decrement_buckets(bev_ssl); @@ -593,20 +602,20 @@ /* Can't read until underlying has more data. */ if (bev_ssl->read_blocked_on_write) if (clear_rbow(bev_ssl) < 0) - return -1; + return OP_ERR | result; break; case SSL_ERROR_WANT_WRITE: /* This read operation requires a write, and the * underlying is full */ if (!bev_ssl->read_blocked_on_write) if (set_rbow(bev_ssl) < 0) - return -1; + return OP_ERR | result; break; default: conn_closed(bev_ssl, err, r); break; } - blocked = 1; + result |= OP_BLOCKED; break; /* out of the loop */ } } @@ -615,21 +624,21 @@ evbuffer_commit_space(input, space, n_used); if (bev_ssl->underlying) BEV_RESET_GENERIC_READ_TIMEOUT(bev); - - if (evbuffer_get_length(input) >= bev->wm_read.low) - _bufferevent_run_readcb(bev); } - return blocked ? 0 : 1; + return result; } +/* Return a bitmask of OP_MADE_PROGRESS (if we wrote anything); OP_BLOCKED (if + we're now blocked); and OP_ERR (if an error occurred). */ static int do_write(struct bufferevent_openssl *bev_ssl, int atmost) { - int i, r, n, n_written = 0, blocked=0; + int i, r, n, n_written = 0; struct bufferevent *bev = &bev_ssl->bev.bev; struct evbuffer *output = bev->output; struct evbuffer_iovec space[8]; + int result = 0; if (bev_ssl->last_write > 0) atmost = bev_ssl->last_write; @@ -638,7 +647,7 @@ n = evbuffer_peek(output, atmost, NULL, space, 8); if (n < 0) - return -1; + return OP_ERR | result; if (n > 8) n = 8; @@ -655,9 +664,10 @@ r = SSL_write(bev_ssl->ssl, space[i].iov_base, space[i].iov_len); if (r > 0) { + result |= OP_MADE_PROGRESS; if (bev_ssl->write_blocked_on_read) if (clear_wbor(bev_ssl) < 0) - return -1; + return OP_ERR | result; n_written += r; bev_ssl->last_write = -1; decrement_buckets(bev_ssl); @@ -669,7 +679,7 @@ /* Can't read until underlying has more data. */ if (bev_ssl->write_blocked_on_read) if (clear_wbor(bev_ssl) < 0) - return -1; + return OP_ERR | result; bev_ssl->last_write = space[i].iov_len; break; case SSL_ERROR_WANT_READ: @@ -677,7 +687,7 @@ * underlying is full */ if (!bev_ssl->write_blocked_on_read) if (set_wbor(bev_ssl) < 0) - return -1; + return OP_ERR | result; bev_ssl->last_write = space[i].iov_len; break; default: @@ -685,7 +695,7 @@ bev_ssl->last_write = -1; break; } - blocked = 1; + result |= OP_BLOCKED; break; } } @@ -697,7 +707,7 @@ if (evbuffer_get_length(output) <= bev->wm_write.low) _bufferevent_run_writecb(bev); } - return blocked ? 0 : 1; + return result; } #define WRITE_FRAME 15000 @@ -757,10 +767,11 @@ { int r; int n_to_read; + int all_result_flags = 0; while (bev_ssl->write_blocked_on_read) { r = do_write(bev_ssl, WRITE_FRAME); - if (r <= 0) + if (r & (OP_BLOCKED|OP_ERR)) break; } if (bev_ssl->write_blocked_on_read) @@ -769,9 +780,15 @@ n_to_read = bytes_to_read(bev_ssl); while (n_to_read) { - if (do_read(bev_ssl, n_to_read) <= 0) + r = do_read(bev_ssl, n_to_read); + all_result_flags |= r; + + if (r & (OP_BLOCKED|OP_ERR)) break; + if (bev_ssl->bev.read_suspended) + break; + /* Read all pending data. This won't hit the network * again, and will (most importantly) put us in a state * where we don't need to read anything else until the @@ -781,6 +798,32 @@ * already been done, since OpenSSL went and read a * whole SSL record anyway. */ n_to_read = SSL_pending(bev_ssl->ssl); + + /* XXX This if statement is actually a bad bug, added to avoid + * XXX a worse bug. + * + * The bad bug: It can potentially cause resource unfairness + * by reading too much data from the underlying bufferevent; + * it can potentially cause read looping if the underlying + * bufferevent is a bufferevent_pair and deferred callbacks + * aren't used. + * + * The worse bug: If we didn't do this, then we would + * potentially not read any more from bev_ssl->underlying + * until more data arrived there, which could lead to us + * waiting forever. + */ + if (!n_to_read && bev_ssl->underlying) + n_to_read = bytes_to_read(bev_ssl); + } + + if (all_result_flags & OP_MADE_PROGRESS) { + struct bufferevent *bev = &bev_ssl->bev.bev; + struct evbuffer *input = bev->input; + + if (evbuffer_get_length(input) >= bev->wm_read.low) { + _bufferevent_run_readcb(bev); + } } if (!bev_ssl->underlying) { @@ -802,7 +845,15 @@ while (bev_ssl->read_blocked_on_write) { r = do_read(bev_ssl, 1024); /* XXXX 1024 is a hack */ - if (r <= 0) + if (r & OP_MADE_PROGRESS) { + struct bufferevent *bev = &bev_ssl->bev.bev; + struct evbuffer *input = bev->input; + + if (evbuffer_get_length(input) >= bev->wm_read.low) { + _bufferevent_run_readcb(bev); + } + } + if (r & (OP_ERR|OP_BLOCKED)) break; } if (bev_ssl->read_blocked_on_write) @@ -821,7 +872,7 @@ else n_to_write = WRITE_FRAME; r = do_write(bev_ssl, n_to_write); - if (r <= 0) + if (r & (OP_BLOCKED|OP_ERR)) break; } @@ -880,11 +931,12 @@ { struct bufferevent_openssl *bev_ssl = ptr; _bufferevent_incref_and_lock(&bev_ssl->bev.bev); - if (what & EV_TIMEOUT) { + if (what == EV_TIMEOUT) { _bufferevent_run_eventcb(&bev_ssl->bev.bev, BEV_EVENT_TIMEOUT|BEV_EVENT_READING); - } else + } else { consider_reading(bev_ssl); + } _bufferevent_decref_and_unlock(&bev_ssl->bev.bev); } @@ -893,11 +945,12 @@ { struct bufferevent_openssl *bev_ssl = ptr; _bufferevent_incref_and_lock(&bev_ssl->bev.bev); - if (what & EV_TIMEOUT) { + if (what == EV_TIMEOUT) { _bufferevent_run_eventcb(&bev_ssl->bev.bev, BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING); + } else { + consider_writing(bev_ssl); } - consider_writing(bev_ssl); _bufferevent_decref_and_unlock(&bev_ssl->bev.bev); } diff -Nru libevent-2.0.16-stable/bufferevent_pair.c libevent-2.0.21-stable/bufferevent_pair.c --- libevent-2.0.16-stable/bufferevent_pair.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent_pair.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos, Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/bufferevent_ratelim.c libevent-2.0.21-stable/bufferevent_ratelim.c --- libevent-2.0.16-stable/bufferevent_ratelim.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent_ratelim.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * Copyright (c) 2002-2006 Niels Provos * All rights reserved. * diff -Nru libevent-2.0.16-stable/bufferevent_sock.c libevent-2.0.21-stable/bufferevent_sock.c --- libevent-2.0.16-stable/bufferevent_sock.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/bufferevent_sock.c 2012-11-01 18:00:11.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * Copyright (c) 2002-2006 Niels Provos * All rights reserved. * @@ -114,7 +114,7 @@ /* Somebody added data to the buffer, and we would like to * write, and we were not writing. So, start writing. */ if (be_socket_add(&bufev->ev_write, &bufev->timeout_write) == -1) { - // Should we log this? + /* Should we log this? */ } } } @@ -133,6 +133,9 @@ _bufferevent_incref_and_lock(bufev); if (event == EV_TIMEOUT) { + /* Note that we only check for event==EV_TIMEOUT. If + * event==EV_TIMEOUT|EV_READ, we can safely ignore the + * timeout, since a read has occurred */ what |= BEV_EVENT_TIMEOUT; goto error; } @@ -209,6 +212,9 @@ _bufferevent_incref_and_lock(bufev); if (event == EV_TIMEOUT) { + /* Note that we only check for event==EV_TIMEOUT. If + * event==EV_TIMEOUT|EV_WRITE, we can safely ignore the + * timeout, since a read has occurred */ what |= BEV_EVENT_TIMEOUT; goto error; } diff -Nru libevent-2.0.16-stable/buffer_iocp.c libevent-2.0.21-stable/buffer_iocp.c --- libevent-2.0.16-stable/buffer_iocp.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/buffer_iocp.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/changelist-internal.h libevent-2.0.21-stable/changelist-internal.h --- libevent-2.0.16-stable/changelist-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/changelist-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/ChangeLog libevent-2.0.21-stable/ChangeLog --- libevent-2.0.16-stable/ChangeLog 2011-11-18 20:09:38.000000000 +0000 +++ libevent-2.0.21-stable/ChangeLog 2012-11-18 06:33:59.000000000 +0000 @@ -1,3 +1,148 @@ +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) +BUGFIXES: + o core: Make event_pending() threadsafe. (be7a95c Simon Liu) + o win32: avoid crash when waiting forever on zero fds. (160e58b) + o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31) + o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c) + o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67) + o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3) + o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel) + o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43) + + +PORTABILITY FIXES: + o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel) + o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn) + o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6) + +BUILD FIXES: + o Add GCC annotations so that the vsprintf functions get checked properly (117e327) + o Fix an unused variable warning on *BSD. (c0720c1) + +UNIT TEST FIXES: + o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall) + o Remove deadcode in http regression tests. Found by coverity. (5553346) + o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777) + o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d) + o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d) + o Fix resource leaks in the unit tests; found by coverity (270f279) + o Add some missing null checks to unit tests; found by coverity (f021c3d) + o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf) + o Remove unused variable; spotted by coverity (6355b2a) + o Add checks to various return values in unit tests. Found by coverity (b9e7329) + o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0) + + + +Changes in version 2.0.19-stable (3 May 2012) +BUGFIXES (CORE): + o Refactor event_persist_closure: raise and extract some common logic (bec22b4) + o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c) + o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40) + +BUGFIXES (SSL): + o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey) + +BUGFIXES (DNS): + o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel) + o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel) + o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a) + +DOCUMENTATION FIXES: + o Fix a typo in the bufferevent documentation (98e9119) + o Add missing ) to changelog; spotted by rransom (4c7ee6b) + o Fix the website URL in the readme (f775521) + +COMPILATION FIXES: + o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae) + o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn) + o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg) + +FORWARD-COMPATIBILITY: + o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2) + +TESTING/DEBUGGING SUPPORT: + o dns-example.c can now take a resolv.conf file on the commandline (6610fa5) + o Make some evdns.c debug logs more verbose (d873d67) + o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd) + + + +Changes in version 2.0.18-stable (22 Mar 2012) +BUGFIXES (core): + o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42) + +BUGFIXES (kqueue): + o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn) + +BUILD FIXES: + o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey) + o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey) + o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn) + +BUGFIXES (dns): + o Stop crashing in evdns when nameserver probes give a weird error (bec5068) + + +Changes in version 2.0.17-stable (10 Feb 2012) + +BUGFIXES (core): + o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5) + o check for sysctl before we use it (358c745 Mike Frysinger) + o Remove bogus casts of socket to int before calling ev_callback (f032516) + o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720) + o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc) + o Fix a fd leak in event_reinit() (3f18ad1) + o Do a memberwise comparison of threading function tables (c94a5f2 Nate R) + o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill) + o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6) + o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott) + +BUGFIXES (evbuffer and bufferevents): + o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg) + o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812) + +BUGFIXES (evhttp): + o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea) + +BUGFIXES (evdns): + o evdns: fix a bug in circular-queue implementation (d6094b1) + +BUILD FIXES: + o Fix a silly compilation error with the sun compiler (1927776 Colin Watt) + o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c) + +DOCUMENTATION FIXES: + o Slightly clarify evbuffer_peek documentation (7bbf6ca) + o Update copyright notices to 2012 (e49e289) + +NEW APIS: + o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker) + +TESTS AND TEST FIXES: + o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7) + o Add function to check referential integrity of an event_base (27737d5) + o Check event_base correctness at end of each unit test (3312b02) + o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187) + o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259) + Changes in version 2.0.16-stable (18 Nov 2011) BUGFIXES (core): o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov) diff -Nru libevent-2.0.16-stable/compile libevent-2.0.21-stable/compile --- libevent-2.0.16-stable/compile 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/compile 2012-11-19 15:13:16.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. +# Wrapper for compilers which do not understand '-c -o'. -scriptversion=2009-10-06.20; # UTC +scriptversion=2012-03-05.13; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software -# Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free +# Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -29,21 +29,219 @@ # bugs to or send patches to # . +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. +right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF @@ -53,11 +251,13 @@ echo "compile $scriptversion" exit $? ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; esac ofile= cfile= -eat= for arg do @@ -66,8 +266,8 @@ else case $1 in -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we strip `-o arg' only if arg is an object. + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) @@ -94,10 +294,10 @@ done if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a + # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also + # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi @@ -106,7 +306,7 @@ cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. -# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d diff -Nru libevent-2.0.16-stable/config.guess libevent-2.0.21-stable/config.guess --- libevent-2.0.16-stable/config.guess 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/config.guess 2012-11-19 15:13:16.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -56,8 +54,9 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -144,7 +143,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -180,7 +179,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -223,7 +222,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -269,7 +268,10 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -295,7 +297,7 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -394,23 +396,23 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -480,8 +482,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -494,7 +496,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -551,7 +553,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -594,52 +596,52 @@ 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -730,22 +732,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -769,14 +771,14 @@ exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -788,13 +790,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -803,15 +804,18 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -857,6 +861,13 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -866,7 +877,7 @@ EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -878,20 +889,29 @@ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -933,7 +953,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -959,7 +979,7 @@ echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -967,14 +987,17 @@ sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -983,11 +1006,11 @@ echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1019,7 +1042,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1047,13 +1070,13 @@ exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1088,8 +1111,8 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1132,10 +1155,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1161,11 +1184,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1230,6 +1253,9 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1275,13 +1301,13 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1299,6 +1325,9 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1321,11 +1350,11 @@ #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff -Nru libevent-2.0.16-stable/config.h.in libevent-2.0.21-stable/config.h.in --- libevent-2.0.16-stable/config.h.in 2011-11-18 20:20:01.000000000 +0000 +++ libevent-2.0.21-stable/config.h.in 2012-11-19 15:13:16.000000000 +0000 @@ -247,6 +247,9 @@ /* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY +/* Define to 1 if you have the `sysctl' function. */ +#undef HAVE_SYSCTL + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DEVPOLL_H @@ -328,6 +331,9 @@ /* Define to 1 if the system has the type `uintptr_t'. */ #undef HAVE_UINTPTR_T +/* Define to 1 if you have the `umask' function. */ +#undef HAVE_UMASK + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H diff -Nru libevent-2.0.16-stable/config.sub libevent-2.0.21-stable/config.sub --- libevent-2.0.16-stable/config.sub 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/config.sub 2012-11-19 15:13:16.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -75,8 +73,9 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,13 +122,18 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -156,8 +160,8 @@ os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -173,10 +177,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -245,17 +249,22 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -281,29 +290,39 @@ | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -313,6 +332,21 @@ basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -327,21 +361,25 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -367,25 +405,29 @@ | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -410,7 +452,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -480,11 +522,20 @@ basic_machine=powerpc-ibm os=-cnk ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -516,7 +567,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -674,7 +725,6 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -732,7 +782,7 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -771,10 +821,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -839,6 +897,12 @@ np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -921,9 +985,10 @@ ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1017,6 +1082,9 @@ basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1073,20 +1141,8 @@ basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1156,6 +1212,9 @@ xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1253,11 +1312,11 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1293,8 +1352,9 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1341,7 +1401,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1390,7 +1450,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1435,6 +1495,8 @@ -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1457,10 +1519,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1472,8 +1534,17 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1493,14 +1564,11 @@ ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1527,7 +1595,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff -Nru libevent-2.0.16-stable/configure libevent-2.0.21-stable/configure --- libevent-2.0.16-stable/configure 2011-11-18 20:20:00.000000000 +0000 +++ libevent-2.0.21-stable/configure 2012-11-19 15:13:15.000000000 +0000 @@ -645,6 +645,7 @@ BUILD_WIN32_FALSE BUILD_WIN32_TRUE OPENSSL_LIBS +OPENSSL_LIBADD EV_LIB_GDI EV_LIB_WS32 ZLIB_REGRESS_FALSE @@ -669,15 +670,16 @@ DUMPBIN LD FGREP -SED LIBTOOL EGREP GREP CPP LN_S +SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -1432,7 +1434,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR @@ -3032,7 +3034,7 @@ # Define the identity of the package. PACKAGE=libevent - VERSION=2.0.16-stable + VERSION=2.0.21-stable cat >>confdefs.h <<_ACEOF @@ -3062,11 +3064,11 @@ # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3075,7 +3077,7 @@ ac_config_headers="$ac_config_headers config.h" -$as_echo "#define NUMERIC_VERSION 0x02001000" >>confdefs.h +$as_echo "#define NUMERIC_VERSION 0x02001500" >>confdefs.h if test "$prefix" = "NONE"; then @@ -4002,6 +4004,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -4026,6 +4029,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -4085,7 +4089,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -4266,6 +4270,75 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } @@ -4592,12 +4665,37 @@ fi +# We need to test for at least gcc 2.95 here, because older versions don't +# have -fno-strict-aliasing +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) +#error +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_gcc295=yes +else + have_gcc295=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$GCC" = "yes" ; then # Enable many gcc warnings by default... CFLAGS="$CFLAGS -Wall" # And disable the strict-aliasing optimization, since it breaks # our sockaddr-handling code in strange ways. - CFLAGS="$CFLAGS -fno-strict-aliasing" + if test x$have_gcc295 = xyes; then + CFLAGS="$CFLAGS -fno-strict-aliasing" + fi fi # OS X Lion started deprecating the system openssl. Let's just disable @@ -4673,8 +4771,8 @@ -macro_version='2.4' -macro_revision='1.3293' +macro_version='2.4.2' +macro_revision='1.3337' @@ -5307,6 +5405,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -5346,7 +5449,7 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -5775,7 +5878,7 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -6415,13 +6518,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -6568,6 +6671,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -6956,7 +7060,7 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -6967,7 +7071,20 @@ case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -7607,7 +7724,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -7618,6 +7741,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : @@ -7650,6 +7774,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : @@ -7671,7 +7796,9 @@ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -7938,7 +8065,22 @@ # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else pic_mode=default fi @@ -8016,6 +8158,10 @@ + + + + test -z "$LN_S" && LN_S="ln -s" @@ -8475,7 +8621,9 @@ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi ;; esac else @@ -8566,18 +8714,33 @@ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; esac ;; esac @@ -8939,7 +9102,6 @@ hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -9189,8 +9351,7 @@ xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ @@ -9569,6 +9730,7 @@ # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' @@ -9614,6 +9776,7 @@ hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else whole_archive_flag_spec='' fi @@ -9642,10 +9805,6 @@ hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -9658,7 +9817,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -9697,7 +9856,6 @@ fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -10321,11 +10479,6 @@ - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -10415,7 +10568,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -10424,7 +10577,7 @@ ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -10489,7 +10642,7 @@ ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -10628,7 +10781,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -10636,10 +10789,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10647,7 +10796,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -10665,7 +10814,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -10685,17 +10834,18 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -10756,7 +10906,7 @@ ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -10772,7 +10922,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -10809,9 +10959,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10897,7 +11047,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -10966,7 +11116,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10991,7 +11141,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -11015,7 +11165,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -11046,7 +11196,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -11056,7 +11206,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -11838,6 +11988,8 @@ + + ac_config_commands="$ac_config_commands libtool" @@ -12291,6 +12443,7 @@ + for ac_header in openssl/bio.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/bio.h" "ac_cv_header_openssl_bio_h" "$ac_includes_default" @@ -12338,7 +12491,7 @@ ac_res="none required" else ac_res=-l$ac_lib - LIBS="-l$ac_lib -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $ac_func_search_save_LIBS" + LIBS="-l$ac_lib -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_SSL_new=$ac_res @@ -12363,7 +12516,7 @@ if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" have_openssl=yes - OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32" + OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD" $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h @@ -12500,6 +12653,18 @@ done +for ac_header in sys/stat.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_STAT_H 1 +_ACEOF + +fi + +done + for ac_header in sys/sysctl.h do : ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " @@ -12967,7 +13132,7 @@ fi done -for ac_func in getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv +for ac_func in getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -12979,6 +13144,17 @@ fi done +for ac_func in umask +do : + ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask" +if test "x$ac_cv_func_umask" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UMASK 1 +_ACEOF + +fi +done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 $as_echo_n "checking for getaddrinfo... " >&6; } @@ -14795,27 +14971,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - -#if !defined(__clang__) || (__clang_major__ > 2) || (__clang_major__ == 2 && __clang_minor__ > 9) -#error -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_clang29orlower=yes -else - have_clang29orlower=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror" CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing" @@ -14830,10 +14985,8 @@ CFLAGS="$CFLAGS -Waddress" fi - if test x$have_gcc42 = xyes && test x$have_clang29orlower = xno; then + if test x$have_gcc42 = xyes && test x$have_clang = xno; then # These warnings break gcc 4.0.2 and clang, but work on gcc 4.2 - # We only disable these for clang 2.9 and lower, in case they are - # supported in later versions. CFLAGS="$CFLAGS -Wnormalized=id -Woverride-init" fi @@ -15740,6 +15893,7 @@ enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' @@ -15822,7 +15976,6 @@ allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' @@ -15878,6 +16031,7 @@ # Quote evaled strings. for var in SHELL \ ECHO \ +PATH_SEPARATOR \ SED \ GREP \ EGREP \ @@ -15928,7 +16082,6 @@ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ @@ -16730,8 +16883,8 @@ # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -16785,6 +16938,9 @@ # An echo program that protects backslashes. ECHO=$lt_ECHO +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + # The host system. host_alias=$host_alias host=$host @@ -17086,10 +17242,6 @@ # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator diff -Nru libevent-2.0.16-stable/configure.in libevent-2.0.21-stable/configure.in --- libevent-2.0.16-stable/configure.in 2011-11-18 20:16:54.000000000 +0000 +++ libevent-2.0.21-stable/configure.in 2012-11-18 06:34:13.000000000 +0000 @@ -1,13 +1,19 @@ dnl configure.in for libevent -dnl Dug Song +dnl Copyright 2000-2007 Niels Provos +dnl Copyright 2007-2012 Niels Provos and Nick Mathewson +dnl +dnl See LICENSE for copying information. +dnl +dnl Original version Dug Song + AC_PREREQ(2.59c) AC_INIT(event.c) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE(libevent,2.0.16-stable) +AM_INIT_AUTOMAKE(libevent,2.0.21-stable) AM_CONFIG_HEADER(config.h) -AC_DEFINE(NUMERIC_VERSION, 0x02001000, [Numeric representation of the version]) +AC_DEFINE(NUMERIC_VERSION, 0x02001500, [Numeric representation of the version]) dnl Initialize prefix. if test "$prefix" = "NONE"; then @@ -29,18 +35,28 @@ dnl Checks for programs. AC_PROG_CC AM_PROG_CC_C_O +AC_PROG_SED AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_GCC_TRADITIONAL +# We need to test for at least gcc 2.95 here, because older versions don't +# have -fno-strict-aliasing +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ +#if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) +#error +#endif])], have_gcc295=yes, have_gcc295=no) + if test "$GCC" = "yes" ; then # Enable many gcc warnings by default... CFLAGS="$CFLAGS -Wall" # And disable the strict-aliasing optimization, since it breaks # our sockaddr-handling code in strange ways. - CFLAGS="$CFLAGS -fno-strict-aliasing" + if test x$have_gcc295 = xyes; then + CFLAGS="$CFLAGS -fno-strict-aliasing" + fi fi # OS X Lion started deprecating the system openssl. Let's just disable @@ -148,6 +164,7 @@ fi AC_SUBST(EV_LIB_WS32) AC_SUBST(EV_LIB_GDI) +AC_SUBST(OPENSSL_LIBADD) AC_CHECK_HEADERS([openssl/bio.h]) @@ -158,10 +175,10 @@ have_openssl=no AC_SEARCH_LIBS([SSL_new], [ssl], [have_openssl=yes - OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32" + OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD" AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])], [have_openssl=no], - [-lcrypto $EV_LIB_GDI $EV_LIB_WS32]) + [-lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD]) LIBS="$save_LIBS" AC_SUBST(OPENSSL_LIBS) fi @@ -169,6 +186,7 @@ dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdarg.h inttypes.h stdint.h stddef.h poll.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in.h netinet/in6.h sys/socket.h sys/uio.h arpa/inet.h sys/eventfd.h sys/mman.h sys/sendfile.h sys/wait.h netdb.h]) +AC_CHECK_HEADERS([sys/stat.h]) AC_CHECK_HEADERS(sys/sysctl.h, [], [], [ #ifdef HAVE_SYS_PARAM_H #include @@ -267,7 +285,8 @@ dnl Checks for library functions. AC_CHECK_FUNCS([gettimeofday vasprintf fcntl clock_gettime strtok_r strsep]) -AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv]) +AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl]) +AC_CHECK_FUNCS([umask]) AC_CACHE_CHECK( [for getaddrinfo], @@ -673,11 +692,6 @@ #error #endif])], have_clang=yes, have_clang=no) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ -#if !defined(__clang__) || (__clang_major__ > 2) || (__clang_major__ == 2 && __clang_minor__ > 9) -#error -#endif])], have_clang29orlower=yes, have_clang29orlower=no) - CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror" CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing" @@ -692,10 +706,8 @@ CFLAGS="$CFLAGS -Waddress" fi - if test x$have_gcc42 = xyes && test x$have_clang29orlower = xno; then + if test x$have_gcc42 = xyes && test x$have_clang = xno; then # These warnings break gcc 4.0.2 and clang, but work on gcc 4.2 - # We only disable these for clang 2.9 and lower, in case they are - # supported in later versions. CFLAGS="$CFLAGS -Wnormalized=id -Woverride-init" fi diff -Nru libevent-2.0.16-stable/debian/changelog libevent-2.0.21-stable/debian/changelog --- libevent-2.0.16-stable/debian/changelog 2011-11-28 04:39:34.000000000 +0000 +++ libevent-2.0.21-stable/debian/changelog 2014-05-15 00:11:51.000000000 +0000 @@ -1,3 +1,62 @@ +libevent (2.0.21-stable-1ubuntu1~precise0~fromtrusty0~danmbox1) precise; urgency=low + + * up + + -- Dan Muresan Thu, 15 May 2014 03:11:31 +0300 + +libevent (2.0.21-stable-1ubuntu1) trusty; urgency=medium + + * Build using dh-autoreconf. + * Fix build failure with autoconf-1.14. + + -- Matthias Klose Thu, 05 Dec 2013 16:09:05 +0100 + +libevent (2.0.21-stable-1) unstable; urgency=low + + * [dd23c3ce] Imported Upstream version 2.0.21-stable + - fix memleaks in evdns (closes: 679217) + * [bbc5530e] debian/control: use canonical VCS URL + + -- Leo Costela Sun, 19 May 2013 00:40:30 +0200 + +libevent (2.0.19-stable-3) unstable; urgency=low + + * [ceb52d98] DH compatibility level is 9 + * [7792ab18] Support multiarch (Closes: #675320) + + -- Anibal Monsalve Salazar Sat, 02 Jun 2012 13:27:56 +1000 + +libevent (2.0.19-stable-2) unstable; urgency=low + + * [cbdbe5b8] add hardening build-flags (Closes: 673707) + * [b5f4e321] change default compression to xz + + -- Leo Costela Mon, 21 May 2012 00:16:59 +0200 + +libevent (2.0.19-stable-1) unstable; urgency=low + + * [21c5f34e] Imported Upstream version 2.0.19-stable + * [aad0456e] debian/watch: only check stable versions + * [09bb9c1d] debian/control: bump policy to 3.9.3 (no changes) + + -- Leo Costela Mon, 07 May 2012 15:54:12 +0200 + +libevent (2.0.18-stable-1) unstable; urgency=low + + * [d094fba3] Imported Upstream version 2.0.18-stable + * [6717e7ac] correct vcs-browse link + + -- Leo Costela Fri, 30 Mar 2012 16:24:30 +0200 + +libevent (2.0.17-stable-1) unstable; urgency=low + + * [98fed68d] Imported Upstream version 2.0.17-stable + * [82af6f34] update homepage to libevent.org + * [becd7e37] re-adding multiarch to TODO + * [8b2c71ac] shlibs: correct minimal version for current API (2.0.10) + + -- Leo Costela Mon, 13 Feb 2012 23:32:24 +0100 + libevent (2.0.16-stable-1) unstable; urgency=low * New upstream version 2.0.16-stable diff -Nru libevent-2.0.16-stable/debian/compat libevent-2.0.21-stable/debian/compat --- libevent-2.0.16-stable/debian/compat 2011-06-17 14:01:01.000000000 +0000 +++ libevent-2.0.21-stable/debian/compat 2012-06-03 00:42:42.000000000 +0000 @@ -1 +1 @@ -8 +9 diff -Nru libevent-2.0.16-stable/debian/control libevent-2.0.21-stable/debian/control --- libevent-2.0.16-stable/debian/control 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/control 2013-12-05 15:09:41.000000000 +0000 @@ -3,11 +3,11 @@ Priority: optional Maintainer: Anibal Monsalve Salazar Uploaders: Leo Costela -Build-Depends: debhelper (>= 8), autotools-dev, libssl-dev -Standards-Version: 3.9.2 -Homepage: http://www.monkey.org/~provos/libevent/ -Vcs-Browser: http://anonscm.debian.org/git/collab-maint/libevent.git -Vcs-Git: git://git.debian.org/git/collab-maint/libevent.git +Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), autotools-dev, libssl-dev, dh-autoreconf +Standards-Version: 3.9.3 +Homepage: http://libevent.org/ +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/libevent.git +Vcs-Git: git://anonscm.debian.org/collab-maint/libevent.git Package: libevent-dev Section: libdevel @@ -28,6 +28,7 @@ Section: debug Priority: extra Architecture: any +Multi-Arch: same Depends: ${misc:Depends}, libevent-2.0-5 (= ${binary:Version}), libevent-core-2.0-5 (= ${binary:Version}), libevent-extra-2.0-5 (= ${binary:Version}), @@ -43,6 +44,8 @@ Package: libevent-2.0-5 Priority: standard Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} Description: Asynchronous event notification library Libevent is an asynchronous event notification library that provides a @@ -60,6 +63,8 @@ Package: libevent-core-2.0-5 Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} Description: Asynchronous event notification library (core) Libevent is an asynchronous event notification library that provides a @@ -78,6 +83,8 @@ Package: libevent-extra-2.0-5 Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libevent-core-2.0-5 (= ${binary:Version}) Description: Asynchronous event notification library (extra) @@ -97,6 +104,8 @@ Package: libevent-pthreads-2.0-5 Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libevent-core-2.0-5 (= ${binary:Version}) Description: Asynchronous event notification library (pthreads) @@ -114,6 +123,8 @@ Package: libevent-openssl-2.0-5 Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libevent-core-2.0-5 (= ${binary:Version}) Description: Asynchronous event notification library (openssl) diff -Nru libevent-2.0.16-stable/debian/copyright libevent-2.0.21-stable/debian/copyright --- libevent-2.0.16-stable/debian/copyright 2009-05-23 05:37:21.000000000 +0000 +++ libevent-2.0.21-stable/debian/copyright 2012-09-08 11:49:31.000000000 +0000 @@ -1,7 +1,7 @@ This package was debianized by Simon Law on Tue, 30 Jul 2002 02:30:23 -0400. -It was downloaded from http://www.monkey.org/~provos/libevent/ +It was downloaded from http://libevent.org Upstream Author: Niels Provos diff -Nru libevent-2.0.16-stable/debian/libevent-2.0-5.install libevent-2.0.21-stable/debian/libevent-2.0-5.install --- libevent-2.0.16-stable/debian/libevent-2.0-5.install 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-2.0-5.install 2012-06-03 00:42:42.000000000 +0000 @@ -1 +1 @@ -usr/lib/libevent-2.0.so.* +usr/lib/*/libevent-2.0.so.* diff -Nru libevent-2.0.16-stable/debian/libevent-2.0-5.shlibs libevent-2.0.21-stable/debian/libevent-2.0-5.shlibs --- libevent-2.0.16-stable/debian/libevent-2.0-5.shlibs 2011-11-28 04:36:34.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-2.0-5.shlibs 2012-02-13 22:10:20.000000000 +0000 @@ -1 +1 @@ -libevent-2.0 5 libevent-2.0-5 (>= 2.0.16-stable) +libevent-2.0 5 libevent-2.0-5 (>= 2.0.10-stable) diff -Nru libevent-2.0.16-stable/debian/libevent-core-2.0-5.install libevent-2.0.21-stable/debian/libevent-core-2.0-5.install --- libevent-2.0.16-stable/debian/libevent-core-2.0-5.install 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-core-2.0-5.install 2012-06-03 00:42:42.000000000 +0000 @@ -1 +1 @@ -usr/lib/libevent_core-2.0.so.* +usr/lib/*/libevent_core-2.0.so.* diff -Nru libevent-2.0.16-stable/debian/libevent-core-2.0-5.shlibs libevent-2.0.21-stable/debian/libevent-core-2.0-5.shlibs --- libevent-2.0.16-stable/debian/libevent-core-2.0-5.shlibs 2011-11-28 04:36:45.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-core-2.0-5.shlibs 2012-02-13 22:10:45.000000000 +0000 @@ -1 +1 @@ -libevent_core-2.0 5 libevent-core-2.0-5 (>= 2.0.16-stable) +libevent_core-2.0 5 libevent-core-2.0-5 (>= 2.0.10-stable) diff -Nru libevent-2.0.16-stable/debian/libevent-dev.install libevent-2.0.21-stable/debian/libevent-dev.install --- libevent-2.0.16-stable/debian/libevent-dev.install 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-dev.install 2012-06-03 00:42:42.000000000 +0000 @@ -1,4 +1,4 @@ usr/include/* -usr/lib/lib*.a -usr/lib/lib*.so -usr/lib/pkgconfig/*.pc +usr/lib/*/lib*.a +usr/lib/*/lib*.so +usr/lib/*/pkgconfig/*.pc diff -Nru libevent-2.0.16-stable/debian/libevent-extra-2.0-5.install libevent-2.0.21-stable/debian/libevent-extra-2.0-5.install --- libevent-2.0.16-stable/debian/libevent-extra-2.0-5.install 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-extra-2.0-5.install 2012-06-03 00:42:42.000000000 +0000 @@ -1 +1 @@ -usr/lib/libevent_extra-2.0.so.* +usr/lib/*/libevent_extra-2.0.so.* diff -Nru libevent-2.0.16-stable/debian/libevent-extra-2.0-5.shlibs libevent-2.0.21-stable/debian/libevent-extra-2.0-5.shlibs --- libevent-2.0.16-stable/debian/libevent-extra-2.0-5.shlibs 2011-11-28 04:36:55.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-extra-2.0-5.shlibs 2012-02-13 22:10:53.000000000 +0000 @@ -1 +1 @@ -libevent_extra-2.0 5 libevent-extra-2.0-5 (>= 2.0.16-stable) +libevent_extra-2.0 5 libevent-extra-2.0-5 (>= 2.0.10-stable) diff -Nru libevent-2.0.16-stable/debian/libevent-openssl-2.0-5.install libevent-2.0.21-stable/debian/libevent-openssl-2.0-5.install --- libevent-2.0.16-stable/debian/libevent-openssl-2.0-5.install 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-openssl-2.0-5.install 2012-06-03 00:42:42.000000000 +0000 @@ -1 +1 @@ -usr/lib/libevent_openssl-2.0.so.* +usr/lib/*/libevent_openssl-2.0.so.* diff -Nru libevent-2.0.16-stable/debian/libevent-openssl-2.0-5.shlibs libevent-2.0.21-stable/debian/libevent-openssl-2.0-5.shlibs --- libevent-2.0.16-stable/debian/libevent-openssl-2.0-5.shlibs 2011-11-28 04:37:05.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-openssl-2.0-5.shlibs 2012-02-13 22:11:03.000000000 +0000 @@ -1 +1 @@ -libevent_openssl-2.0 5 libevent-openssl-2.0-5 (>= 2.0.16-stable) +libevent_openssl-2.0 5 libevent-openssl-2.0-5 (>= 2.0.10-stable) diff -Nru libevent-2.0.16-stable/debian/libevent-pthreads-2.0-5.install libevent-2.0.21-stable/debian/libevent-pthreads-2.0-5.install --- libevent-2.0.16-stable/debian/libevent-pthreads-2.0-5.install 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-pthreads-2.0-5.install 2012-06-03 00:42:42.000000000 +0000 @@ -1 +1 @@ -usr/lib/libevent_pthreads-2.0.so* +usr/lib/*/libevent_pthreads-2.0.so* diff -Nru libevent-2.0.16-stable/debian/libevent-pthreads-2.0-5.shlibs libevent-2.0.21-stable/debian/libevent-pthreads-2.0-5.shlibs --- libevent-2.0.16-stable/debian/libevent-pthreads-2.0-5.shlibs 2011-11-28 04:37:19.000000000 +0000 +++ libevent-2.0.21-stable/debian/libevent-pthreads-2.0-5.shlibs 2012-02-13 22:11:10.000000000 +0000 @@ -1 +1 @@ -libevent_pthreads-2.0 5 libevent-pthreads-2.0-5 (>= 2.0.16-stable) +libevent_pthreads-2.0 5 libevent-pthreads-2.0-5 (>= 2.0.10-stable) diff -Nru libevent-2.0.16-stable/debian/patches/automake.diff libevent-2.0.21-stable/debian/patches/automake.diff --- libevent-2.0.16-stable/debian/patches/automake.diff 1970-01-01 00:00:00.000000000 +0000 +++ libevent-2.0.21-stable/debian/patches/automake.diff 2013-12-05 15:22:58.000000000 +0000 @@ -0,0 +1,18 @@ +--- a/test/Makefile.am ++++ b/test/Makefile.am +@@ -19,7 +19,14 @@ + EXTRA_PROGRAMS = regress + noinst_HEADERS = tinytest.h tinytest_macros.h regress.h tinytest_local.h + +-TESTS = $(top_srcdir)/test/test.sh ++# We need to copy this file, since automake doesn't want us to use top_srcdir ++# in TESTS. ++TESTS = test-script.sh ++ ++test-script.sh: test.sh ++ cp $< $@ ++ ++DISTCLEANFILES = test-script.sh + + BUILT_SOURCES = + if BUILD_REGRESS diff -Nru libevent-2.0.16-stable/debian/patches/series libevent-2.0.21-stable/debian/patches/series --- libevent-2.0.16-stable/debian/patches/series 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/patches/series 2013-12-05 15:23:24.000000000 +0000 @@ -1 +1,2 @@ build_with_no_undefined.patch +automake.diff diff -Nru libevent-2.0.16-stable/debian/rules libevent-2.0.21-stable/debian/rules --- libevent-2.0.16-stable/debian/rules 2011-08-28 04:43:08.000000000 +0000 +++ libevent-2.0.21-stable/debian/rules 2013-12-05 15:09:04.000000000 +0000 @@ -1,13 +1,16 @@ #!/usr/bin/make -f #export DH_VERBOSE=1 -LDFLAGS = -Wl,--as-needed,-z,defs,--no-add-needed +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed,--no-undefined,--no-add-needed %: - dh $@ --with autotools-dev + dh $@ --with autoreconf override_dh_auto_configure: - dh_auto_configure -- --disable-libevent-regress + dh_auto_configure -- \ + --disable-libevent-regress \ + $(shell dpkg-buildflags --export=configure) override_dh_strip: dh_strip --dbg-package=libevent-dbg diff -Nru libevent-2.0.16-stable/debian/source/options libevent-2.0.21-stable/debian/source/options --- libevent-2.0.16-stable/debian/source/options 2011-06-17 14:01:01.000000000 +0000 +++ libevent-2.0.21-stable/debian/source/options 2012-05-21 02:00:08.000000000 +0000 @@ -1 +1 @@ -compression = "bzip2" +compression = "xz" diff -Nru libevent-2.0.16-stable/debian/TODO libevent-2.0.21-stable/debian/TODO --- libevent-2.0.16-stable/debian/TODO 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/TODO 2012-09-08 11:32:56.000000000 +0000 @@ -1 +1,2 @@ * DEP-5-ize debian/copyright +* shlibs diff -Nru libevent-2.0.16-stable/debian/watch libevent-2.0.21-stable/debian/watch --- libevent-2.0.16-stable/debian/watch 2011-06-17 14:01:02.000000000 +0000 +++ libevent-2.0.21-stable/debian/watch 2013-05-18 23:06:40.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://monkey.org/~provos/libevent/ ../libevent-(.*?).tar.gz debian uupdate +http://libevent.org .*/libevent-(.*?-stable).tar.gz debian uupdate diff -Nru libevent-2.0.16-stable/defer-internal.h libevent-2.0.21-stable/defer-internal.h --- libevent-2.0.16-stable/defer-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/defer-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/depcomp libevent-2.0.21-stable/depcomp --- libevent-2.0.16-stable/depcomp 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/depcomp 2012-11-19 15:13:17.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-03-27.16; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,11 +40,11 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -57,6 +57,12 @@ ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -90,10 +96,24 @@ # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" + cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -148,20 +168,21 @@ ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -193,18 +214,15 @@ # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -216,10 +234,17 @@ rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` @@ -249,12 +274,11 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -265,23 +289,26 @@ ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -290,15 +317,21 @@ exit $stat fi rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -334,7 +367,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -349,9 +382,9 @@ tru64) # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. + # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= @@ -397,14 +430,59 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -422,7 +500,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -442,15 +520,14 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -503,9 +580,10 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -525,7 +603,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -594,8 +672,8 @@ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru libevent-2.0.16-stable/devpoll.c libevent-2.0.21-stable/devpoll.c --- libevent-2.0.16-stable/devpoll.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/devpoll.c 2012-02-12 02:10:22.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2000-2009 Niels Provos - * Copyright 2009-2011 Niels Provos and Nick Mathewson + * Copyright 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -129,7 +129,7 @@ nfiles = rl.rlim_cur; /* Initialize the kernel queue */ - if ((dpfd = open("/dev/poll", O_RDWR)) == -1) { + if ((dpfd = evutil_open_closeonexec("/dev/poll", O_RDWR, 0)) == -1) { event_warn("open: /dev/poll"); mm_free(devpollop); return (NULL); diff -Nru libevent-2.0.16-stable/epoll.c libevent-2.0.21-stable/epoll.c --- libevent-2.0.16-stable/epoll.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/epoll.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2011 Niels Provos, Nick Mathewson + * Copyright 2007-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/epoll_sub.c libevent-2.0.21-stable/epoll_sub.c --- libevent-2.0.16-stable/epoll_sub.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/epoll_sub.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2003-2009 Niels Provos - * Copyright 2009-2011 Niels Provos and Nick Mathewson + * Copyright 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evbuffer-internal.h libevent-2.0.21-stable/evbuffer-internal.h --- libevent-2.0.16-stable/evbuffer-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evbuffer-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evdns.c libevent-2.0.21-stable/evdns.c --- libevent-2.0.16-stable/evdns.c 2011-10-21 22:25:20.000000000 +0000 +++ libevent-2.0.21-stable/evdns.c 2012-11-01 18:00:11.000000000 +0000 @@ -1,18 +1,32 @@ -/* $Id: evdns.c 6979 2006-08-04 18:31:13Z nickm $ */ - -/* The original version of this module was written by Adam Langley; for - * a history of modifications, check out the subversion logs. +/* Copyright 2006-2007 Niels Provos + * Copyright 2007-2012 Nick Mathewson and Niels Provos * - * When editing this module, try to keep it re-mergeable by Adam. Don't - * reformat the whitespace, add Tor dependencies, or so on. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. * - * TODO: - * - Support IPv6 and PTR records. - * - Replace all externally visible magic numbers with #defined constants. - * - Write documentation for APIs of all external functions. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* Async DNS Library +/* Based on software by Adam Langly. Adam's original message: + * + * Async DNS Library * Adam Langley * http://www.imperialviolet.org/eventdns.html * Public Domain code @@ -167,6 +181,7 @@ struct nameserver *ns; /* the server which we last sent it */ /* these objects are kept in a circular list */ + /* XXX We could turn this into a CIRCLEQ. */ struct request *next, *prev; struct event timeout_event; @@ -881,7 +896,12 @@ addrbuf, sizeof(addrbuf))); break; default: - /* we got a good reply from the nameserver */ + /* we got a good reply from the nameserver: it is up. */ + if (req->handle == req->ns->probe_request) { + /* Avoid double-free */ + req->ns->probe_request = NULL; + } + nameserver_up(req->ns); } @@ -2118,9 +2138,8 @@ static void evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) { struct request *const req = (struct request *) arg; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT struct evdns_base *base = req->base; -#endif + (void) fd; (void) events; @@ -2135,11 +2154,19 @@ if (req->tx_count >= req->base->global_max_retransmits) { /* this request has failed */ + log(EVDNS_LOG_DEBUG, "Giving up on request %p; tx_count==%d", + arg, req->tx_count); reply_schedule_callback(req, 0, DNS_ERR_TIMEOUT, NULL); request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1); } else { /* retransmit it */ + struct nameserver *new_ns; + log(EVDNS_LOG_DEBUG, "Retransmitting request %p; tx_count==%d", + arg, req->tx_count); (void) evtimer_del(&req->timeout_event); + new_ns = nameserver_pick(base); + if (new_ns) + req->ns = new_ns; evdns_request_transmit(req); } EVDNS_UNLOCK(base); @@ -2209,7 +2236,7 @@ default: /* all ok */ log(EVDNS_LOG_DEBUG, - "Setting timeout for request %p", req); + "Setting timeout for request %p, sent to nameserver %p", req, req->ns); if (evtimer_add(&req->timeout_event, &req->base->global_timeout) < 0) { log(EVDNS_LOG_WARN, "Error from libevent when adding timer for request %p", @@ -2230,13 +2257,16 @@ (void) ttl; (void) addresses; - EVDNS_LOCK(ns->base); - ns->probe_request = NULL; if (result == DNS_ERR_CANCEL) { /* We canceled this request because the nameserver came up * for some other reason. Do not change our opinion about * the nameserver. */ - } else if (result == DNS_ERR_NONE || result == DNS_ERR_NOTEXIST) { + return; + } + + EVDNS_LOCK(ns->base); + ns->probe_request = NULL; + if (result == DNS_ERR_NONE || result == DNS_ERR_NOTEXIST) { /* this is a good reply */ nameserver_up(ns); } else { @@ -2261,7 +2291,10 @@ handle = mm_calloc(1, sizeof(*handle)); if (!handle) return; req = request_new(ns->base, handle, TYPE_A, "google.com", DNS_QUERY_NO_SEARCH, nameserver_probe_callback, ns); - if (!req) return; + if (!req) { + mm_free(handle); + return; + } ns->probe_request = handle; /* we force this into the inflight queue no matter what */ request_trans_id_set(req, transaction_id_pick(ns->base)); @@ -2341,6 +2374,10 @@ (void) event_del(&server->event); if (evtimer_initialized(&server->timeout_event)) (void) evtimer_del(&server->timeout_event); + if (server->probe_request) { + evdns_cancel_request(server->base, server->probe_request); + server->probe_request = NULL; + } if (server->socket >= 0) evutil_closesocket(server->socket); mm_free(server); @@ -2461,8 +2498,8 @@ goto out2; } - log(EVDNS_LOG_DEBUG, "Added nameserver %s", - evutil_format_sockaddr_port(address, addrbuf, sizeof(addrbuf))); + log(EVDNS_LOG_DEBUG, "Added nameserver %s as %p", + evutil_format_sockaddr_port(address, addrbuf, sizeof(addrbuf)), ns); /* insert this nameserver into the list of them */ if (!base->server_head) { @@ -2472,9 +2509,7 @@ ns->next = base->server_head->next; ns->prev = base->server_head; base->server_head->next = ns; - if (base->server_head->prev == base->server_head) { - base->server_head->prev = ns; - } + ns->next->prev = ns; } base->global_good_nameservers++; @@ -2497,6 +2532,7 @@ { struct sockaddr_in sin; int res; + memset(&sin, 0, sizeof(sin)); sin.sin_addr.s_addr = address; sin.sin_port = htons(53); sin.sin_family = AF_INET; @@ -3123,6 +3159,8 @@ handle->search_origname = mm_strdup(name); if (handle->search_origname == NULL) { /* XXX Should we dealloc req? If yes, how? */ + if (req) + mm_free(req); return NULL; } handle->search_state = base->global_search_state; @@ -4181,6 +4219,8 @@ /* Cancel any pending requests, and note which one */ if (data->ipv4_request.r) { + /* XXXX This does nothing if the request's callback is already + * running (pending_cb is set). */ evdns_cancel_request(NULL, data->ipv4_request.r); v4_timedout = 1; EVDNS_LOCK(data->evdns_base); @@ -4188,6 +4228,8 @@ EVDNS_UNLOCK(data->evdns_base); } if (data->ipv6_request.r) { + /* XXXX This does nothing if the request's callback is already + * running (pending_cb is set). */ evdns_cancel_request(NULL, data->ipv6_request.r); v6_timedout = 1; EVDNS_LOCK(data->evdns_base); @@ -4211,6 +4253,10 @@ data->user_cb(e, NULL, data->user_data); } + data->user_cb = NULL; /* prevent double-call if evdns callbacks are + * in-progress. XXXX It would be better if this + * weren't necessary. */ + if (!v4_timedout && !v6_timedout) { /* should be impossible? XXXX */ free_getaddrinfo_request(data); @@ -4281,6 +4327,13 @@ return; } + if (data->user_cb == NULL) { + /* We already answered. XXXX This shouldn't be needed; see + * comments in evdns_getaddrinfo_timeout_cb */ + free_getaddrinfo_request(data); + return; + } + if (result == DNS_ERR_NONE) { if (count == 0) err = EVUTIL_EAI_NODATA; diff -Nru libevent-2.0.16-stable/evdns.h libevent-2.0.21-stable/evdns.h --- libevent-2.0.16-stable/evdns.h 2011-11-14 17:15:09.000000000 +0000 +++ libevent-2.0.21-stable/evdns.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/event.c libevent-2.0.21-stable/event.c --- libevent-2.0.16-stable/event.c 2011-11-15 21:24:05.000000000 +0000 +++ libevent-2.0.21-stable/event.c 2012-11-17 00:22:19.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -240,9 +240,10 @@ } else { \ event_errx(_EVENT_ERR_ABORT, \ "%s: noting an add on a non-setup event %p" \ - " (events: 0x%x, fd: %d, flags: 0x%x)", \ + " (events: 0x%x, fd: "EV_SOCK_FMT \ + ", flags: 0x%x)", \ __func__, (ev), (ev)->ev_events, \ - (ev)->ev_fd, (ev)->ev_flags); \ + EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \ } \ EVLOCK_UNLOCK(_event_debug_map_lock, 0); \ } \ @@ -260,9 +261,10 @@ } else { \ event_errx(_EVENT_ERR_ABORT, \ "%s: noting a del on a non-setup event %p" \ - " (events: 0x%x, fd: %d, flags: 0x%x)", \ + " (events: 0x%x, fd: "EV_SOCK_FMT \ + ", flags: 0x%x)", \ __func__, (ev), (ev)->ev_events, \ - (ev)->ev_fd, (ev)->ev_flags); \ + EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \ } \ EVLOCK_UNLOCK(_event_debug_map_lock, 0); \ } \ @@ -278,9 +280,10 @@ if (!dent) { \ event_errx(_EVENT_ERR_ABORT, \ "%s called on a non-initialized event %p" \ - " (events: 0x%x, fd: %d, flags: 0x%x)", \ + " (events: 0x%x, fd: "EV_SOCK_FMT\ + ", flags: 0x%x)", \ __func__, (ev), (ev)->ev_events, \ - (ev)->ev_fd, (ev)->ev_flags); \ + EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \ } \ EVLOCK_UNLOCK(_event_debug_map_lock, 0); \ } \ @@ -296,9 +299,10 @@ if (dent && dent->added) { \ event_errx(_EVENT_ERR_ABORT, \ "%s called on an already added event %p" \ - " (events: 0x%x, fd: %d, flags: 0x%x)", \ + " (events: 0x%x, fd: "EV_SOCK_FMT", " \ + "flags: 0x%x)", \ __func__, (ev), (ev)->ev_events, \ - (ev)->ev_fd, (ev)->ev_flags); \ + EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \ } \ EVLOCK_UNLOCK(_event_debug_map_lock, 0); \ } \ @@ -820,6 +824,10 @@ if (base->sig.ev_signal.ev_flags & EVLIST_ACTIVE) event_queue_remove(base, &base->sig.ev_signal, EVLIST_ACTIVE); + if (base->sig.ev_signal_pair[0] != -1) + EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[0]); + if (base->sig.ev_signal_pair[1] != -1) + EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[1]); base->sig.ev_signal_added = 0; } if (base->th_notify_fd[0] != -1) { @@ -856,6 +864,13 @@ TAILQ_FOREACH(ev, &base->eventqueue, ev_next) { if (ev->ev_events & (EV_READ|EV_WRITE)) { + if (ev == &base->sig.ev_signal) { + /* If we run into the ev_signal event, it's only + * in eventqueue because some signal event was + * added, which made evsig_add re-add ev_signal. + * So don't double-add it. */ + continue; + } if (evmap_io_add(base, ev->ev_fd, ev) == -1) res = -1; } else if (ev->ev_events & EV_SIGNAL) { @@ -1038,21 +1053,25 @@ /* Allows deletes to work */ ncalls = ev->ev_ncalls; - ev->ev_pncalls = &ncalls; + if (ncalls != 0) + ev->ev_pncalls = &ncalls; EVBASE_RELEASE_LOCK(base, th_base_lock); while (ncalls) { ncalls--; ev->ev_ncalls = ncalls; if (ncalls == 0) ev->ev_pncalls = NULL; - (*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg); + (*ev->ev_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg); EVBASE_ACQUIRE_LOCK(base, th_base_lock); should_break = base->event_break; EVBASE_RELEASE_LOCK(base, th_base_lock); - if (should_break) + if (should_break) { + if (ncalls != 0) + ev->ev_pncalls = NULL; return; + } } } @@ -1243,12 +1262,12 @@ * ev_io_timeout after the last time it was _scheduled_ for, * not ev_io_timeout after _now_. If it fired for another * reason, though, the timeout ought to start ticking _now_. */ - struct timeval run_at; + struct timeval run_at, relative_to, delay, now; + ev_uint32_t usec_mask = 0; EVUTIL_ASSERT(is_same_common_timeout(&ev->ev_timeout, &ev->ev_io_timeout)); + gettime(base, &now); if (is_common_timeout(&ev->ev_timeout, base)) { - ev_uint32_t usec_mask; - struct timeval delay, relative_to; delay = ev->ev_io_timeout; usec_mask = delay.tv_usec & ~MICROSECONDS_MASK; delay.tv_usec &= MICROSECONDS_MASK; @@ -1256,24 +1275,30 @@ relative_to = ev->ev_timeout; relative_to.tv_usec &= MICROSECONDS_MASK; } else { - gettime(base, &relative_to); + relative_to = now; } - evutil_timeradd(&relative_to, &delay, &run_at); - run_at.tv_usec |= usec_mask; } else { - struct timeval relative_to; + delay = ev->ev_io_timeout; if (ev->ev_res & EV_TIMEOUT) { relative_to = ev->ev_timeout; } else { - gettime(base, &relative_to); + relative_to = now; } - evutil_timeradd(&ev->ev_io_timeout, &relative_to, - &run_at); } + evutil_timeradd(&relative_to, &delay, &run_at); + if (evutil_timercmp(&run_at, &now, <)) { + /* Looks like we missed at least one invocation due to + * a clock jump, not running the event loop for a + * while, really slow callbacks, or + * something. Reschedule relative to now. + */ + evutil_timeradd(&now, &delay, &run_at); + } + run_at.tv_usec |= usec_mask; event_add_internal(ev, &run_at, 1); } EVBASE_RELEASE_LOCK(base, th_base_lock); - (*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg); + (*ev->ev_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg); } /* @@ -1323,7 +1348,7 @@ case EV_CLOSURE_NONE: EVBASE_RELEASE_LOCK(base, th_base_lock); (*ev->ev_callback)( - (int)ev->ev_fd, ev->ev_res, ev->ev_arg); + ev->ev_fd, ev->ev_res, ev->ev_arg); break; } @@ -1338,6 +1363,8 @@ if (base->event_break) return -1; + if (base->event_continue) + break; } return count; } @@ -1388,11 +1415,13 @@ for (i = 0; i < base->nactivequeues; ++i) { if (TAILQ_FIRST(&base->activequeues[i]) != NULL) { + base->event_running_priority = i; activeq = &base->activequeues[i]; c = event_process_active_single_queue(base, activeq); - if (c < 0) + if (c < 0) { + base->event_running_priority = -1; return -1; - else if (c > 0) + } else if (c > 0) break; /* Processed a real event; do not * consider lower-priority events */ /* If we get here, all of the events we processed @@ -1401,6 +1430,7 @@ } event_process_deferred_callbacks(&base->defer_queue,&base->event_break); + base->event_running_priority = -1; return c; } @@ -1538,6 +1568,8 @@ base->event_gotterm = base->event_break = 0; while (!done) { + base->event_continue = 0; + /* Terminate the loop if we have been asked to */ if (base->event_gotterm) { break; @@ -1818,6 +1850,12 @@ { 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); if (ev->ev_flags & EVLIST_INSERTED) @@ -1841,6 +1879,8 @@ #endif } + EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock); + return (flags & event); } @@ -1995,9 +2035,9 @@ _event_debug_assert_is_setup(ev); event_debug(( - "event_add: event: %p (fd %d), %s%s%scall %p", + "event_add: event: %p (fd "EV_SOCK_FMT"), %s%s%scall %p", ev, - (int)ev->ev_fd, + EV_SOCK_ARG(ev->ev_fd), ev->ev_events & EV_READ ? "EV_READ " : " ", ev->ev_events & EV_WRITE ? "EV_WRITE " : " ", tv ? "EV_TIMEOUT " : " ", @@ -2159,8 +2199,8 @@ struct event_base *base; int res = 0, notify = 0; - event_debug(("event_del: %p (fd %d), callback %p", - ev, (int)ev->ev_fd, ev->ev_callback)); + event_debug(("event_del: %p (fd "EV_SOCK_FMT"), callback %p", + ev, EV_SOCK_ARG(ev->ev_fd), ev->ev_callback)); /* An event without a base has not been added */ if (ev->ev_base == NULL) @@ -2250,8 +2290,8 @@ { struct event_base *base; - event_debug(("event_active: %p (fd %d), res %d, callback %p", - ev, (int)ev->ev_fd, (int)res, ev->ev_callback)); + event_debug(("event_active: %p (fd "EV_SOCK_FMT"), res %d, callback %p", + ev, EV_SOCK_ARG(ev->ev_fd), (int)res, ev->ev_callback)); /* We get different kinds of events, add them together */ @@ -2266,6 +2306,9 @@ ev->ev_res = res; + if (ev->ev_pri < base->event_running_priority) + base->event_continue = 1; + if (ev->ev_events & EV_SIGNAL) { #ifndef _EVENT_DISABLE_THREAD_SUPPORT if (base->current_event == ev && !EVBASE_IN_THREAD(base)) { @@ -2462,8 +2505,8 @@ EVENT_BASE_ASSERT_LOCKED(base); if (!(ev->ev_flags & queue)) { - event_errx(1, "%s: %p(fd %d) not on queue %x", __func__, - ev, ev->ev_fd, queue); + event_errx(1, "%s: %p(fd "EV_SOCK_FMT") not on queue %x", __func__, + ev, EV_SOCK_ARG(ev->ev_fd), queue); return; } @@ -2536,8 +2579,8 @@ if (queue & EVLIST_ACTIVE) return; - event_errx(1, "%s: %p(fd %d) already on queue %x", __func__, - ev, ev->ev_fd, queue); + event_errx(1, "%s: %p(fd "EV_SOCK_FMT") already on queue %x", __func__, + ev, EV_SOCK_ARG(ev->ev_fd), queue); return; } @@ -2788,8 +2831,8 @@ int i; fprintf(output, "Inserted events:\n"); TAILQ_FOREACH(e, &base->eventqueue, ev_next) { - fprintf(output, " %p [fd %ld]%s%s%s%s%s\n", - (void*)e, (long)e->ev_fd, + fprintf(output, " %p [fd "EV_SOCK_FMT"]%s%s%s%s%s\n", + (void*)e, EV_SOCK_ARG(e->ev_fd), (e->ev_events&EV_READ)?" Read":"", (e->ev_events&EV_WRITE)?" Write":"", (e->ev_events&EV_SIGNAL)?" Signal":"", @@ -2802,8 +2845,8 @@ continue; fprintf(output, "Active events [priority %d]:\n", i); TAILQ_FOREACH(e, &base->eventqueue, ev_next) { - fprintf(output, " %p [fd %ld]%s%s%s%s\n", - (void*)e, (long)e->ev_fd, + fprintf(output, " %p [fd "EV_SOCK_FMT"]%s%s%s%s\n", + (void*)e, EV_SOCK_ARG(e->ev_fd), (e->ev_res&EV_READ)?" Read active":"", (e->ev_res&EV_WRITE)?" Write active":"", (e->ev_res&EV_SIGNAL)?" Signal active":"", @@ -2845,3 +2888,38 @@ return 0; } #endif + +void +event_base_assert_ok(struct event_base *base) +{ + int i; + EVBASE_ACQUIRE_LOCK(base, th_base_lock); + evmap_check_integrity(base); + + /* Check the heap property */ + for (i = 1; i < (int)base->timeheap.n; ++i) { + int parent = (i - 1) / 2; + struct event *ev, *p_ev; + ev = base->timeheap.p[i]; + p_ev = base->timeheap.p[parent]; + EVUTIL_ASSERT(ev->ev_flags & EV_TIMEOUT); + EVUTIL_ASSERT(evutil_timercmp(&p_ev->ev_timeout, &ev->ev_timeout, <=)); + EVUTIL_ASSERT(ev->ev_timeout_pos.min_heap_idx == i); + } + + /* Check that the common timeouts are fine */ + for (i = 0; i < base->n_common_timeouts; ++i) { + struct common_timeout_list *ctl = base->common_timeout_queues[i]; + struct event *last=NULL, *ev; + TAILQ_FOREACH(ev, &ctl->events, ev_timeout_pos.ev_next_with_common_timeout) { + if (last) + EVUTIL_ASSERT(evutil_timercmp(&last->ev_timeout, &ev->ev_timeout, <=)); + EVUTIL_ASSERT(ev->ev_flags & EV_TIMEOUT); + EVUTIL_ASSERT(is_common_timeout(&ev->ev_timeout,base)); + EVUTIL_ASSERT(COMMON_TIMEOUT_IDX(&ev->ev_timeout) == i); + last = ev; + } + } + + EVBASE_RELEASE_LOCK(base, th_base_lock); +} diff -Nru libevent-2.0.16-stable/event.h libevent-2.0.21-stable/event.h --- libevent-2.0.16-stable/event.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/event.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/event-internal.h libevent-2.0.21-stable/event-internal.h --- libevent-2.0.16-stable/event-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/event-internal.h 2012-05-01 21:05:51.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -196,6 +196,11 @@ int event_gotterm; /** Set if we should terminate the loop immediately */ int event_break; + /** Set if we should start a new instance of the loop immediately. */ + int event_continue; + + /** The currently running priority of events */ + int event_running_priority; /** Set if we're running the event_base_loop function, to prevent * reentrant invocation. */ @@ -347,6 +352,14 @@ void event_base_add_virtual(struct event_base *base); void event_base_del_virtual(struct event_base *base); +/** For debugging: unless assertions are disabled, verify the referential + integrity of the internal data structures of 'base'. This operation can + be expensive. + + Returns on success; aborts on failure. +*/ +void event_base_assert_ok(struct event_base *base); + #ifdef __cplusplus } #endif diff -Nru libevent-2.0.16-stable/event_iocp.c libevent-2.0.21-stable/event_iocp.c --- libevent-2.0.16-stable/event_iocp.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/event_iocp.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos, Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -183,7 +183,7 @@ if (n_cpus <= 0) n_cpus = N_CPUS_DEFAULT; port->n_threads = n_cpus * 2; - port->threads = calloc(port->n_threads, sizeof(HANDLE)); + port->threads = mm_calloc(port->n_threads, sizeof(HANDLE)); if (!port->threads) goto err; diff -Nru libevent-2.0.16-stable/event_rpcgen.py libevent-2.0.21-stable/event_rpcgen.py --- libevent-2.0.16-stable/event_rpcgen.py 2011-06-14 18:49:26.000000000 +0000 +++ libevent-2.0.21-stable/event_rpcgen.py 2012-11-01 18:00:11.000000000 +0000 @@ -1,6 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -# Copyright (c) 2005 Niels Provos +# Copyright (c) 2005-2007 Niels Provos +# Copyright (c) 2007-2012 Niels Provos and Nick Mathewson # All rights reserved. # # Generates marshaling code based on libevent. diff -Nru libevent-2.0.16-stable/event_tagging.c libevent-2.0.21-stable/event_tagging.c --- libevent-2.0.16-stable/event_tagging.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/event_tagging.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2003-2009 Niels Provos - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evhttp.h libevent-2.0.21-stable/evhttp.h --- libevent-2.0.16-stable/evhttp.h 2011-11-14 17:15:09.000000000 +0000 +++ libevent-2.0.21-stable/evhttp.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evmap.c libevent-2.0.21-stable/evmap.c --- libevent-2.0.16-stable/evmap.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evmap.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -725,3 +725,75 @@ return (0); } +void +evmap_check_integrity(struct event_base *base) +{ +#define EVLIST_X_SIGFOUND 0x1000 +#define EVLIST_X_IOFOUND 0x2000 + + evutil_socket_t i; + struct event *ev; + struct event_io_map *io = &base->io; + struct event_signal_map *sigmap = &base->sigmap; +#ifdef EVMAP_USE_HT + struct event_map_entry **mapent; +#endif + int nsignals, ntimers, nio; + nsignals = ntimers = nio = 0; + + TAILQ_FOREACH(ev, &base->eventqueue, ev_next) { + EVUTIL_ASSERT(ev->ev_flags & EVLIST_INSERTED); + EVUTIL_ASSERT(ev->ev_flags & EVLIST_INIT); + ev->ev_flags &= ~(EVLIST_X_SIGFOUND|EVLIST_X_IOFOUND); + } + +#ifdef EVMAP_USE_HT + HT_FOREACH(mapent, event_io_map, io) { + struct evmap_io *ctx = &(*mapent)->ent.evmap_io; + i = (*mapent)->fd; +#else + for (i = 0; i < io->nentries; ++i) { + struct evmap_io *ctx = io->entries[i]; + + if (!ctx) + continue; +#endif + + TAILQ_FOREACH(ev, &ctx->events, ev_io_next) { + EVUTIL_ASSERT(!(ev->ev_flags & EVLIST_X_IOFOUND)); + EVUTIL_ASSERT(ev->ev_fd == i); + ev->ev_flags |= EVLIST_X_IOFOUND; + nio++; + } + } + + for (i = 0; i < sigmap->nentries; ++i) { + struct evmap_signal *ctx = sigmap->entries[i]; + if (!ctx) + continue; + + TAILQ_FOREACH(ev, &ctx->events, ev_signal_next) { + EVUTIL_ASSERT(!(ev->ev_flags & EVLIST_X_SIGFOUND)); + EVUTIL_ASSERT(ev->ev_fd == i); + ev->ev_flags |= EVLIST_X_SIGFOUND; + nsignals++; + } + } + + TAILQ_FOREACH(ev, &base->eventqueue, ev_next) { + if (ev->ev_events & (EV_READ|EV_WRITE)) { + EVUTIL_ASSERT(ev->ev_flags & EVLIST_X_IOFOUND); + --nio; + } + if (ev->ev_events & EV_SIGNAL) { + EVUTIL_ASSERT(ev->ev_flags & EVLIST_X_SIGFOUND); + --nsignals; + } + } + + EVUTIL_ASSERT(nio == 0); + EVUTIL_ASSERT(nsignals == 0); + /* There is no "EVUTIL_ASSERT(ntimers == 0)": eventqueue is only for + * pending signals and io events. + */ +} diff -Nru libevent-2.0.16-stable/evmap-internal.h libevent-2.0.21-stable/evmap-internal.h --- libevent-2.0.16-stable/evmap-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evmap-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -87,4 +87,6 @@ void *evmap_io_get_fdinfo(struct event_io_map *ctx, evutil_socket_t fd); +void evmap_check_integrity(struct event_base *base); + #endif /* _EVMAP_H_ */ diff -Nru libevent-2.0.16-stable/evport.c libevent-2.0.21-stable/evport.c --- libevent-2.0.16-stable/evport.c 2011-03-03 17:55:15.000000000 +0000 +++ libevent-2.0.21-stable/evport.c 2012-02-10 22:23:30.000000000 +0000 @@ -1,6 +1,9 @@ /* * Submitted by David Pacheco (dp.spambait@gmail.com) * + * Copyright 2006-2007 Niels Provos + * Copyright 2007-2012 Niels Provos and Nick Mathewson + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: diff -Nru libevent-2.0.16-stable/evrpc.c libevent-2.0.21-stable/evrpc.c --- libevent-2.0.16-stable/evrpc.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evrpc.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evrpc.h libevent-2.0.21-stable/evrpc.h --- libevent-2.0.16-stable/evrpc.h 2011-11-14 17:15:09.000000000 +0000 +++ libevent-2.0.21-stable/evrpc.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evrpc-internal.h libevent-2.0.21-stable/evrpc-internal.h --- libevent-2.0.16-stable/evrpc-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evrpc-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2006-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evsignal-internal.h libevent-2.0.21-stable/evsignal-internal.h --- libevent-2.0.16-stable/evsignal-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evsignal-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evthread.c libevent-2.0.21-stable/evthread.c --- libevent-2.0.16-stable/evthread.c 2011-11-15 21:24:05.000000000 +0000 +++ libevent-2.0.21-stable/evthread.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2011 Niels Provos, Nick Mathewson + * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -84,7 +84,12 @@ } if (target->alloc) { /* Uh oh; we already had locking callbacks set up.*/ - if (!memcmp(target, cbs, sizeof(_evthread_lock_fns))) { + if (target->lock_api_version == cbs->lock_api_version && + target->supported_locktypes == cbs->supported_locktypes && + target->alloc == cbs->alloc && + target->free == cbs->free && + target->lock == cbs->lock && + target->unlock == cbs->unlock) { /* no change -- allow this. */ return 0; } @@ -117,7 +122,11 @@ } if (target->alloc_condition) { /* Uh oh; we already had condition callbacks set up.*/ - if (!memcmp(target, cbs, sizeof(_evthread_cond_fns))) { + if (target->condition_api_version == cbs->condition_api_version && + target->alloc_condition == cbs->alloc_condition && + target->free_condition == cbs->free_condition && + target->signal_condition == cbs->signal_condition && + target->wait_condition == cbs->wait_condition) { /* no change -- allow this. */ return 0; } diff -Nru libevent-2.0.16-stable/evthread-internal.h libevent-2.0.21-stable/evthread-internal.h --- libevent-2.0.16-stable/evthread-internal.h 2011-11-15 21:24:05.000000000 +0000 +++ libevent-2.0.21-stable/evthread-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2011 Niels Provos, Nick Mathewson + * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evthread_pthread.c libevent-2.0.21-stable/evthread_pthread.c --- libevent-2.0.16-stable/evthread_pthread.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evthread_pthread.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2009-2011 Niels Provos and Nick Mathewson + * Copyright 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evthread_win32.c libevent-2.0.21-stable/evthread_win32.c --- libevent-2.0.16-stable/evthread_win32.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evthread_win32.c 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2009-2011 Niels Provos and Nick Mathewson + * Copyright 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evutil.c libevent-2.0.21-stable/evutil.c --- libevent-2.0.16-stable/evutil.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evutil.c 2012-07-25 19:58:34.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -85,8 +85,33 @@ #define close _close #define fstat _fstati64 #define stat _stati64 +#define mode_t int #endif +int +evutil_open_closeonexec(const char *pathname, int flags, unsigned mode) +{ + int fd; + +#ifdef O_CLOEXEC + flags |= O_CLOEXEC; +#endif + + if (flags & O_CREAT) + fd = open(pathname, flags, (mode_t)mode); + else + fd = open(pathname, flags); + if (fd < 0) + return -1; + +#if !defined(O_CLOEXEC) && defined(FD_CLOEXEC) + if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) + return -1; +#endif + + return fd; +} + /** Read the contents of 'filename' into a newly allocated NUL-terminated string. Set *content_out to hold this string, and *len_out to hold its @@ -117,7 +142,7 @@ mode |= O_BINARY; #endif - fd = open(filename, mode); + fd = evutil_open_closeonexec(filename, mode, 0); if (fd < 0) return -1; if (fstat(fd, &st) || st.st_size < 0 || diff -Nru libevent-2.0.16-stable/evutil.h libevent-2.0.21-stable/evutil.h --- libevent-2.0.16-stable/evutil.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evutil.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/evutil_rand.c libevent-2.0.21-stable/evutil_rand.c --- libevent-2.0.16-stable/evutil_rand.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/evutil_rand.c 2012-08-02 15:36:53.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,10 +58,22 @@ static void ev_arc4random_buf(void *buf, size_t n) { -#ifdef _EVENT_HAVE_ARC4RANDOM_BUF +#if defined(_EVENT_HAVE_ARC4RANDOM_BUF) && !defined(__APPLE__) return arc4random_buf(buf, n); #else unsigned char *b = buf; + +#if defined(_EVENT_HAVE_ARC4RANDOM_BUF) + /* OSX 10.7 introducd arc4random_buf, so if you build your program + * there, you'll get surprised when older versions of OSX fail to run. + * To solve this, we can check whether the function pointer is set, + * and fall back otherwise. (OSX does this using some linker + * trickery.) + */ + if (arc4random_buf != NULL) { + return arc4random_buf(buf, n); + } +#endif /* Make sure that we start out with b at a 4-byte alignment; plenty * of CPUs care about this for 32-bit access. */ if (n >= 4 && ((ev_uintptr_t)b) & 3) { diff -Nru libevent-2.0.16-stable/ht-internal.h libevent-2.0.21-stable/ht-internal.h --- libevent-2.0.16-stable/ht-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/ht-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* Based on work Copyright 2002 Christopher Clark */ -/* Copyright 2005-2011 Nick Mathewson */ -/* Copyright 2009-2011 Niels Provos and Nick Mathewson */ +/* Copyright 2005-2012 Nick Mathewson */ +/* Copyright 2009-2012 Niels Provos and Nick Mathewson */ /* See license at end. */ /* Based on ideas by Christopher Clark and interfaces from Niels Provos. */ diff -Nru libevent-2.0.16-stable/http.c libevent-2.0.21-stable/http.c --- libevent-2.0.16-stable/http.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/http.c 2012-11-02 15:57:00.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2002-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1328,9 +1328,10 @@ switch (evcon->state) { case EVCON_CONNECTING: if (what & BEV_EVENT_TIMEOUT) { - event_debug(("%s: connection timeout for \"%s:%d\" on %d", + event_debug(("%s: connection timeout for \"%s:%d\" on " + EV_SOCK_FMT, __func__, evcon->address, evcon->port, - evcon->fd)); + EV_SOCK_ARG(evcon->fd))); evhttp_connection_cb_cleanup(evcon); return; } @@ -1405,21 +1406,25 @@ /* Check if the connection completed */ if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error, &errsz) == -1) { - event_debug(("%s: getsockopt for \"%s:%d\" on %d", - __func__, evcon->address, evcon->port, evcon->fd)); + event_debug(("%s: getsockopt for \"%s:%d\" on "EV_SOCK_FMT, + __func__, evcon->address, evcon->port, + EV_SOCK_ARG(evcon->fd))); goto cleanup; } if (error) { - event_debug(("%s: connect failed for \"%s:%d\" on %d: %s", - __func__, evcon->address, evcon->port, evcon->fd, + event_debug(("%s: connect failed for \"%s:%d\" on " + EV_SOCK_FMT": %s", + __func__, evcon->address, evcon->port, + EV_SOCK_ARG(evcon->fd), evutil_socket_error_to_string(error))); goto cleanup; } /* We are connected to the server now */ - event_debug(("%s: connected to \"%s:%d\" on %d\n", - __func__, evcon->address, evcon->port, evcon->fd)); + event_debug(("%s: connected to \"%s:%d\" on "EV_SOCK_FMT"\n", + __func__, evcon->address, evcon->port, + EV_SOCK_ARG(evcon->fd))); /* Reset the retry count as we were successful in connecting */ evcon->retry_cnt = 0; @@ -1469,7 +1474,7 @@ int major, minor; char ch; int n = sscanf(version, "HTTP/%d.%d%c", &major, &minor, &ch); - if (n > 2 || major > 1) { + if (n != 2 || major > 1) { event_debug(("%s: bad version %s on message %p from %s", __func__, version, req, req->remote_host)); return (-1); @@ -1974,8 +1979,8 @@ res = evhttp_parse_firstline(req, bufferevent_get_input(evcon->bufev)); if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) { /* Error while reading, terminate */ - event_debug(("%s: bad header lines on %d\n", - __func__, evcon->fd)); + event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n", + __func__, EV_SOCK_ARG(evcon->fd))); evhttp_connection_fail(evcon, EVCON_HTTP_INVALID_HEADER); return; } else if (res == MORE_DATA_EXPECTED) { @@ -1997,7 +2002,8 @@ res = evhttp_parse_headers(req, bufferevent_get_input(evcon->bufev)); if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) { /* Error while reading, terminate */ - event_debug(("%s: bad header lines on %d\n", __func__, fd)); + event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n", + __func__, EV_SOCK_ARG(fd))); evhttp_connection_fail(evcon, EVCON_HTTP_INVALID_HEADER); return; } else if (res == MORE_DATA_EXPECTED) { @@ -2011,8 +2017,8 @@ /* Done reading headers, do the real work */ switch (req->kind) { case EVHTTP_REQUEST: - event_debug(("%s: checking for post data on %d\n", - __func__, fd)); + event_debug(("%s: checking for post data on "EV_SOCK_FMT"\n", + __func__, EV_SOCK_ARG(fd))); evhttp_get_body(evcon, req); /* note the request may have been freed in evhttp_get_body */ break; @@ -2028,8 +2034,9 @@ __func__, req->response_code)); evhttp_connection_done(evcon); } else { - event_debug(("%s: start of read body for %s on %d\n", - __func__, req->remote_host, fd)); + event_debug(("%s: start of read body for %s on " + EV_SOCK_FMT"\n", + __func__, req->remote_host, EV_SOCK_ARG(fd))); evhttp_get_body(evcon, req); /* note the request may have been freed in * evhttp_get_body */ @@ -2037,7 +2044,8 @@ break; default: - event_warnx("%s: bad header on %d", __func__, fd); + event_warnx("%s: bad header on "EV_SOCK_FMT, __func__, + EV_SOCK_ARG(fd)); evhttp_connection_fail(evcon, EVCON_HTTP_INVALID_HEADER); break; } @@ -2117,6 +2125,12 @@ return (NULL); } +struct bufferevent * +evhttp_connection_get_bufferevent(struct evhttp_connection *evcon) +{ + return evcon->bufev; +} + void evhttp_connection_set_base(struct evhttp_connection *evcon, struct event_base *base) @@ -2679,9 +2693,8 @@ } evbuffer_add(buf, "", 1); /* NUL-terminator. */ result = mm_malloc(evbuffer_get_length(buf)); - if (!result) - return NULL; - evbuffer_remove(buf, result, evbuffer_get_length(buf)); + if (result) + evbuffer_remove(buf, result, evbuffer_get_length(buf)); evbuffer_free(buf); return (result); @@ -3670,8 +3683,8 @@ return (NULL); } - event_debug(("%s: new request from %s:%s on %d\n", - __func__, hostname, portname, fd)); + event_debug(("%s: new request from %s:%s on "EV_SOCK_FMT"\n", + __func__, hostname, portname, EV_SOCK_ARG(fd))); /* we need a connection object to put the http request on */ evcon = evhttp_connection_base_new( @@ -3737,7 +3750,8 @@ evcon = evhttp_get_request_connection(http, fd, sa, salen); if (evcon == NULL) { - event_sock_warn(fd, "%s: cannot get connection on %d", __func__, fd); + event_sock_warn(fd, "%s: cannot get connection on "EV_SOCK_FMT, + __func__, EV_SOCK_ARG(fd)); evutil_closesocket(fd); return; } @@ -3820,9 +3834,12 @@ if (evutil_make_socket_closeonexec(fd) < 0) goto out; - setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on)); - if (reuse) - evutil_make_listen_socket_reuseable(fd); + if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on))<0) + goto out; + if (reuse) { + if (evutil_make_listen_socket_reuseable(fd) < 0) + goto out; + } if (ai != NULL) { r = bind(fd, ai->ai_addr, (ev_socklen_t)ai->ai_addrlen); diff -Nru libevent-2.0.16-stable/http-internal.h libevent-2.0.21-stable/http-internal.h --- libevent-2.0.16-stable/http-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/http-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2001-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * This header file contains definitions for dealing with HTTP requests * that are internal to libevent. As user of the library, you should not diff -Nru libevent-2.0.16-stable/include/event2/buffer_compat.h libevent-2.0.21-stable/include/event2/buffer_compat.h --- libevent-2.0.16-stable/include/event2/buffer_compat.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/buffer_compat.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/bufferevent_compat.h libevent-2.0.21-stable/include/event2/bufferevent_compat.h --- libevent-2.0.16-stable/include/event2/bufferevent_compat.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/bufferevent_compat.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos, Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson * Copyright (c) 2000-2007 Niels Provos * All rights reserved. * diff -Nru libevent-2.0.16-stable/include/event2/bufferevent.h libevent-2.0.21-stable/include/event2/bufferevent.h --- libevent-2.0.16-stable/include/event2/bufferevent.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/bufferevent.h 2012-03-30 13:55:38.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -743,7 +743,7 @@ ev_ssize_t bufferevent_get_max_to_write(struct bufferevent *bev); /** - @name GrouprRate limit inspection + @name Group Rate limit inspection Return the read or write bucket size for a bufferevent rate limit group. Note that it can return a negative value if bufferevents in diff -Nru libevent-2.0.16-stable/include/event2/bufferevent_ssl.h libevent-2.0.21-stable/include/event2/bufferevent_ssl.h --- libevent-2.0.16-stable/include/event2/bufferevent_ssl.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/bufferevent_ssl.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/bufferevent_struct.h libevent-2.0.21-stable/include/event2/bufferevent_struct.h --- libevent-2.0.16-stable/include/event2/bufferevent_struct.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/bufferevent_struct.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/buffer.h libevent-2.0.21-stable/include/event2/buffer.h --- libevent-2.0.16-stable/include/event2/buffer.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/buffer.h 2012-07-16 19:32:38.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -488,7 +488,11 @@ @param ap a varargs va_list argument array that will be passed to vprintf(3) @return The number of bytes added if successful, or -1 if an error occurred. */ -int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap); +int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap) +#ifdef __GNUC__ + __attribute__((format(printf, 2, 0))) +#endif +; /** @@ -626,8 +630,10 @@ the buffer does not have as much data as you asked to see). @param buffer the evbuffer to peek into, - @param len the number of bytes to try to peek. If negative, we - will try to fill as much of vec_out as we can. + @param len the number of bytes to try to peek. If len is negative, we + will try to fill as much of vec_out as we can. If len is negative + and vec_out is not provided, we return the number of evbuffer_iovecs + that would be needed to get all the data in the buffer. @param start_at an evbuffer_ptr indicating the point at which we should start looking for data. NULL means, "At the start of the buffer." diff -Nru libevent-2.0.16-stable/include/event2/dns_compat.h libevent-2.0.21-stable/include/event2/dns_compat.h --- libevent-2.0.16-stable/include/event2/dns_compat.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/dns_compat.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2006-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/dns.h libevent-2.0.21-stable/include/event2/dns.h --- libevent-2.0.16-stable/include/event2/dns.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/dns.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2006-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/dns_struct.h libevent-2.0.21-stable/include/event2/dns_struct.h --- libevent-2.0.16-stable/include/event2/dns_struct.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/dns_struct.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/event_compat.h libevent-2.0.21-stable/include/event2/event_compat.h --- libevent-2.0.16-stable/include/event2/event_compat.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/event_compat.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/event.h libevent-2.0.21-stable/include/event2/event.h --- libevent-2.0.16-stable/include/event2/event.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/event.h 2012-04-03 22:03:47.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -563,12 +563,19 @@ /** @name Log severities */ /**@{*/ -#define _EVENT_LOG_DEBUG 0 -#define _EVENT_LOG_MSG 1 -#define _EVENT_LOG_WARN 2 -#define _EVENT_LOG_ERR 3 +#define EVENT_LOG_DEBUG 0 +#define EVENT_LOG_MSG 1 +#define EVENT_LOG_WARN 2 +#define EVENT_LOG_ERR 3 /**@}*/ +/* Obsolete names: these are deprecated, but older programs might use them. + * They violate the reserved-identifier namespace. */ +#define _EVENT_LOG_DEBUG EVENT_LOG_DEBUG +#define _EVENT_LOG_MSG EVENT_LOG_MSG +#define _EVENT_LOG_WARN EVENT_LOG_WARN +#define _EVENT_LOG_ERR EVENT_LOG_ERR + /** A callback function used to intercept Libevent's log messages. diff -Nru libevent-2.0.16-stable/include/event2/event_struct.h libevent-2.0.21-stable/include/event2/event_struct.h --- libevent-2.0.16-stable/include/event2/event_struct.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/event_struct.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/http_compat.h libevent-2.0.21-stable/include/event2/http_compat.h --- libevent-2.0.16-stable/include/event2/http_compat.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/http_compat.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/http.h libevent-2.0.21-stable/include/event2/http.h --- libevent-2.0.16-stable/include/event2/http.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/http.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -428,6 +428,12 @@ struct event_base *base, struct evdns_base *dnsbase, const char *address, unsigned short port); +/** + * Return the bufferevent that an evhttp_connection is using. + */ +struct bufferevent *evhttp_connection_get_bufferevent( + struct evhttp_connection *evcon); + /** Takes ownership of the request object * * Can be used in a request callback to keep onto the request until diff -Nru libevent-2.0.16-stable/include/event2/http_struct.h libevent-2.0.21-stable/include/event2/http_struct.h --- libevent-2.0.16-stable/include/event2/http_struct.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/http_struct.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/keyvalq_struct.h libevent-2.0.21-stable/include/event2/keyvalq_struct.h --- libevent-2.0.16-stable/include/event2/keyvalq_struct.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/keyvalq_struct.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/listener.h libevent-2.0.21-stable/include/event2/listener.h --- libevent-2.0.16-stable/include/event2/listener.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/listener.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/rpc_compat.h libevent-2.0.21-stable/include/event2/rpc_compat.h --- libevent-2.0.16-stable/include/event2/rpc_compat.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/rpc_compat.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2006-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/rpc.h libevent-2.0.21-stable/include/event2/rpc.h --- libevent-2.0.16-stable/include/event2/rpc.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/rpc.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2006-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/rpc_struct.h libevent-2.0.21-stable/include/event2/rpc_struct.h --- libevent-2.0.16-stable/include/event2/rpc_struct.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/rpc_struct.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2006-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/tag_compat.h libevent-2.0.21-stable/include/event2/tag_compat.h --- libevent-2.0.16-stable/include/event2/tag_compat.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/tag_compat.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/tag.h libevent-2.0.21-stable/include/event2/tag.h --- libevent-2.0.16-stable/include/event2/tag.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/tag.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/thread.h libevent-2.0.21-stable/include/event2/thread.h --- libevent-2.0.16-stable/include/event2/thread.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/thread.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/include/event2/util.h libevent-2.0.21-stable/include/event2/util.h --- libevent-2.0.16-stable/include/event2/util.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/include/event2/util.h 2012-07-16 19:32:38.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -449,7 +449,11 @@ /** Replacement for vsnprintf to get consistent behavior on platforms for which the return value of snprintf does not conform to C99. */ -int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap); +int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap) +#ifdef __GNUC__ + __attribute__((format(printf, 3, 0))) +#endif +; /** Replacement for inet_ntop for platforms which lack it. */ const char *evutil_inet_ntop(int af, const void *src, char *dst, size_t len); diff -Nru libevent-2.0.16-stable/include/Makefile.am libevent-2.0.21-stable/include/Makefile.am --- libevent-2.0.16-stable/include/Makefile.am 2011-03-03 17:55:15.000000000 +0000 +++ libevent-2.0.21-stable/include/Makefile.am 2012-02-10 22:24:54.000000000 +0000 @@ -1,3 +1,9 @@ +# include/Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + AUTOMAKE_OPTIONS = foreign EVENT2_EXPORT = \ diff -Nru libevent-2.0.16-stable/include/Makefile.in libevent-2.0.21-stable/include/Makefile.in --- libevent-2.0.16-stable/include/Makefile.in 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/include/Makefile.in 2012-11-19 15:13:16.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,7 +15,30 @@ @SET_MAKE@ +# include/Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -51,6 +74,11 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__nobase_include_HEADERS_DIST = event2/buffer.h \ event2/buffer_compat.h event2/bufferevent.h \ event2/bufferevent_compat.h event2/bufferevent_ssl.h \ @@ -81,6 +109,12 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)" am__noinst_HEADERS_DIST = event2/buffer.h event2/buffer_compat.h \ event2/bufferevent.h event2/bufferevent_compat.h \ @@ -145,6 +179,7 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OPENSSL_LIBADD = @OPENSSL_LIBADD@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ @@ -292,15 +327,18 @@ -rm -rf .libs _libs install-nobase_includeHEADERS: $(nobase_include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ @@ -310,20 +348,21 @@ @$(NORMAL_UNINSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(includedir)" && rm -f $$files + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-nobase_nodist_includeHEADERS: $(nobase_nodist_include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ @@ -333,9 +372,7 @@ @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(includedir)" && rm -f $$files + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -436,10 +473,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff -Nru libevent-2.0.16-stable/install-sh libevent-2.0.21-stable/install-sh --- libevent-2.0.16-stable/install-sh 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/install-sh 2012-11-19 15:13:16.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru libevent-2.0.16-stable/iocp-internal.h libevent-2.0.21-stable/iocp-internal.h --- libevent-2.0.16-stable/iocp-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/iocp-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/ipv6-internal.h libevent-2.0.21-stable/ipv6-internal.h --- libevent-2.0.16-stable/ipv6-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/ipv6-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/kqueue.c libevent-2.0.21-stable/kqueue.c --- libevent-2.0.16-stable/kqueue.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/kqueue.c 2012-03-22 17:00:28.000000000 +0000 @@ -2,7 +2,7 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -176,7 +176,7 @@ static void kq_setup_kevent(struct kevent *out, evutil_socket_t fd, int filter, short change) { - memset(out, 0, sizeof(out)); + memset(out, 0, sizeof(struct kevent)); out->ident = fd; out->filter = filter; @@ -335,10 +335,15 @@ case EINVAL: continue; - /* Can occur on a delete if the fd is closed. Can - * occur on an add if the fd was one side of a pipe, - * and the other side was closed. */ + /* Can occur on a delete if the fd is closed. */ case EBADF: + /* XXXX On NetBSD, we can also get EBADF if we + * try to add the write side of a pipe, but + * the read side has already been closed. + * Other BSDs call this situation 'EPIPE'. It + * would be good if we had a way to report + * this situation. */ + continue; /* These two can occur on an add if the fd was one side * of a pipe, and the other side was closed. */ case EPERM: diff -Nru libevent-2.0.16-stable/LICENSE libevent-2.0.21-stable/LICENSE --- libevent-2.0.16-stable/LICENSE 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/LICENSE 2012-02-10 22:17:14.000000000 +0000 @@ -3,7 +3,7 @@ ============================== Copyright (c) 2000-2007 Niels Provos -Copyright (c) 2007-2011 Niels Provos and Nick Mathewson +Copyright (c) 2007-2012 Niels Provos and Nick Mathewson Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/listener.c libevent-2.0.21-stable/listener.c --- libevent-2.0.16-stable/listener.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/listener.c 2012-11-01 18:00:11.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos, Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -226,9 +226,15 @@ } } - setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void*)&on, sizeof(on)); + if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void*)&on, sizeof(on))<0) { + evutil_closesocket(fd); + return NULL; + } if (flags & LEV_OPT_REUSEABLE) { - evutil_make_listen_socket_reuseable(fd); + if (evutil_make_listen_socket_reuseable(fd) < 0) { + evutil_closesocket(fd); + return NULL; + } } if (sa) { @@ -390,6 +396,12 @@ evutil_socket_t new_fd = accept(fd, (struct sockaddr*)&ss, &socklen); if (new_fd < 0) break; + if (socklen == 0) { + /* This can happen with some older linux kernels in + * response to nmap. */ + evutil_closesocket(new_fd); + continue; + } if (!(lev->flags & LEV_OPT_LEAVE_SOCKETS_BLOCKING)) evutil_make_socket_nonblocking(new_fd); @@ -729,6 +741,10 @@ } LeaveCriticalSection(&as->lock); } + + if (shutdown && lev->flags & LEV_OPT_CLOSE_ON_FREE) + evutil_closesocket(lev_iocp->fd); + UNLOCK(lev); return 0; } diff -Nru libevent-2.0.16-stable/log.c libevent-2.0.21-stable/log.c --- libevent-2.0.16-stable/log.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/log.c 2012-02-10 22:17:14.000000000 +0000 @@ -5,7 +5,7 @@ * * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code. * - * Copyright (c) 2005-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2005-2012 Niels Provos and Nick Mathewson * * Copyright (c) 2000 Dug Song * diff -Nru libevent-2.0.16-stable/log-internal.h libevent-2.0.21-stable/log-internal.h --- libevent-2.0.16-stable/log-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/log-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/ltmain.sh libevent-2.0.21-stable/ltmain.sh --- libevent-2.0.16-stable/ltmain.sh 2011-11-18 20:19:57.000000000 +0000 +++ libevent-2.0.21-stable/ltmain.sh 2012-11-19 15:13:12.000000000 +0000 @@ -1,9 +1,9 @@ -# libtool (GNU libtool) 2.4 +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -41,6 +41,7 @@ # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) +# --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages @@ -69,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 +# $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # @@ -79,9 +80,9 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4 +VERSION=2.4.2 TIMESTAMP="" -package_revision=1.3293 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -136,15 +137,10 @@ : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -387,7 +383,7 @@ ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -771,8 +767,8 @@ s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } @@ -1052,6 +1048,7 @@ opt_help=false opt_help_all=false opt_silent=: +opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false @@ -1120,6 +1117,10 @@ opt_silent=false func_append preserve_args " $opt" ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" @@ -2059,7 +2060,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -3201,11 +3202,13 @@ # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -3470,7 +3473,7 @@ # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -3982,14 +3985,17 @@ # launches target application with the remaining arguments. func_exec_program () { - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac func_exec_program_core \${1+\"\$@\"} } @@ -5057,9 +5063,15 @@ { EOF func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' cat <<"EOF" } EOF @@ -5643,7 +5655,8 @@ continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6147,7 +6160,8 @@ lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -6831,7 +6845,7 @@ test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -7316,6 +7330,7 @@ # which has an extra 1 added just for fun # case $version_type in + # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result @@ -7432,7 +7447,7 @@ versuffix="$major.$revision" ;; - linux) + linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -8020,6 +8035,11 @@ # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= @@ -8050,7 +8070,7 @@ elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -8058,11 +8078,7 @@ if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. @@ -9152,6 +9168,8 @@ esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" @@ -9261,7 +9279,8 @@ *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" diff -Nru libevent-2.0.16-stable/m4/libtool.m4 libevent-2.0.21-stable/m4/libtool.m4 --- libevent-2.0.16-stable/m4/libtool.m4 2011-11-18 20:19:57.000000000 +0000 +++ libevent-2.0.21-stable/m4/libtool.m4 2012-11-19 15:13:12.000000000 +0000 @@ -1,8 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -11,8 +11,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -146,6 +146,8 @@ AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -637,7 +639,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -801,6 +803,7 @@ m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -822,6 +825,31 @@ ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -852,6 +880,10 @@ m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -954,7 +986,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -962,6 +1000,7 @@ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -973,6 +1012,7 @@ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -990,7 +1030,9 @@ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1035,8 +1077,8 @@ ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1047,6 +1089,8 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi @@ -1330,14 +1374,27 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1414,13 +1471,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1600,6 +1657,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1639,7 +1701,7 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -2185,7 +2247,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2194,7 +2256,7 @@ ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2259,7 +2321,7 @@ ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2398,7 +2460,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2406,10 +2468,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2417,7 +2475,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2435,7 +2493,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2455,17 +2513,18 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2526,7 +2585,7 @@ ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2542,7 +2601,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2579,9 +2638,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2648,7 +2707,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2717,7 +2776,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2742,7 +2801,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2766,7 +2825,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2797,7 +2856,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2807,7 +2866,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -3229,7 +3288,7 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3649,6 +3708,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -4233,7 +4293,9 @@ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4325,18 +4387,33 @@ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4496,7 +4573,9 @@ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] @@ -4521,7 +4600,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4772,8 +4850,7 @@ xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -5068,6 +5145,7 @@ # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' @@ -5114,10 +5192,6 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -5130,7 +5204,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5169,7 +5243,6 @@ fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5611,9 +5684,6 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5771,7 +5841,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -6141,7 +6210,7 @@ esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -6902,12 +6971,18 @@ } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary @@ -7104,7 +7179,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7237,7 +7311,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7424,6 +7497,77 @@ ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7493,6 +7637,13 @@ dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], diff -Nru libevent-2.0.16-stable/m4/ltoptions.m4 libevent-2.0.21-stable/m4/ltoptions.m4 --- libevent-2.0.16-stable/m4/ltoptions.m4 2011-11-18 20:19:57.000000000 +0000 +++ libevent-2.0.21-stable/m4/ltoptions.m4 2012-11-19 15:13:12.000000000 +0000 @@ -326,9 +326,24 @@ # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) diff -Nru libevent-2.0.16-stable/m4/ltversion.m4 libevent-2.0.21-stable/m4/ltversion.m4 --- libevent-2.0.16-stable/m4/ltversion.m4 2011-11-18 20:19:57.000000000 +0000 +++ libevent-2.0.21-stable/m4/ltversion.m4 2012-11-19 15:13:12.000000000 +0000 @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru libevent-2.0.16-stable/make-event-config.sed libevent-2.0.21-stable/make-event-config.sed --- libevent-2.0.16-stable/make-event-config.sed 1970-01-01 00:00:00.000000000 +0000 +++ libevent-2.0.21-stable/make-event-config.sed 2012-04-27 13:26:39.000000000 +0000 @@ -0,0 +1,23 @@ +# Sed script to postprocess config.h into event-config.h. + +1i\ +/* event2/event-config.h\ + *\ + * This file was generated by autoconf when libevent was built, and post-\ + * processed by Libevent so that its macros would have a uniform prefix.\ + *\ + * DO NOT EDIT THIS FILE.\ + *\ + * Do not rely on macros in this file existing in later versions.\ + */\ +\ +#ifndef _EVENT2_EVENT_CONFIG_H_\ +#define _EVENT2_EVENT_CONFIG_H_\ + +$a\ +\ +#endif /* event2/event-config.h */ + +s/#define /#define _EVENT_/ +s/#undef /#undef _EVENT_/ +s/#ifndef /#ifndef _EVENT_/ diff -Nru libevent-2.0.16-stable/Makefile.am libevent-2.0.21-stable/Makefile.am --- libevent-2.0.16-stable/Makefile.am 2011-11-18 20:19:11.000000000 +0000 +++ libevent-2.0.21-stable/Makefile.am 2012-11-18 06:38:50.000000000 +0000 @@ -1,3 +1,9 @@ +# Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + # 'foreign' means that we're not enforcing GNU package rules strictly. # '1.7' means that we need automake 1.7 or later (and we do). AUTOMAKE_OPTIONS = foreign 1.7 @@ -32,7 +38,7 @@ # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 6:4:1 +VERSION_INFO = 6:9:1 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -51,6 +57,11 @@ # 2.0.14-stable-- 2.0 6:3:1 (No ABI change) # 2.0.15-stable-- 2.0 6:3:1 (Forgot to update :( ) # 2.0.16-stable-- 2.0 6:4:1 (No ABI change) +# 2.0.17-stable-- 2.0 6:5:1 (No ABI change) +# 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 @@ -92,6 +103,7 @@ autogen.sh \ event_rpcgen.py \ libevent.pc.in \ + make-event-config.sed \ Doxyfile \ whatsnew-2.0.txt \ Makefile.nmake test/Makefile.nmake \ @@ -153,26 +165,12 @@ SYS_SRC += signal.c endif -BUILT_SOURCES = ./include/event2/event-config.h +BUILT_SOURCES = include/event2/event-config.h -./include/event2/event-config.h: config.h - @MKDIR_P@ ./include/event2 - echo '/* event2/event-config.h' > $@ - echo ' *' >> $@ - echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@ - echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@ - echo ' *' >> $@ - echo ' * DO NOT EDIT THIS FILE.' >> $@ - echo ' *' >> $@ - echo ' * Do not rely on macros in this file existing in later versions.'>> $@ - echo ' */' >> $@ - echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@ - echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@ - - sed -e 's/#define /#define _EVENT_/' \ - -e 's/#undef /#undef _EVENT_/' \ - -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@ - echo "#endif" >> $@ +include/event2/event-config.h: config.h make-event-config.sed + test -d include/event2 || $(MKDIR_P) include/event2 + $(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T + mv -f $@T $@ CORE_SRC = event.c evthread.c buffer.c \ bufferevent.c bufferevent_sock.c bufferevent_filter.c \ diff -Nru libevent-2.0.16-stable/Makefile.in libevent-2.0.21-stable/Makefile.in --- libevent-2.0.16-stable/Makefile.in 2011-11-18 20:20:03.000000000 +0000 +++ libevent-2.0.21-stable/Makefile.in 2012-11-19 15:13:17.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,10 +15,33 @@ @SET_MAKE@ +# Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -93,6 +116,12 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) @@ -211,6 +240,11 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DATA = $(pkgconfig_DATA) am__include_HEADERS_DIST = event.h evhttp.h evdns.h evrpc.h evutil.h am__noinst_HEADERS_DIST = util-internal.h mm-internal.h \ @@ -235,9 +269,11 @@ distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -266,6 +302,8 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -316,6 +354,7 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OPENSSL_LIBADD = @OPENSSL_LIBADD@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ @@ -424,7 +463,7 @@ # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 6:4:1 +VERSION_INFO = 6:9:1 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -443,6 +482,11 @@ # 2.0.14-stable-- 2.0 6:3:1 (No ABI change) # 2.0.15-stable-- 2.0 6:3:1 (Forgot to update :( ) # 2.0.16-stable-- 2.0 6:4:1 (No ABI change) +# 2.0.17-stable-- 2.0 6:5:1 (No ABI change) +# 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 @@ -479,6 +523,7 @@ autogen.sh \ event_rpcgen.py \ libevent.pc.in \ + make-event-config.sed \ Doxyfile \ whatsnew-2.0.txt \ Makefile.nmake test/Makefile.nmake \ @@ -504,7 +549,7 @@ @BUILD_WIN32_TRUE@ $(am__append_10) $(am__append_11) @BUILD_WIN32_FALSE@SYS_INCLUDES = @BUILD_WIN32_TRUE@SYS_INCLUDES = -IWIN32-Code -BUILT_SOURCES = ./include/event2/event-config.h +BUILT_SOURCES = include/event2/event-config.h CORE_SRC = event.c evthread.c buffer.c \ bufferevent.c bufferevent_sock.c bufferevent_filter.c \ bufferevent_pair.c listener.c bufferevent_ratelim.c \ @@ -548,7 +593,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -584,10 +629,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -607,7 +650,6 @@ cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -615,6 +657,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -645,20 +689,23 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libevent.la: $(libevent_la_OBJECTS) $(libevent_la_DEPENDENCIES) +libevent.la: $(libevent_la_OBJECTS) $(libevent_la_DEPENDENCIES) $(EXTRA_libevent_la_DEPENDENCIES) $(libevent_la_LINK) $(am_libevent_la_rpath) $(libevent_la_OBJECTS) $(libevent_la_LIBADD) $(LIBS) -libevent_core.la: $(libevent_core_la_OBJECTS) $(libevent_core_la_DEPENDENCIES) +libevent_core.la: $(libevent_core_la_OBJECTS) $(libevent_core_la_DEPENDENCIES) $(EXTRA_libevent_core_la_DEPENDENCIES) $(libevent_core_la_LINK) $(am_libevent_core_la_rpath) $(libevent_core_la_OBJECTS) $(libevent_core_la_LIBADD) $(LIBS) -libevent_extra.la: $(libevent_extra_la_OBJECTS) $(libevent_extra_la_DEPENDENCIES) +libevent_extra.la: $(libevent_extra_la_OBJECTS) $(libevent_extra_la_DEPENDENCIES) $(EXTRA_libevent_extra_la_DEPENDENCIES) $(libevent_extra_la_LINK) $(am_libevent_extra_la_rpath) $(libevent_extra_la_OBJECTS) $(libevent_extra_la_LIBADD) $(LIBS) -libevent_openssl.la: $(libevent_openssl_la_OBJECTS) $(libevent_openssl_la_DEPENDENCIES) +libevent_openssl.la: $(libevent_openssl_la_OBJECTS) $(libevent_openssl_la_DEPENDENCIES) $(EXTRA_libevent_openssl_la_DEPENDENCIES) $(libevent_openssl_la_LINK) $(am_libevent_openssl_la_rpath) $(libevent_openssl_la_OBJECTS) $(libevent_openssl_la_LIBADD) $(LIBS) -libevent_pthreads.la: $(libevent_pthreads_la_OBJECTS) $(libevent_pthreads_la_DEPENDENCIES) +libevent_pthreads.la: $(libevent_pthreads_la_OBJECTS) $(libevent_pthreads_la_DEPENDENCIES) $(EXTRA_libevent_pthreads_la_DEPENDENCIES) $(libevent_pthreads_la_LINK) $(am_libevent_pthreads_la_rpath) $(libevent_pthreads_la_OBJECTS) $(libevent_pthreads_la_LIBADD) $(LIBS) install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ @@ -686,9 +733,7 @@ @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -761,8 +806,11 @@ -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -776,13 +824,14 @@ @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -796,9 +845,7 @@ @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(includedir)" && rm -f $$files + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -969,13 +1016,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -1007,7 +1051,11 @@ $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir @@ -1015,7 +1063,7 @@ $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -1046,6 +1094,8 @@ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -1055,7 +1105,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) @@ -1065,6 +1115,7 @@ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -1093,8 +1144,16 @@ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -1130,10 +1189,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -1230,11 +1294,11 @@ all all-am am--refresh check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-compile distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ + dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ install-dist_binSCRIPTS install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ @@ -1248,24 +1312,10 @@ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA -./include/event2/event-config.h: config.h - @MKDIR_P@ ./include/event2 - echo '/* event2/event-config.h' > $@ - echo ' *' >> $@ - echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@ - echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@ - echo ' *' >> $@ - echo ' * DO NOT EDIT THIS FILE.' >> $@ - echo ' *' >> $@ - echo ' * Do not rely on macros in this file existing in later versions.'>> $@ - echo ' */' >> $@ - echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@ - echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@ - - sed -e 's/#define /#define _EVENT_/' \ - -e 's/#undef /#undef _EVENT_/' \ - -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@ - echo "#endif" >> $@ +include/event2/event-config.h: config.h make-event-config.sed + test -d include/event2 || $(MKDIR_P) include/event2 + $(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T + mv -f $@T $@ verify: check diff -Nru libevent-2.0.16-stable/minheap-internal.h libevent-2.0.21-stable/minheap-internal.h --- libevent-2.0.16-stable/minheap-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/minheap-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Copyright (c) 2006 Maxim Yegorushkin * diff -Nru libevent-2.0.16-stable/missing libevent-2.0.21-stable/missing --- libevent-2.0.16-stable/missing 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/missing 2012-11-19 15:13:16.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff -Nru libevent-2.0.16-stable/mm-internal.h libevent-2.0.21-stable/mm-internal.h --- libevent-2.0.16-stable/mm-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/mm-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/poll.c libevent-2.0.21-stable/poll.c --- libevent-2.0.16-stable/poll.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/poll.c 2012-02-10 22:17:14.000000000 +0000 @@ -2,7 +2,7 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/ratelim-internal.h libevent-2.0.21-stable/ratelim-internal.h --- libevent-2.0.16-stable/ratelim-internal.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/ratelim-internal.h 2012-02-10 22:17:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/README libevent-2.0.21-stable/README --- libevent-2.0.16-stable/README 2011-11-15 22:21:56.000000000 +0000 +++ libevent-2.0.21-stable/README 2012-11-18 06:33:45.000000000 +0000 @@ -47,7 +47,7 @@ 2. USEFUL LINKS: For the latest released version of Libevent, see the official website at -http://monkey.org/~provos/libevent/ . +http://libevent.org/ . There's a pretty good work-in-progress manual up at http://www.wangafu.net/~nickm/libevent-book/ . @@ -71,6 +71,7 @@ The following people have helped with suggestions, ideas, code or fixing bugs: + Arno Bakker Alejo Weston Andros Adamson William Ahern @@ -90,7 +91,10 @@ Lawnstein Chan Shuo Chen Ka-Hing Cheung + Andrew Cox + George Danchev Andrew Danforth + Antony Dovgal Ed Day Christopher Davis Mike Davis @@ -98,13 +102,20 @@ Mark Ellzey Shie Erlich Leonid Evdokimov + Juan Pablo Fernandez Christophe Fillot + Mike Frysinger + Remi Gacogne Alexander von Gernler Artur Grabowski + Sebastian Hahn Dave Hart Greg Hazel Michael Herf - Sebastian Hahn + Savg He + Mark Heily + Greg Hewgill + Andrew Hochhaus Aaron Hopkins Tani Hosokawa Jamie Iles @@ -116,6 +127,7 @@ Brian Koehmstedt Marko Kreen Valery Kyholodov + Ross Lagerwall Scott Lamb Christopher Layne Adam Langley @@ -124,6 +136,7 @@ David Libenzi Yan Lin Moshe Litvin + Simon Liu Mitchell Livingston Hagne Mahre Lubomir Marinov @@ -143,28 +156,37 @@ Phil Oleson Dave Pacheco Tassilo von Parseval + Catalin Patulea + Patrick Pelletier Simon Perreault Pierre Phaneuf Ryan Phillips Dimitre Piskyulev Pavel Plesov Jon Poland + Nate R Robert Ransom Bert JW Regeer Peter Rosin + Maseeb Abdul Qadir + Wang Qin + Alex S Hanna Schroeter Ralf Schmitt Mike Smellie Kevin Springborn Harlan Stenn - Ferenc Szalai + Steve Snyder Dug Song Dongsheng Song + Hannes Sowa + Ferenc Szalai Brodie Thiesfield Jason Toffaletti Gisle Vanem Bas Verhoeven Constantine Verutin + Colin Watt Zack Weinberg Jardel Weyrich Alex @@ -172,4 +194,5 @@ propanbutan mmadia + If we have forgotten your name, please contact us. diff -Nru libevent-2.0.16-stable/sample/dns-example.c libevent-2.0.21-stable/sample/dns-example.c --- libevent-2.0.16-stable/sample/dns-example.c 2011-11-14 17:15:09.000000000 +0000 +++ libevent-2.0.21-stable/sample/dns-example.c 2012-05-02 20:37:29.000000000 +0000 @@ -145,8 +145,9 @@ int reverse = 0, servertest = 0, use_getaddrinfo = 0; struct event_base *event_base = NULL; struct evdns_base *evdns_base = NULL; + const char *resolv_conf = NULL; if (c<2) { - fprintf(stderr, "syntax: %s [-x] [-v] hostname\n", v[0]); + fprintf(stderr, "syntax: %s [-x] [-v] [-c resolv.conf] hostname\n", v[0]); fprintf(stderr, "syntax: %s [-servertest]\n", v[0]); return 1; } @@ -160,7 +161,12 @@ use_getaddrinfo = 1; else if (!strcmp(v[idx], "-servertest")) servertest = 1; - else + else if (!strcmp(v[idx], "-c")) { + if (idx + 1 < c) + resolv_conf = v[++idx]; + else + fprintf(stderr, "-c needs an argument\n"); + } else fprintf(stderr, "Unknown option %s\n", v[idx]); ++idx; } @@ -197,11 +203,14 @@ if (idx < c) { int res; #ifdef WIN32 - res = evdns_base_config_windows_nameservers(evdns_base); -#else - res = evdns_base_resolv_conf_parse(evdns_base, DNS_OPTION_NAMESERVERS, - "/etc/resolv.conf"); + if (resolv_conf == NULL) + res = evdns_base_config_windows_nameservers(evdns_base); + else #endif + res = evdns_base_resolv_conf_parse(evdns_base, + DNS_OPTION_NAMESERVERS, + resolv_conf ? resolv_conf : "/etc/resolv.conf"); + if (res < 0) { fprintf(stderr, "Couldn't configure nameservers"); return 1; diff -Nru libevent-2.0.16-stable/sample/event-test.c libevent-2.0.21-stable/sample/event-test.c --- libevent-2.0.16-stable/sample/event-test.c 2010-12-16 18:05:27.000000000 +0000 +++ libevent-2.0.21-stable/sample/event-test.c 2012-11-02 15:57:00.000000000 +0000 @@ -29,7 +29,7 @@ #include static void -fifo_read(int fd, short event, void *arg) +fifo_read(evutil_socket_t fd, short event, void *arg) { char buf[255]; int len; @@ -42,7 +42,7 @@ event_add(ev, NULL); fprintf(stderr, "fifo_read called with fd: %d, event: %d, arg: %p\n", - fd, event, arg); + (int)fd, event, arg); #ifdef WIN32 len = ReadFile((HANDLE)fd, buf, sizeof(buf) - 1, &dwBytesRead, NULL); @@ -126,7 +126,7 @@ /* Initalize one event */ #ifdef WIN32 - event_set(&evfifo, (int)socket, EV_READ, fifo_read, &evfifo); + event_set(&evfifo, (evutil_socket_t)socket, EV_READ, fifo_read, &evfifo); #else event_set(&evfifo, socket, EV_READ, fifo_read, &evfifo); #endif diff -Nru libevent-2.0.16-stable/sample/http-server.c libevent-2.0.21-stable/sample/http-server.c --- libevent-2.0.16-stable/sample/http-server.c 2011-08-29 17:26:33.000000000 +0000 +++ libevent-2.0.21-stable/sample/http-server.c 2012-02-10 22:17:14.000000000 +0000 @@ -134,7 +134,7 @@ char cbuf[128]; n = evbuffer_remove(buf, cbuf, sizeof(buf)-1); if (n > 0) - fwrite(cbuf, 1, n, stdout); + (void) fwrite(cbuf, 1, n, stdout); } puts(">>>"); diff -Nru libevent-2.0.16-stable/sample/Makefile.am libevent-2.0.21-stable/sample/Makefile.am --- libevent-2.0.16-stable/sample/Makefile.am 2011-10-03 15:54:40.000000000 +0000 +++ libevent-2.0.21-stable/sample/Makefile.am 2012-02-14 20:37:44.000000000 +0000 @@ -1,3 +1,9 @@ +# sample/Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + AUTOMAKE_OPTIONS = foreign no-dependencies LDADD = $(LIBEVENT_GC_SECTIONS) ../libevent.la @@ -15,7 +21,7 @@ if OPENSSL noinst_PROGRAMS += le-proxy le_proxy_SOURCES = le-proxy.c -le_proxy_LDADD = $(LDADD) ../libevent_openssl.la -lssl -lcrypto +le_proxy_LDADD = $(LDADD) ../libevent_openssl.la -lssl -lcrypto ${OPENSSL_LIBADD} endif verify: diff -Nru libevent-2.0.16-stable/sample/Makefile.in libevent-2.0.21-stable/sample/Makefile.in --- libevent-2.0.16-stable/sample/Makefile.in 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/sample/Makefile.in 2012-11-19 15:13:16.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,7 +15,30 @@ @SET_MAKE@ +# sample/Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -75,7 +98,7 @@ le_proxy_OBJECTS = $(am_le_proxy_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) ../libevent.la @OPENSSL_TRUE@le_proxy_DEPENDENCIES = $(am__DEPENDENCIES_2) \ -@OPENSSL_TRUE@ ../libevent_openssl.la +@OPENSSL_TRUE@ ../libevent_openssl.la $(am__DEPENDENCIES_1) am_signal_test_OBJECTS = signal-test.$(OBJEXT) signal_test_OBJECTS = $(am_signal_test_OBJECTS) signal_test_LDADD = $(LDADD) @@ -104,6 +127,11 @@ $(hello_world_SOURCES) $(http_server_SOURCES) \ $(am__le_proxy_SOURCES_DIST) $(signal_test_SOURCES) \ $(time_test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -156,6 +184,7 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OPENSSL_LIBADD = @OPENSSL_LIBADD@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ @@ -240,7 +269,7 @@ hello_world_SOURCES = hello-world.c http_server_SOURCES = http-server.c @OPENSSL_TRUE@le_proxy_SOURCES = le-proxy.c -@OPENSSL_TRUE@le_proxy_LDADD = $(LDADD) ../libevent_openssl.la -lssl -lcrypto +@OPENSSL_TRUE@le_proxy_LDADD = $(LDADD) ../libevent_openssl.la -lssl -lcrypto ${OPENSSL_LIBADD} DISTCLEANFILES = *~ all: all-am @@ -285,25 +314,25 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -dns-example$(EXEEXT): $(dns_example_OBJECTS) $(dns_example_DEPENDENCIES) +dns-example$(EXEEXT): $(dns_example_OBJECTS) $(dns_example_DEPENDENCIES) $(EXTRA_dns_example_DEPENDENCIES) @rm -f dns-example$(EXEEXT) $(LINK) $(dns_example_OBJECTS) $(dns_example_LDADD) $(LIBS) -event-test$(EXEEXT): $(event_test_OBJECTS) $(event_test_DEPENDENCIES) +event-test$(EXEEXT): $(event_test_OBJECTS) $(event_test_DEPENDENCIES) $(EXTRA_event_test_DEPENDENCIES) @rm -f event-test$(EXEEXT) $(LINK) $(event_test_OBJECTS) $(event_test_LDADD) $(LIBS) -hello-world$(EXEEXT): $(hello_world_OBJECTS) $(hello_world_DEPENDENCIES) +hello-world$(EXEEXT): $(hello_world_OBJECTS) $(hello_world_DEPENDENCIES) $(EXTRA_hello_world_DEPENDENCIES) @rm -f hello-world$(EXEEXT) $(LINK) $(hello_world_OBJECTS) $(hello_world_LDADD) $(LIBS) -http-server$(EXEEXT): $(http_server_OBJECTS) $(http_server_DEPENDENCIES) +http-server$(EXEEXT): $(http_server_OBJECTS) $(http_server_DEPENDENCIES) $(EXTRA_http_server_DEPENDENCIES) @rm -f http-server$(EXEEXT) $(LINK) $(http_server_OBJECTS) $(http_server_LDADD) $(LIBS) -le-proxy$(EXEEXT): $(le_proxy_OBJECTS) $(le_proxy_DEPENDENCIES) +le-proxy$(EXEEXT): $(le_proxy_OBJECTS) $(le_proxy_DEPENDENCIES) $(EXTRA_le_proxy_DEPENDENCIES) @rm -f le-proxy$(EXEEXT) $(LINK) $(le_proxy_OBJECTS) $(le_proxy_LDADD) $(LIBS) -signal-test$(EXEEXT): $(signal_test_OBJECTS) $(signal_test_DEPENDENCIES) +signal-test$(EXEEXT): $(signal_test_OBJECTS) $(signal_test_DEPENDENCIES) $(EXTRA_signal_test_DEPENDENCIES) @rm -f signal-test$(EXEEXT) $(LINK) $(signal_test_OBJECTS) $(signal_test_LDADD) $(LIBS) -time-test$(EXEEXT): $(time_test_OBJECTS) $(time_test_DEPENDENCIES) +time-test$(EXEEXT): $(time_test_OBJECTS) $(time_test_DEPENDENCIES) $(EXTRA_time_test_DEPENDENCIES) @rm -f time-test$(EXEEXT) $(LINK) $(time_test_OBJECTS) $(time_test_LDADD) $(LIBS) @@ -424,10 +453,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff -Nru libevent-2.0.16-stable/sample/signal-test.c libevent-2.0.21-stable/sample/signal-test.c --- libevent-2.0.16-stable/sample/signal-test.c 2010-12-16 18:05:27.000000000 +0000 +++ libevent-2.0.21-stable/sample/signal-test.c 2012-11-02 15:57:00.000000000 +0000 @@ -53,11 +53,10 @@ #ifdef WIN32 WORD wVersionRequested; WSADATA wsaData; - int err; wVersionRequested = MAKEWORD(2, 2); - err = WSAStartup(wVersionRequested, &wsaData); + (void) WSAStartup(wVersionRequested, &wsaData); #endif /* Initalize the event library */ diff -Nru libevent-2.0.16-stable/sample/time-test.c libevent-2.0.21-stable/sample/time-test.c --- libevent-2.0.16-stable/sample/time-test.c 2010-12-16 18:05:27.000000000 +0000 +++ libevent-2.0.21-stable/sample/time-test.c 2012-11-02 15:57:00.000000000 +0000 @@ -74,11 +74,10 @@ #ifdef WIN32 WORD wVersionRequested; WSADATA wsaData; - int err; wVersionRequested = MAKEWORD(2, 2); - err = WSAStartup(wVersionRequested, &wsaData); + (void)WSAStartup(wVersionRequested, &wsaData); #endif if (argc == 2 && !strcmp(argv[1], "-p")) { diff -Nru libevent-2.0.16-stable/select.c libevent-2.0.21-stable/select.c --- libevent-2.0.16-stable/select.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/select.c 2012-02-10 22:17:14.000000000 +0000 @@ -2,7 +2,7 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/signal.c libevent-2.0.21-stable/signal.c --- libevent-2.0.16-stable/signal.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/signal.c 2012-11-02 15:57:00.000000000 +0000 @@ -2,7 +2,7 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -354,7 +354,8 @@ { EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG); - event_debug(("%s: %d: restoring signal handler", __func__, evsignal)); + event_debug(("%s: "EV_SOCK_FMT": restoring signal handler", + __func__, EV_SOCK_ARG(evsignal))); EVSIGBASE_LOCK(); --evsig_base_n_signals_added; diff -Nru libevent-2.0.16-stable/test/bench.c libevent-2.0.21-stable/test/bench.c --- libevent-2.0.16-stable/test/bench.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/bench.c 2012-11-02 15:57:00.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Niels Provos - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +61,7 @@ #include static int count, writes, fired; -static int *pipes; +static evutil_socket_t *pipes; static int num_pipes, num_active, num_writes; static struct event *events; @@ -69,7 +69,7 @@ static void read_cb(evutil_socket_t fd, short which, void *arg) { - long idx = (long) arg, widx = idx + 1; + ev_intptr_t idx = (ev_intptr_t) arg, widx = idx + 1; u_char ch; count += recv(fd, (char*)&ch, sizeof(ch), 0); @@ -85,14 +85,14 @@ static struct timeval * run_once(void) { - int *cp, space; + evutil_socket_t *cp, space; long i; static struct timeval ts, te; for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) { if (event_initialized(&events[i])) event_del(&events[i]); - event_set(&events[i], cp[0], EV_READ | EV_PERSIST, read_cb, (void *) i); + event_set(&events[i], cp[0], EV_READ | EV_PERSIST, read_cb, (void *)(ev_intptr_t) i); event_add(&events[i], NULL); } @@ -130,7 +130,7 @@ #endif int i, c; struct timeval *tv; - int *cp; + evutil_socket_t *cp; #ifdef WIN32 WSADATA WSAData; @@ -165,7 +165,7 @@ #endif events = calloc(num_pipes, sizeof(struct event)); - pipes = calloc(num_pipes * 2, sizeof(int)); + pipes = calloc(num_pipes * 2, sizeof(evutil_socket_t)); if (events == NULL || pipes == NULL) { perror("malloc"); exit(1); diff -Nru libevent-2.0.16-stable/test/bench_cascade.c libevent-2.0.21-stable/test/bench_cascade.c --- libevent-2.0.16-stable/test/bench_cascade.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/bench_cascade.c 2012-11-02 15:57:00.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2007-2011 Niels Provos and Nick Mathewson + * Copyright 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,29 +60,32 @@ */ static int fired; -static int *pipes; +static evutil_socket_t *pipes; static struct event *events; static void read_cb(evutil_socket_t fd, short which, void *arg) { char ch; - long idx = (long) arg; + evutil_socket_t sock = (evutil_socket_t)(ev_intptr_t)arg; recv(fd, &ch, sizeof(ch), 0); - if (idx >= 0) - send(idx, "e", 1, 0); + if (sock >= 0) { + if (send(sock, "e", 1, 0) < 0) + perror("send"); + } fired++; } static struct timeval * run_once(int num_pipes) { - int *cp, i; + int i; + evutil_socket_t *cp; static struct timeval ts, te, tv_timeout; events = calloc(num_pipes, sizeof(struct event)); - pipes = calloc(num_pipes * 2, sizeof(int)); + pipes = calloc(num_pipes * 2, sizeof(evutil_socket_t)); if (events == NULL || pipes == NULL) { perror("malloc"); @@ -104,15 +107,17 @@ tv_timeout.tv_sec = 60; for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) { - long fd = i < num_pipes - 1 ? cp[3] : -1; - event_set(&events[i], cp[0], EV_READ, read_cb, (void *) fd); + evutil_socket_t fd = i < num_pipes - 1 ? cp[3] : -1; + event_set(&events[i], cp[0], EV_READ, read_cb, + (void *)(ev_intptr_t)fd); event_add(&events[i], &tv_timeout); } fired = 0; /* kick everything off with a single write */ - send(pipes[1], "e", 1, 0); + if (send(pipes[1], "e", 1, 0) < 0) + perror("send"); event_dispatch(); diff -Nru libevent-2.0.16-stable/test/bench_http.c libevent-2.0.21-stable/test/bench_http.c --- libevent-2.0.16-stable/test/bench_http.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/bench_http.c 2012-05-31 04:08:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2008-2011 Niels Provos and Nick Mathewson + * Copyright 2008-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff -Nru libevent-2.0.16-stable/test/bench_httpclient.c libevent-2.0.21-stable/test/bench_httpclient.c --- libevent-2.0.16-stable/test/bench_httpclient.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/bench_httpclient.c 2012-07-26 14:20:26.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2009-2011 Niels Provos and Nick Mathewson + * Copyright 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -115,11 +115,12 @@ { struct linger l; int one = 1; - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one)); + if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one))<0) + perror("setsockopt(SO_REUSEADDR)"); l.l_onoff = 1; l.l_linger = 0; if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0) - perror("setsockopt"); + perror("setsockopt(SO_LINGER)"); } static int diff -Nru libevent-2.0.16-stable/test/Makefile.am libevent-2.0.21-stable/test/Makefile.am --- libevent-2.0.16-stable/test/Makefile.am 2011-10-03 15:54:40.000000000 +0000 +++ libevent-2.0.21-stable/test/Makefile.am 2012-05-31 04:08:19.000000000 +0000 @@ -1,3 +1,9 @@ +# test/Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat -I$(top_srcdir)/include -I../include -DTINYTEST_LOCAL @@ -59,7 +65,7 @@ if OPENSSL regress_SOURCES += regress_ssl.c -regress_LDADD += ../libevent_openssl.la -lssl -lcrypto +regress_LDADD += ../libevent_openssl.la -lssl -lcrypto ${OPENSSL_LIBADD} endif bench_SOURCES = bench.c diff -Nru libevent-2.0.16-stable/test/Makefile.in libevent-2.0.21-stable/test/Makefile.in --- libevent-2.0.16-stable/test/Makefile.in 2011-11-18 20:20:02.000000000 +0000 +++ libevent-2.0.21-stable/test/Makefile.in 2012-11-19 15:13:17.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,8 +15,31 @@ @SET_MAKE@ +# test/Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -46,7 +69,7 @@ @PTHREADS_TRUE@am__append_3 = ../libevent_pthreads.la @BUILD_WIN32_TRUE@am__append_4 = regress_iocp.c @OPENSSL_TRUE@am__append_5 = regress_ssl.c -@OPENSSL_TRUE@am__append_6 = ../libevent_openssl.la -lssl -lcrypto +@OPENSSL_TRUE@am__append_6 = ../libevent_openssl.la -lssl -lcrypto ${OPENSSL_LIBADD} subdir = test DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in @@ -102,7 +125,8 @@ $(am__objects_2) $(am__objects_3) $(am__objects_4) regress_OBJECTS = $(am_regress_OBJECTS) am__DEPENDENCIES_2 = $(am__append_3) -@OPENSSL_TRUE@am__DEPENDENCIES_3 = ../libevent_openssl.la +@OPENSSL_TRUE@am__DEPENDENCIES_3 = ../libevent_openssl.la \ +@OPENSSL_TRUE@ $(am__DEPENDENCIES_1) regress_DEPENDENCIES = $(am__DEPENDENCIES_1) ../libevent.la \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) @@ -152,6 +176,11 @@ $(test_eof_SOURCES) $(test_init_SOURCES) \ $(test_ratelim_SOURCES) $(test_time_SOURCES) \ $(test_weof_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags @@ -207,6 +236,7 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OPENSSL_LIBADD = @OPENSSL_LIBADD@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ @@ -367,37 +397,37 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -bench$(EXEEXT): $(bench_OBJECTS) $(bench_DEPENDENCIES) +bench$(EXEEXT): $(bench_OBJECTS) $(bench_DEPENDENCIES) $(EXTRA_bench_DEPENDENCIES) @rm -f bench$(EXEEXT) $(LINK) $(bench_OBJECTS) $(bench_LDADD) $(LIBS) -bench_cascade$(EXEEXT): $(bench_cascade_OBJECTS) $(bench_cascade_DEPENDENCIES) +bench_cascade$(EXEEXT): $(bench_cascade_OBJECTS) $(bench_cascade_DEPENDENCIES) $(EXTRA_bench_cascade_DEPENDENCIES) @rm -f bench_cascade$(EXEEXT) $(LINK) $(bench_cascade_OBJECTS) $(bench_cascade_LDADD) $(LIBS) -bench_http$(EXEEXT): $(bench_http_OBJECTS) $(bench_http_DEPENDENCIES) +bench_http$(EXEEXT): $(bench_http_OBJECTS) $(bench_http_DEPENDENCIES) $(EXTRA_bench_http_DEPENDENCIES) @rm -f bench_http$(EXEEXT) $(LINK) $(bench_http_OBJECTS) $(bench_http_LDADD) $(LIBS) -bench_httpclient$(EXEEXT): $(bench_httpclient_OBJECTS) $(bench_httpclient_DEPENDENCIES) +bench_httpclient$(EXEEXT): $(bench_httpclient_OBJECTS) $(bench_httpclient_DEPENDENCIES) $(EXTRA_bench_httpclient_DEPENDENCIES) @rm -f bench_httpclient$(EXEEXT) $(LINK) $(bench_httpclient_OBJECTS) $(bench_httpclient_LDADD) $(LIBS) -regress$(EXEEXT): $(regress_OBJECTS) $(regress_DEPENDENCIES) +regress$(EXEEXT): $(regress_OBJECTS) $(regress_DEPENDENCIES) $(EXTRA_regress_DEPENDENCIES) @rm -f regress$(EXEEXT) $(regress_LINK) $(regress_OBJECTS) $(regress_LDADD) $(LIBS) -test-changelist$(EXEEXT): $(test_changelist_OBJECTS) $(test_changelist_DEPENDENCIES) +test-changelist$(EXEEXT): $(test_changelist_OBJECTS) $(test_changelist_DEPENDENCIES) $(EXTRA_test_changelist_DEPENDENCIES) @rm -f test-changelist$(EXEEXT) $(LINK) $(test_changelist_OBJECTS) $(test_changelist_LDADD) $(LIBS) -test-eof$(EXEEXT): $(test_eof_OBJECTS) $(test_eof_DEPENDENCIES) +test-eof$(EXEEXT): $(test_eof_OBJECTS) $(test_eof_DEPENDENCIES) $(EXTRA_test_eof_DEPENDENCIES) @rm -f test-eof$(EXEEXT) $(LINK) $(test_eof_OBJECTS) $(test_eof_LDADD) $(LIBS) -test-init$(EXEEXT): $(test_init_OBJECTS) $(test_init_DEPENDENCIES) +test-init$(EXEEXT): $(test_init_OBJECTS) $(test_init_DEPENDENCIES) $(EXTRA_test_init_DEPENDENCIES) @rm -f test-init$(EXEEXT) $(LINK) $(test_init_OBJECTS) $(test_init_LDADD) $(LIBS) -test-ratelim$(EXEEXT): $(test_ratelim_OBJECTS) $(test_ratelim_DEPENDENCIES) +test-ratelim$(EXEEXT): $(test_ratelim_OBJECTS) $(test_ratelim_DEPENDENCIES) $(EXTRA_test_ratelim_DEPENDENCIES) @rm -f test-ratelim$(EXEEXT) $(LINK) $(test_ratelim_OBJECTS) $(test_ratelim_LDADD) $(LIBS) -test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) +test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) $(EXTRA_test_time_DEPENDENCIES) @rm -f test-time$(EXEEXT) $(LINK) $(test_time_OBJECTS) $(test_time_LDADD) $(LIBS) -test-weof$(EXEEXT): $(test_weof_OBJECTS) $(test_weof_DEPENDENCIES) +test-weof$(EXEEXT): $(test_weof_OBJECTS) $(test_weof_DEPENDENCIES) $(EXTRA_test_weof_DEPENDENCIES) @rm -f test-weof$(EXEEXT) $(LINK) $(test_weof_OBJECTS) $(test_weof_LDADD) $(LIBS) @@ -848,14 +878,15 @@ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -906,10 +937,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff -Nru libevent-2.0.16-stable/test/regress_buffer.c libevent-2.0.21-stable/test/regress_buffer.c --- libevent-2.0.16-stable/test/regress_buffer.c 2011-11-14 17:15:09.000000000 +0000 +++ libevent-2.0.21-stable/test/regress_buffer.c 2012-07-26 13:32:15.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2003-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1033,6 +1033,8 @@ unsigned int i; struct evbuffer * buf = evbuffer_new(); + tt_assert(buf); + /* make sure evbuffer_find doesn't match past the end of the buffer */ evbuffer_add(buf, (u_char*)test1, strlen(test1)); evbuffer_validate(buf); @@ -1074,6 +1076,8 @@ struct evbuffer_ptr pos; struct evbuffer_iovec v[1]; + tt_assert(buf); + /* create some chains */ evbuffer_reserve_space(buf, 5000, v, 1); v[0].iov_len = 5000; @@ -1121,6 +1125,9 @@ struct evbuffer *tmp = evbuffer_new(); struct evbuffer_ptr pos, end; + tt_assert(buf); + tt_assert(tmp); + /* set up our chains */ evbuffer_add_printf(tmp, "hello"); /* 5 chars */ evbuffer_add_buffer(buf, tmp); @@ -1200,6 +1207,10 @@ struct evbuffer *buf_out2 = evbuffer_new(); struct evbuffer_cb_entry *cb1, *cb2; + tt_assert(buf); + tt_assert(buf_out1); + tt_assert(buf_out2); + cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1); cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2); @@ -1441,6 +1452,10 @@ evbuffer_add_buffer(buf, tmp_buf); } + /* How many chunks do we need for everything? */ + i = evbuffer_peek(buf, -1, NULL, NULL, 0); + tt_int_op(i, ==, 16); + /* Simple peek: get everything. */ i = evbuffer_peek(buf, -1, NULL, v, 20); tt_int_op(i, ==, 16); /* we used only 16 chunks. */ diff -Nru libevent-2.0.16-stable/test/regress_bufferevent.c libevent-2.0.21-stable/test/regress_bufferevent.c --- libevent-2.0.16-stable/test/regress_bufferevent.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/regress_bufferevent.c 2012-11-02 15:57:00.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2003-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -74,6 +74,7 @@ #include "event2/util.h" #include "bufferevent-internal.h" +#include "util-internal.h" #ifdef WIN32 #include "iocp-internal.h" #endif @@ -243,6 +244,8 @@ bev1 = bufferevent_new(pair[0], NULL, wm_writecb, wm_errorcb, NULL); bev2 = bufferevent_new(pair[1], wm_readcb, NULL, wm_errorcb, NULL); } + tt_assert(bev1); + tt_assert(bev2); bufferevent_disable(bev1, EV_READ); bufferevent_enable(bev2, EV_READ); @@ -267,8 +270,10 @@ tt_assert(!event_pending(&bev2->ev_write, EV_WRITE, NULL)); end: - bufferevent_free(bev1); - bufferevent_free(bev2); + if (bev1) + bufferevent_free(bev1); + if (bev2) + bufferevent_free(bev2); } static void @@ -377,8 +382,10 @@ test_ok = 0; end: - bufferevent_free(bev1); - bufferevent_free(bev2); + if (bev1) + bufferevent_free(bev1); + if (bev2) + bufferevent_free(bev2); } @@ -551,7 +558,8 @@ if (what & BEV_EVENT_ERROR) { s = bufferevent_getfd(bev); err = evutil_socket_error_to_string(evutil_socket_geterror(s)); - TT_BLATHER(("connection failure on %d: %s", s, err)); + TT_BLATHER(("connection failure on "EV_SOCK_FMT": %s", + EV_SOCK_ARG(s), err)); test_ok = 1; } else { TT_FAIL(("didn't fail? what %hd", what)); diff -Nru libevent-2.0.16-stable/test/regress.c libevent-2.0.21-stable/test/regress.c --- libevent-2.0.16-stable/test/regress.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/regress.c 2012-07-26 14:00:09.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2003-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -627,6 +627,31 @@ event_del(&ev); } +static void +test_persistent_timeout_jump(void *ptr) +{ + struct basic_test_data *data = ptr; + struct event ev; + int count = 0; + struct timeval msec100 = { 0, 100 * 1000 }; + struct timeval msec50 = { 0, 50 * 1000 }; + + event_assign(&ev, data->base, -1, EV_PERSIST, periodic_timeout_cb, &count); + event_add(&ev, &msec100); + /* Wait for a bit */ +#ifdef _WIN32 + Sleep(1000); +#else + sleep(1); +#endif + event_base_loopexit(data->base, &msec50); + event_base_dispatch(data->base); + tt_int_op(count, ==, 1); + +end: + event_del(&ev); +} + struct persist_active_timeout_called { int n; short events[16]; @@ -677,9 +702,11 @@ tv_exit.tv_usec = 600 * 1000; event_base_loopexit(base, &tv_exit); + event_base_assert_ok(base); evutil_gettimeofday(&start, NULL); event_base_dispatch(base); + event_base_assert_ok(base); tt_int_op(res.n, ==, 3); tt_int_op(res.events[0], ==, EV_READ); @@ -748,9 +775,11 @@ } } + event_base_assert_ok(base); event_base_dispatch(base); evutil_gettimeofday(&now, NULL); + event_base_assert_ok(base); for (i=0; i<10; ++i) { struct timeval tmp; @@ -824,12 +853,19 @@ evsignal_set(&sig_ev, SIGCHLD, child_signal_cb, &got_sigchld); evsignal_add(&sig_ev, NULL); - if ((pid = fork()) == 0) { + event_base_assert_ok(current_base); + TT_BLATHER(("Before fork")); + if ((pid = regress_fork()) == 0) { /* in the child */ + TT_BLATHER(("In child, before reinit")); + event_base_assert_ok(current_base); if (event_reinit(current_base) == -1) { fprintf(stdout, "FAILED (reinit)\n"); exit(1); } + TT_BLATHER(("After reinit")); + event_base_assert_ok(current_base); + TT_BLATHER(("After assert-ok")); evsignal_del(&sig_ev); @@ -852,10 +888,12 @@ tt_fail_perror("write"); } + TT_BLATHER(("Before waitpid")); if (waitpid(pid, &status, 0) == -1) { fprintf(stdout, "FAILED (fork)\n"); exit(1); } + TT_BLATHER(("After waitpid")); if (WEXITSTATUS(status) != 76) { fprintf(stdout, "FAILED (exit): %d\n", WEXITSTATUS(status)); @@ -1566,6 +1604,58 @@ test_priorities_impl(3); } +/* priority-active-inversion: activate a higher-priority event, and make sure + * it keeps us from running a lower-priority event first. */ +static int n_pai_calls = 0; +static struct event pai_events[3]; + +static void +prio_active_inversion_cb(evutil_socket_t fd, short what, void *arg) +{ + int *call_order = arg; + *call_order = n_pai_calls++; + if (n_pai_calls == 1) { + /* This should activate later, even though it shares a + priority with us. */ + event_active(&pai_events[1], EV_READ, 1); + /* This should activate next, since its priority is higher, + even though we activated it second. */ + event_active(&pai_events[2], EV_TIMEOUT, 1); + } +} + +static void +test_priority_active_inversion(void *data_) +{ + struct basic_test_data *data = data_; + struct event_base *base = data->base; + int call_order[3]; + int i; + tt_int_op(event_base_priority_init(base, 8), ==, 0); + + n_pai_calls = 0; + memset(call_order, 0, sizeof(call_order)); + + for (i=0;i<3;++i) { + event_assign(&pai_events[i], data->base, -1, 0, + prio_active_inversion_cb, &call_order[i]); + } + + event_priority_set(&pai_events[0], 4); + event_priority_set(&pai_events[1], 4); + event_priority_set(&pai_events[2], 0); + + event_active(&pai_events[0], EV_WRITE, 1); + + event_base_dispatch(base); + tt_int_op(n_pai_calls, ==, 3); + tt_int_op(call_order[0], ==, 0); + tt_int_op(call_order[1], ==, 2); + tt_int_op(call_order[2], ==, 1); +end: + ; +} + static void test_multiple_cb(evutil_socket_t fd, short event, void *arg) @@ -2065,6 +2155,10 @@ NULL); t = evtimer_new(data->base, timeout_cb, NULL); + tt_assert(r); + tt_assert(w); + tt_assert(t); + evutil_gettimeofday(&now, NULL); event_add(r, NULL); event_add(t, &tv); @@ -2164,7 +2258,8 @@ event_free(ev1); if (ev2) event_free(ev2); - close(dfd); + if (dfd >= 0) + close(dfd); } #endif @@ -2325,11 +2420,12 @@ BASIC(bad_assign, TT_FORK|TT_NEED_BASE|TT_NO_LOGS), BASIC(bad_reentrant, TT_FORK|TT_NEED_BASE|TT_NO_LOGS), - /* These are still using the old API */ LEGACY(persistent_timeout, TT_FORK|TT_NEED_BASE), + { "persistent_timeout_jump", test_persistent_timeout_jump, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, { "persistent_active_timeout", test_persistent_active_timeout, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, LEGACY(priorities, TT_FORK|TT_NEED_BASE), + BASIC(priority_active_inversion, TT_FORK|TT_NEED_BASE), { "common_timeout", test_common_timeout, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, diff -Nru libevent-2.0.16-stable/test/regress_dns.c libevent-2.0.21-stable/test/regress_dns.c --- libevent-2.0.16-stable/test/regress_dns.c 2011-11-15 21:45:10.000000000 +0000 +++ libevent-2.0.21-stable/test/regress_dns.c 2012-11-02 15:57:00.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2003-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -107,7 +107,7 @@ if (ttl < 0) goto out; for (i = 0; i < count; ++i) { - const char *b = inet_ntop(AF_INET6, &in6_addrs[i], buf,sizeof(buf)); + const char *b = evutil_inet_ntop(AF_INET6, &in6_addrs[i], buf,sizeof(buf)); if (b) TT_BLATHER(("%s ", b)); else @@ -325,7 +325,7 @@ char buf[INET6_ADDRSTRLEN+1]; if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16) || ttl != 123) { - const char *b = inet_ntop(AF_INET6, &in6_addrs[0],buf,sizeof(buf)); + const char *b = evutil_inet_ntop(AF_INET6, &in6_addrs[0],buf,sizeof(buf)); printf("Bad IPv6 response \"%s\" %d. ", b, ttl); dns_ok = 0; goto out; @@ -862,6 +862,7 @@ /* === Test for bufferevent_socket_connect_hostname */ static int total_connected_or_failed = 0; +static int total_n_accepted = 0; static struct event_base *be_connect_hostname_base = NULL; /* Implements a DNS server for the connect_hostname test and the @@ -995,7 +996,11 @@ { int *p = arg; (*p)++; + ++total_n_accepted; /* don't do anything with the socket; let it close when we exit() */ + if (total_n_accepted >= 3 && total_connected_or_failed >= 5) + event_base_loopexit(be_connect_hostname_base, + NULL); } struct be_conn_hostname_result { @@ -1015,14 +1020,14 @@ if ((what & BEV_EVENT_CONNECTED) || (what & BEV_EVENT_ERROR)) { int r; - ++total_connected_or_failed; - TT_BLATHER(("Got %d connections or errors.", total_connected_or_failed)); if ((r = bufferevent_socket_get_dns_error(bev))) { got->dnserr = r; TT_BLATHER(("DNS error %d: %s", r, evutil_gai_strerror(r))); - } - if (total_connected_or_failed >= 5) + } ++total_connected_or_failed; + TT_BLATHER(("Got %d connections or errors.", total_connected_or_failed)); + + if (total_n_accepted >= 3 && total_connected_or_failed >= 5) event_base_loopexit(be_connect_hostname_base, NULL); } @@ -1043,7 +1048,6 @@ int expect_err5; struct evdns_base *dns=NULL; struct evdns_server_port *port=NULL; - evutil_socket_t server_fd=-1; struct sockaddr_in sin; int listener_port=-1; ev_uint16_t dns_port=0; @@ -1061,6 +1065,7 @@ &n_accept, LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC, -1, (struct sockaddr *)&sin, sizeof(sin)); + tt_assert(listener); listener_port = regress_get_socket_port( evconnlistener_get_fd(listener)); @@ -1144,8 +1149,6 @@ end: if (listener) evconnlistener_free(listener); - if (server_fd>=0) - evutil_closesocket(server_fd); if (port) evdns_close_server_port(port); if (dns) @@ -1206,11 +1209,13 @@ int n_dns_questions = 0; struct evdns_base *dns_base = evdns_base_new(data->base, 0); + tt_assert(dns_base); /* for localhost */ evdns_base_load_hosts(dns_base, NULL); memset(a_out, 0, sizeof(a_out)); + memset(&local_outcome, 0, sizeof(local_outcome)); n_gai_results_pending = 10000; /* don't think about exiting yet. */ @@ -1239,7 +1244,7 @@ memset(&local_outcome, 0, sizeof(local_outcome)); r = evdns_getaddrinfo(dns_base, "www.google.com", "80", &hints, gai_cb, &local_outcome); - tt_int_op(r,==,0); + tt_ptr_op(r,==,NULL); tt_int_op(local_outcome.err,==,EVUTIL_EAI_NONAME); tt_ptr_op(local_outcome.ai,==,NULL); @@ -1665,7 +1670,7 @@ cnt_free(void *ptr) { allocated_chunks -= 1; - return free(ptr); + free(ptr); } struct testleak_env_t { @@ -1699,6 +1704,7 @@ { int ok = 0; struct testleak_env_t *env = env_; + tt_assert(env); #ifdef _EVENT_DISABLE_DEBUG_MODE tt_int_op(allocated_chunks, ==, 0); #else @@ -1707,12 +1713,13 @@ #endif ok = 1; end: - if (env->dns_base) - evdns_base_free(env->dns_base, 0); - if (env->base) - event_base_free(env->base); - if (env) + if (env) { + if (env->dns_base) + evdns_base_free(env->dns_base, 0); + if (env->base) + event_base_free(env->base); free(env); + } return ok; } diff -Nru libevent-2.0.16-stable/test/regress_et.c libevent-2.0.21-stable/test/regress_et.c --- libevent-2.0.16-stable/test/regress_et.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/regress_et.c 2012-07-26 14:19:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +#include "../util-internal.h" #include "event2/event-config.h" #ifdef WIN32 @@ -59,10 +59,6 @@ len = recv(fd, &buf, sizeof(buf), 0); - /*printf("%s: %s %d%s\n", __func__, event & EV_ET ? "etread" : "read", - len, len ? "" : " - means EOF"); - */ - called++; if (event & EV_ET) was_et = 1; @@ -90,13 +86,25 @@ evutil_socket_t pair[2] = {-1,-1}; int supports_et; + /* On Linux 3.2.1 (at least, as patched by Fedora and tested by Nick), + * doing a "recv" on an AF_UNIX socket resets the readability of the + * socket, even though there is no state change, so we don't actually + * get edge-triggered behavior. Yuck! Linux 3.1.9 didn't have this + * problem. + */ +#ifdef __linux__ + if (evutil_ersatz_socketpair(AF_INET, SOCK_STREAM, 0, pair) == -1) { + tt_abort_perror("socketpair"); + } +#else if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, pair) == -1) { tt_abort_perror("socketpair"); } +#endif called = was_et = 0; - send(pair[0], test, (int)strlen(test)+1, 0); + tt_int_op(send(pair[0], test, (int)strlen(test)+1, 0), >, 0); shutdown(pair[0], SHUT_WR); /* Initalize the event library */ @@ -165,7 +173,9 @@ /* try mixing edge-triggered and level-triggered to make sure it fails*/ ev_et = event_new(base, data->pair[0], EV_READ|EV_ET, read_cb, ev_et); + tt_assert(ev_et); ev_lt = event_new(base, data->pair[0], EV_READ, read_cb, ev_lt); + tt_assert(ev_lt); /* Add edge-triggered, then level-triggered. Get an error. */ tt_int_op(0, ==, event_add(ev_et, NULL)); diff -Nru libevent-2.0.16-stable/test/regress.h libevent-2.0.21-stable/test/regress.h --- libevent-2.0.16-stable/test/regress.h 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/regress.h 2012-05-03 16:04:02.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -118,6 +118,10 @@ long timeval_msec_diff(const struct timeval *start, const struct timeval *end); +#ifndef _WIN32 +pid_t regress_fork(void); +#endif + #ifdef __cplusplus } #endif diff -Nru libevent-2.0.16-stable/test/regress_http.c libevent-2.0.21-stable/test/regress_http.c --- libevent-2.0.16-stable/test/regress_http.c 2011-10-26 14:16:09.000000000 +0000 +++ libevent-2.0.21-stable/test/regress_http.c 2012-08-23 14:59:14.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2003-2007 Niels Provos - * Copyright (c) 2007-2011 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -892,7 +892,6 @@ /* We give ownership of the request to the connection */ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { tt_abort_msg("Couldn't make request"); - exit(1); } event_base_dispatch(data->base); @@ -1001,7 +1000,6 @@ /* We give ownership of the request to the connection */ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { tt_abort_msg("Couldn't make request"); - exit(1); } event_base_dispatch(data->base); @@ -1844,7 +1842,6 @@ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, with_delay ? "/largedelay" : "/test") == -1) { tt_abort_msg("couldn't make request"); - exit(1); } event_base_dispatch(data->base); @@ -2663,9 +2660,11 @@ if (header == NULL) goto out; /* 13 chars */ - if (strcmp(header, "d")) + if (strcmp(header, "d")) { + free((void*)header); goto out; - free((char*)header); + } + free((void*)header); if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 13), "This is funny", 13)) @@ -2691,8 +2690,10 @@ if (header == NULL) goto out; /* 8 chars */ - if (strcmp(header, "8")) + if (strcmp(header, "8")) { + free((void*)header); goto out; + } free((char *)header); if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 8), @@ -2705,9 +2706,11 @@ if (header == NULL) goto out; /* 0 chars */ - if (strcmp(header, "0")) + if (strcmp(header, "0")) { + free((void*)header); goto out; - free((char *)header); + } + free((void *)header); test_ok = 2; @@ -3216,26 +3219,30 @@ http_primitives(void *ptr) { char *escaped = NULL; - struct evhttp *http; + struct evhttp *http = NULL; escaped = evhttp_htmlescape("