]> granicus.if.org Git - libevent/commitdiff
Merge remote-tracking branch 'origin/patches-2.0'
authorNick Mathewson <nickm@torproject.org>
Thu, 26 Jul 2012 14:09:13 +0000 (10:09 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 26 Jul 2012 14:09:13 +0000 (10:09 -0400)
Conflicts:
configure.in
test/regress_buffer.c
test/regress_dns.c

1  2 
configure.in
test/regress.c
test/regress_buffer.c
test/regress_bufferevent.c
test/regress_dns.c
test/regress_et.c
test/regress_http.c
test/regress_main.c
test/regress_rpc.c
test/regress_testutils.c

diff --cc configure.in
index f1972bf633b13f0855b732f1dc2c706ba60c9291,70dc29cdac4b6999433fb808bcd138f8493c643c..89494b4d702baee0f2011f2f76ea1e3be9a86ea2
@@@ -186,41 -165,27 +186,43 @@@ AC_SUBST(EV_LIB_WS32
  AC_SUBST(EV_LIB_GDI)
  AC_SUBST(OPENSSL_LIBADD)
  
 -AC_CHECK_HEADERS([openssl/bio.h])
 +AC_SYS_LARGEFILE
  
 -if test "$enable_openssl" = "yes"; then
 -save_LIBS="$LIBS"
 -LIBS=""
 -OPENSSL_LIBS=""
 -have_openssl=no
 -AC_SEARCH_LIBS([SSL_new], [ssl],
 -      [have_openssl=yes
 -      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 $OPENSSL_LIBADD])
 -LIBS="$save_LIBS"
 -AC_SUBST(OPENSSL_LIBS)
 -fi
 +LIBEVENT_OPENSSL
  
  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([ \
 +  arpa/inet.h \
 +  fcntl.h \
 +  ifaddrs.h \
 +  mach/mach_time.h \
 +  netdb.h \
 +  netinet/in.h \
 +  netinet/in6.h \
 +  netinet/tcp.h \
 +  poll.h \
 +  port.h \
 +  stdarg.h \
 +  stddef.h \
 +  sys/devpoll.h \
 +  sys/epoll.h \
 +  sys/event.h \
 +  sys/eventfd.h \
 +  sys/ioctl.h \
 +  sys/mman.h \
 +  sys/param.h \
 +  sys/queue.h \
 +  sys/resource.h \
 +  sys/select.h \
 +  sys/sendfile.h \
 +  sys/socket.h \
++  sys/stat.h \
 +  sys/time.h \
 +  sys/timerfd.h \
 +  sys/uio.h \
 +  sys/wait.h \
 +])
++
  AC_CHECK_HEADERS(sys/sysctl.h, [], [], [
  #ifdef HAVE_SYS_PARAM_H
  #include <sys/param.h>
@@@ -318,46 -283,9 +320,47 @@@ AC_C_INLIN
  AC_HEADER_TIME
  
  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 sysctl])
 -AC_CHECK_FUNCS([umask])
 +AC_CHECK_FUNCS([ \
 +  accept4 \
 +  arc4random \
 +  arc4random_buf \
 +  clock_gettime \
 +  eventfd \
 +  epoll_create1 \
 +  fcntl \
 +  getegid \
 +  geteuid \
 +  getifaddrs \
 +  getnameinfo \
 +  getprotobynumber \
 +  gettimeofday \
 +  inet_aton \
 +  inet_ntop \
 +  inet_pton \
 +  issetugid \
 +  mach_absolute_time \
 +  mmap \
 +  nanosleep \
 +  pipe \
 +  pipe2 \
 +  putenv \
 +  sendfile \
 +  setenv \
 +  setrlimit \
 +  sigaction \
 +  signal \
 +  splice \
 +  strlcpy \
 +  strsep \
 +  strtok_r \
 +  strtoll \
 +  sysctl \
 +  timerfd_create \
++  umask \
 +  unsetenv \
 +  usleep \
 +  vasprintf \
 +])
  
  AC_CACHE_CHECK(
      [for getaddrinfo],
diff --cc test/regress.c
Simple merge
index d94a8b37305ef9256e2006922d168ba943cf7973,99a8c0ea5e4e06fa11e03c691f77af043a96071e..365b0c371611f78d59b471fed2be7ebfbd575b76
@@@ -1273,15 -1076,8 +1275,17 @@@ test_evbuffer_ptr_set(void *ptr
        struct evbuffer_ptr pos;
        struct evbuffer_iovec v[1];
  
+       tt_assert(buf);
 +      tt_int_op(evbuffer_get_length(buf), ==, 0);
 +
 +      tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
 +      tt_assert(pos.pos == 0);
 +      tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_ADD) == -1);
 +      tt_assert(pos.pos == -1);
 +      tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_SET) == -1);
 +      tt_assert(pos.pos == -1);
 +
        /* create some chains */
        evbuffer_reserve_space(buf, 5000, v, 1);
        v[0].iov_len = 5000;
@@@ -1331,18 -1125,9 +1335,21 @@@ test_evbuffer_search(void *ptr
        struct evbuffer *tmp = evbuffer_new();
        struct evbuffer_ptr pos, end;
  
+       tt_assert(buf);
+       tt_assert(tmp);
 +      pos = evbuffer_search(buf, "x", 1, NULL);
 +      tt_int_op(pos.pos, ==, -1);
 +      tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
 +      pos = evbuffer_search(buf, "x", 1, &pos);
 +      tt_int_op(pos.pos, ==, -1);
 +      tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
 +      pos = evbuffer_search_range(buf, "x", 1, &pos, &pos);
 +      tt_int_op(pos.pos, ==, -1);
 +      tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
 +      pos = evbuffer_search_range(buf, "x", 1, &pos, NULL);
 +      tt_int_op(pos.pos, ==, -1);
 +
        /* set up our chains */
        evbuffer_add_printf(tmp, "hello");  /* 5 chars */
        evbuffer_add_buffer(buf, tmp);
Simple merge
index 8f853253846d51b259f0b0774446a9601304779b,557a63d66b8451afa2b81919683e561a688aca1e..cfb32552e2560463cdd34ae8ee99ccada70f836f
@@@ -1712,7 -1707,8 +1714,8 @@@ testleak_cleanup(const struct testcase_
  {
        int ok = 0;
        struct testleak_env_t *env = env_;
 -#ifdef _EVENT_DISABLE_DEBUG_MODE
+       tt_assert(env);
 +#ifdef EVENT__DISABLE_DEBUG_MODE
        tt_int_op(allocated_chunks, ==, 0);
  #else
        /* FIXME: that's `1' because of event_debug_map_HT_GROW */
Simple merge
Simple merge
index 415cbb00d2882b93a1f32269d32baa5e6ac08d81,e32afff710a4e1cf0fe4ce70b8fbb50fe9b20491..3dc8be89af56fad97289681f7ca39269e6c8803d
  #endif
  
  #include <sys/types.h>
 -#ifdef _EVENT_HAVE_SYS_STAT_H
++#ifdef EVENT__HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
  
 -#ifndef WIN32
 +#ifndef _WIN32
  #include <sys/socket.h>
  #include <sys/wait.h>
  #include <signal.h>
@@@ -115,16 -118,17 +118,19 @@@ static void dnslogcb(int w, const char 
        TT_BLATHER(("%s", m));
  }
  
 -/* creates a temporary file with the data in it */
 +/* creates a temporary file with the data in it.  If *filename_out gets set,
 + * the caller should try to unlink it. */
  int
 -regress_make_tmpfile(const void *data, size_t datalen)
 +regress_make_tmpfile(const void *data, size_t datalen, char **filename_out)
  {
 -#ifndef WIN32
 +#ifndef _WIN32
        char tmpfilename[32];
        int fd;
 +      *filename_out = NULL;
        strcpy(tmpfilename, "/tmp/eventtmp.XXXXXX");
 -#ifdef _EVENT_HAVE_UMASK
++#ifdef EVENT__HAVE_UMASK
+       umask(0077);
+ #endif
        fd = mkstemp(tmpfilename);
        if (fd == -1)
                return (-1);
Simple merge
Simple merge