3533 Commits

Author SHA1 Message Date
Mark Ellzey
3872c2b048 Merge pull request #299 from libevent/revert-297-master
Revert "The Windows socket type is defined as SOCKET."
2015-12-20 01:09:36 -08:00
Mark Ellzey
a264da8671 Revert "The Windows socket type is defined as SOCKET." 2015-12-20 00:57:50 -08:00
Mark Ellzey
f264afbc9d Merge pull request #297 from billsegall/master
The Windows socket type is defined as SOCKET.
2015-12-18 12:17:04 -08:00
billsegall
ded8086656 Provide a mechanism for building the library on Windows with different compiler flags. Add a batch file that builds it for the M[DT][d] options and performs a hunt and gather of the different output libraries. 2015-12-17 21:27:37 +10:00
billsegall
c9e6c3d70f The Windows socket type is defined as SOCKET.
Under the hood it's an unsigned rather than a signed type and whilst C
compilers are largely happy with this C++ compilers tend to be fussy
about class function signatures which makes C++ usage of libevent
problematic.
2015-12-16 11:17:36 +10:00
Mark Ellzey
1c17cfdd2b Merge pull request #296 from lzmths/master
Refactoring conditional directives that break parts of statements.
2015-12-14 12:31:08 -08:00
Mark Ellzey
3e2c10a7b3 Merge pull request #289 from mc-server/UnicodeErrMsgFix
Fixed Unicode issue in error messages.
2015-12-14 12:20:59 -08:00
lzmths
4b41eebeb2 Refactoring conditional directives that break parts of statements. 2015-12-14 11:04:00 -03:00
Mattes D
e8b78957ea Fixed Unicode issue in error messages. 2015-12-14 11:51:35 +01:00
Azat Khuzhin
809bb39b2b be_sock: bufferevent_socket_connect_hostname(): make it thread-safe
If you use bufferevent_socket_connect_hostname() to resolve, then ipv4 answer
can be returned before ipv6 scheduled and if you will destroy bufferevent after
ipv4 answer will come (in a separate thread of course) then ipv6 will trigger
UAF:

$ a.out
=================================================================
==29733==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200000ef50 at pc 0x0000004b7aef bp 0x7fffffffd940 sp 0x7fffffffd0f8
READ of size 2 at 0x60200000ef50 thread T0
    #0 0x4b7aee in __interceptor_index (/src/oss/libevent/libevent-github/.invest/217-evhttp-threaded/a.out+0x4b7aee)
    #1 0x5060eb in string_num_dots /src/oss/libevent/libevent-github/.cmake-debug/../evdns.c:2739
    #2 0x5078df in search_request_new /src/oss/libevent/libevent-github/.cmake-debug/../evdns.c:3214
    #3 0x506afd in evdns_base_resolve_ipv6 /src/oss/libevent/libevent-github/.cmake-debug/../evdns.c:2935
    #4 0x50aa94 in evdns_getaddrinfo /src/oss/libevent/libevent-github/.cmake-debug/../evdns.c:4719
    #5 0x51de4f in evutil_getaddrinfo_async_ /src/oss/libevent/libevent-github/.cmake-debug/../evutil.c:1567
    #6 0x4fe023 in bufferevent_socket_connect_hostname /src/oss/libevent/libevent-github/.cmake-debug/../bufferevent_sock.c:519
    #7 0x524f54 in evhttp_connection_connect_ /src/oss/libevent/libevent-github/.cmake-debug/../http.c:2493
    #8 0x525156 in evhttp_make_request /src/oss/libevent/libevent-github/.cmake-debug/../http.c:2548
    #9 0x52d373 in main (/src/oss/libevent/libevent-github/.invest/217-evhttp-threaded/a.out+0x52d373)
    #10 0x7ffff6849b44 in __libc_start_main /tmp/buildd/glibc-2.19/csu/libc-start.c:287
    #11 0x445806 in _start (/src/oss/libevent/libevent-github/.invest/217-evhttp-threaded/a.out+0x445806)

0x60200000ef50 is located 0 bytes inside of 15-byte region [0x60200000ef50,0x60200000ef5f)
freed by thread T1 here:
    #0 0x4cc4f2 in __interceptor_free (/src/oss/libevent/libevent-github/.invest/217-evhttp-threaded/a.out+0x4cc4f2)
    #1 0x5141c1 in event_mm_free_ /src/oss/libevent/libevent-github/.cmake-debug/../event.c:3512
    #2 0x522402 in evhttp_connection_free /src/oss/libevent/libevent-github/.cmake-debug/../http.c:1206
    #3 0x52cc5f in connection_closer (/src/oss/libevent/libevent-github/.invest/217-evhttp-threaded/a.out+0x52cc5f)
    #4 0x50e80e in event_process_active_single_queue /src/oss/libevent/libevent-github/.cmake-debug/../event.c:1642
    #5 0x50ed57 in event_process_active /src/oss/libevent/libevent-github/.cmake-debug/../event.c:1734
    #6 0x50f458 in event_base_loop /src/oss/libevent/libevent-github/.cmake-debug/../event.c:1957
    #7 0x50eddf in event_base_dispatch /src/oss/libevent/libevent-github/.cmake-debug/../event.c:1768
    #8 0x52d075 in event_dispatch_thread (/src/oss/libevent/libevent-github/.invest/217-evhttp-threaded/a.out+0x52d075)
    #9 0x7ffff74fc0a3 in start_thread /tmp/buildd/glibc-2.19/nptl/pthread_create.c:309

Fixes: #217
Closes: #222
Closes: #219
Gist: https://gist.github.com/azat/92cbb34232ac02d7972b (from #217 but thread-safe)
2015-11-27 22:45:09 +03:00
Azat Khuzhin
959a4c208c autotools: fix getservbyname() detection
The mentioned commit adds this check under-the-else of the previous condition
between getaddrinfo()/gethostbyname_r(), so this check is triggered only when
we don't have getaddrinfo() which is wrong, fix this by move it upper.

Fixes [CI] since it uses getservbyname() and it failed with autotools only
(cmake detection is ok).

CI: https://travis-ci.org/libevent/libevent/builds/93125954
Fixes: af08a94085e49e6942835b4c6b50a774536d5b5b ("Check for getservbyname even
if not on win32.")
2015-11-25 18:16:29 +03:00
Azat Khuzhin
0b9d43249b test/dns: check exit code of evdns_getaddrinfo()
By some reason all autotools builds failed:
CI: https://travis-ci.org/libevent/libevent/builds/93125954
2015-11-25 17:30:31 +03:00
Azat Khuzhin
18c4352e0f Merge branch 'evdns-fail-requests-v6'
This patchset fixes some issues wit evdns_base_free(..., fail_requests=1), and
there are two cases: with callback wrapper for evdns_getaddrinfo() and not,
both fixed by this patches, and adds regression tests for this.

* evdns-fail-requests-v6:
  evdns: evdns_base_free(): fix UAF of evdns_base with @fail_requests
  test/dns: cover evdns_getaddrinfo() and evdns_base_free() with @fail_requests
  evdns: evdns_base_free(): free requests before namservers
  test/dns: cover @fail_requests for evdns_base_free()
  test/dns: more graceful coverage of @fail_requests
2015-11-25 13:09:15 +03:00
Azat Khuzhin
00313c5050 evdns: evdns_base_free(): fix UAF of evdns_base with @fail_requests
If you call evdns_base_free() with @fail_requests == 1, then it will defer
callback with DNS_ERR_SHUTDOWN, but that callback (internal) uses
data->evdns_base, but we already freed that evdns base, so we can't do
this, fix this by checking @result to DNS_ERR_SHUTDOWN.

Fixes: regress dns/client_fail_requests_getaddrinfo
Fixes: #269
2015-11-25 13:09:02 +03:00
Azat Khuzhin
4ad348310c test/dns: cover evdns_getaddrinfo() and evdns_base_free() with @fail_requests 2015-11-25 13:09:02 +03:00
Azat Khuzhin
14f84bbdc7 evdns: evdns_base_free(): free requests before namservers
Otherwise we will trigger next UAF:
$ valgrind --vgdb-error=1 regress --no-fork +dns/client_fail_requests
==24733== Memcheck, a memory error detector
==24733== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==24733== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==24733== Command: regress --no-fork +dns/client_fail_requests
==24733==
==24733==
==24733== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==24733==   /path/to/gdb regress
==24733== and then give GDB the following command
==24733==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=24733
==24733== --pid is optional if only one valgrind process is running
==24733==
dns/client_fail_requests: ==24733== Invalid read of size 4
==24733==    at 0x4C3352: request_finished (evdns.c:662)
==24733==    by 0x4CC8B7: evdns_base_free_and_unlock (evdns.c:4048)
==24733==    by 0x4CCAFD: evdns_base_free (evdns.c:4088)
==24733==    by 0x458E95: dns_client_fail_requests_test (regress_dns.c:2039)
==24733==    by 0x48EA5D: testcase_run_bare_ (tinytest.c:105)
==24733==    by 0x48ED3F: testcase_run_one (tinytest.c:252)
==24733==    by 0x48F67E: tinytest_main (tinytest.c:434)
==24733==    by 0x47C0DA: main (regress_main.c:461)
==24733==  Address 0x61e6f70 is 448 bytes inside a block of size 456 free'd
==24733==    at 0x4C29EAB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==24733==    by 0x4A8F4D: event_mm_free_ (event.c:3512)
==24733==    by 0x4CC7A1: evdns_nameserver_free (evdns.c:4021)
==24733==    by 0x4CC7DC: evdns_base_free_and_unlock (evdns.c:4037)
==24733==    by 0x4CCAFD: evdns_base_free (evdns.c:4088)
==24733==    by 0x458E95: dns_client_fail_requests_test (regress_dns.c:2039)
==24733==    by 0x48EA5D: testcase_run_bare_ (tinytest.c:105)
==24733==    by 0x48ED3F: testcase_run_one (tinytest.c:252)
==24733==    by 0x48F67E: tinytest_main (tinytest.c:434)
==24733==    by 0x47C0DA: main (regress_main.c:461)
==24733==  Block was alloc'd at
==24733==    at 0x4C28C4F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==24733==    by 0x4A8D5A: event_mm_malloc_ (event.c:3437)
==24733==    by 0x4C8B96: evdns_nameserver_add_impl_ (evdns.c:2505)
==24733==    by 0x4C916D: evdns_base_nameserver_ip_add (evdns.c:2629)
==24733==    by 0x458DA3: dns_client_fail_requests_test (regress_dns.c:2031)
==24733==    by 0x48EA5D: testcase_run_bare_ (tinytest.c:105)
==24733==    by 0x48ED3F: testcase_run_one (tinytest.c:252)
==24733==    by 0x48F67E: tinytest_main (tinytest.c:434)
==24733==    by 0x47C0DA: main (regress_main.c:461)
==24733==
==24733== (action on error) vgdb me ...

Fixes: regress dns/client_fail_requests
Fixes: #269
2015-11-25 13:09:02 +03:00
Azat Khuzhin
d6c6fb4200 test/dns: cover @fail_requests for evdns_base_free() 2015-11-25 13:09:02 +03:00
Azat Khuzhin
123d372864 test/dns: more graceful coverage of @fail_requests
In case when evdns_base_free() called with @fail_requests, we can potentially
have leaks, but we can avoid them if we will run event loop once again to
trigger defer cbs, so let's do this, instead of magical decrements (and also
this will give an example how to avoid leaks for evdns).
2015-11-25 13:09:01 +03:00
Azat Khuzhin
fdf713a08b sample/https-client: allow to change path to ca-certificates
And default to one that linux have, for freebsd you will need:
$ https-client -url https://google.com -crt /usr/local/share/certs/ca-root-nss.crt
2015-11-24 01:37:06 +03:00
Azat Khuzhin
c4e9d9bd66 sample/https-client: check for ERR_remove_thread_state() existence
Fixes: freebsd 9.2 build
2015-11-24 01:19:25 +03:00
Azat Khuzhin
ab3bc69f47 http: avoid epoll_ctl() on already closed fd (triggers by http/chunk_out)
Before:
$ strace -eepoll_ctl,close regress --verbose --no-fork +http/chunk_out
close(3)                                = 0
close(3)                                = 0
close(3)                                = 0
close(3)                                = 0
close(3)                                = 0
close(3)                                = 0
close(3)                                = 0
close(3)                                = 0
http/chunk_out: epoll_ctl(5, EPOLL_CTL_ADD, 8, {EPOLLIN, {u32=8, u64=8}}) = 0
close(10)                               = 0
close(9)                                = 0
epoll_ctl(5, EPOLL_CTL_ADD, 9, {EPOLLIN, {u32=9, u64=9}}) = 0
epoll_ctl(5, EPOLL_CTL_ADD, 10, {EPOLLOUT, {u32=10, u64=10}}) = 0
epoll_ctl(5, EPOLL_CTL_ADD, 11, {EPOLLIN, {u32=11, u64=11}}) = 0
epoll_ctl(5, EPOLL_CTL_DEL, 10, 7ffffb10b870) = 0
epoll_ctl(5, EPOLL_CTL_ADD, 10, {EPOLLIN, {u32=10, u64=10}}) = 0
close(12)                               = 0
epoll_ctl(5, EPOLL_CTL_MOD, 11, {EPOLLIN|EPOLLOUT, {u32=11, u64=11}}) = 0
epoll_ctl(5, EPOLL_CTL_MOD, 11, {EPOLLIN, {u32=11, u64=11}}) = 0
close(11)                               = 0
epoll_ctl(5, EPOLL_CTL_DEL, 11, 7ffffb10b770) = -1 EBADF (Bad file descriptor)
...

And trace for latest:
close(11)                               = 0
 > regress(evutil_closesocket+0x15) [0xadac4]
 > regress(evhttp_connection_free+0x19d) [0xbada2]
 > regress(evhttp_send_done+0x14d) [0xbde43]
 > regress(evhttp_write_cb+0x4a) [0xba1a1]
 > regress(bufferevent_run_writecb_+0xa2) [0x97bba]
 > regress(bufferevent_trigger_nolock_+0xb1) [0x9e330]
 > regress(bufferevent_writecb+0x2a3) [0x9e91a]
 > regress(event_persist_closure+0x2bb) [0xa2e09]
 > regress(event_process_active_single_queue+0x2a8) [0xa30b4]
 > regress(event_process_active+0x13f) [0xa3696]
 > regress(event_base_loop+0x2ab) [0xa3d97]
 > regress(event_base_dispatch+0x1d) [0xa371e]
 > regress(http_chunk_out_test_impl+0x132) [0x74940]
epoll_ctl(5, EPOLL_CTL_DEL, 11, 7fff09439fe0) = -1 EBADF (Bad file descriptor)
 > regress(epoll_ctl+0x36) [0xb49a3]
 > regress(epoll_apply_one_change+0x14e) [0xb4cd4]
 > regress(epoll_nochangelist_del+0x87) [0xb51e4]
 > regress(evmap_io_del_+0x247) [0xaab04]
 > regress(event_del_nolock_+0x2f7) [0xa6aa8]
 > regress(event_callback_cancel_nolock_+0x6e) [0xa747e]
 > regress(event_callback_finalize_many_+0xeb) [0xa4dd6]
 > regress(bufferevent_decref_and_unlock_+0x21d) [0x98da7]
 > regress(bufferevent_writecb+0x312) [0x9e989]
 > regress(event_persist_closure+0x2bb) [0xa2e09]
 > regress(event_process_active_single_queue+0x2a8) [0xa30b4]
 > regress(event_process_active+0x13f) [0xa3696]
 > regress(event_base_loop+0x2ab) [0xa3d97]
 > regress(event_base_dispatch+0x1d) [0xa371e]
 > regress(http_chunk_out_test_impl+0x132) [0x74940]
 ...
2015-11-20 01:51:39 +03:00
Azat Khuzhin
040000d7a7 http: install timeout for read too during connect for ssl
Since during ssl handshake we can read too, and if something nasty will happens
during this handshake (because of too many events in the loop of something like
this) we can wait forever since there is no read timeout:
  (gdb) p *$2.task.connection.bufev
  $11 = {
    ...
    be_ops = 0x7f78c2864b00 <bufferevent_ops_openssl>,
    ev_read = {
      ...
      ev_ = {
        ev_io = {
          ...
          ev_timeout = { tv_sec = 0, tv_usec = 0 }
        },
        ev_signal = { ... }
      },
      ev_events = 82, ev_res = 2,
      ev_timeout = { tv_sec = 10889976, tv_usec = 418753 }
    },
    ev_write = {
      ...
      ev_ = {
        ev_io = {
          ...
          ev_timeout = { tv_sec = 20, tv_usec = 0 }
        },
        ev_signal = { ... }
      },
      ev_events = 84, ev_res = 4,
      ev_timeout = { tv_sec = 10889977, tv_usec = 598753 }
    },
    ...
    errorcb = 0x7f78c287de70 <evhttp_connection_cb>,
    ...
    timeout_read = { tv_sec = 0, tv_usec = 0 },
    timeout_write = { tv_sec = 20, tv_usec = 0 },
    enabled = 4
  }
  (gdb) bt
  #0  0x00007f78c17c3633 in __epoll_wait_nocancel () at syscall-template.S:81
  #1  0x00007f78c2aaf508 in epoll_dispatch (base=0x18f76d0, tv=<optimized out>) at epoll.c:463
  ...

Found-with: massive crawling
Tested-with: massive crawling
2015-11-18 15:42:22 +03:00
Azat Khuzhin
da0ea7ae77 test/ssl: cover busy-loop (i.e. {read,write}-blocked-on-{write,read} stuff)
This covers SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE error codes from ssl,
under which we must block read/write to avoid busy looping, and hence extra CPU
usage.
This test introduces custom BIO that will count read/write and validates
counters, with patches for be_openssl that drops handling
SSL/SSL_ERROR_WANT_READ there are more then 43K reads, so 100 is pretty ok.
2015-11-18 15:40:47 +03:00
Azat Khuzhin
23c77b6054 test/http: write_during_read for https 2015-11-18 15:40:47 +03:00
Azat Khuzhin
7ea26f71b8 test/http: connection_fail for https 2015-11-18 15:40:47 +03:00
Azat Khuzhin
ac04968311 test/http: stream_out for https 2015-11-18 15:40:47 +03:00
Azat Khuzhin
da52933550 be_openssl: don't call do_write() directly from outbuf_cb
Otherwise we can trigger incorrect callback, the simplest way to trigger this
is using http regression tests -- https_chunk_out, since all it do is:
  evhttp_send_reply_end()
    evbuffer_add()
      do_write()
    evhttp_write_buffer()
      evcon->cb = cb

And indeed this is what happens:
  (gdb) bt
  #0  do_write (bev_ssl=0x738a90, atmost=16384) at bufferevent_openssl.c:717
  #1  0x00000000004b69f7 in consider_writing (bev_ssl=0x738a90) at bufferevent_openssl.c:875
  #2  0x00000000004b7386 in be_openssl_outbuf_cb (buf=0x7387b0, cbinfo=0x7fffffffd590, arg=0x738a90) at bufferevent_openssl.c:1147
  #3  0x0000000000490100 in evbuffer_run_callbacks (buffer=0x7387b0, running_deferred=0) at buffer.c:508
  #4  0x00000000004901e5 in evbuffer_invoke_callbacks_ (buffer=0x7387b0) at buffer.c:529
  #5  0x0000000000493a30 in evbuffer_add (buf=0x7387b0, data_in=0x4ecfb2, datlen=5) at buffer.c:1803
  #6  0x00000000004be2e3 in evhttp_send_reply_end (req=0x7371a0) at http.c:2794
  #7  0x000000000045c407 in http_chunked_trickle_cb (fd=-1, events=1, arg=0x75aaf0) at regress_http.c:402
  ...
  (gdb) p bev.writecb
  $4 = (bufferevent_data_cb) 0x4ba17e <evhttp_write_cb>
  $5 = (void *) 0x7379b0
  (gdb) p (struct evhttp_connection *)bev.cbarg
  $6 = (struct evhttp_connection *) 0x7379b0
  (gdb) p $6->cb
  $7 = (void (*)(struct evhttp_connection *, void *)) 0x0

And be_sock don't do like this anyway.

Fixes: https_chunk_out
2015-11-18 15:40:28 +03:00
Azat Khuzhin
a71ffb9d1b test/http: chunk_out for https 2015-11-18 15:39:08 +03:00
Azat Khuzhin
a1b142bd3e epoll: introduce PRINT_CHANGES() macro to avoid copy-pasting
And also this will use change_to_string() for successfully returned
epoll_ctl()
2015-11-18 15:39:08 +03:00
Azat Khuzhin
77ad68a658 sample/https-client: replace ERR_remove_state() by ERR_remove_thread_state()
Since ERR_remove_state() is deprecated:
  $ git log --grep ERR_remove_thread_state
  commit 2ecd2ededece66bf090fefc93ef3ddb672d9e71a
  Author: Bodo Möller <bodo@openssl.org>
  Date:   Wed Aug 13 19:30:01 2008 +0000

      Mention ERR_remove_state() deprecation, and ERR_remove_thread_state(NULL).

Link: https://www.openssl.org/docs/manmaster/crypto/ERR_remove_state.html
2015-11-18 15:39:08 +03:00
Azat Khuzhin
3316a21005 Add missing <string.h> for openssl_hostname_validation module
Now it included by openssl, but nfter
openssl/openssl@master-post-reformat-1494-g6329b60 it will print warning
(apparently they dropped <string.h> from the generic headers).
2015-11-18 15:39:00 +03:00
Azat Khuzhin
29573f0db4 Merge branch 'be-openssl-more-common-with-be-sock'
* be-openssl-more-common-with-be-sock:
  be_openssl: use bufferevent_enable() instead of bufferevent_add_event_()
  be_sock: drop be_sock_add() macro (useless and debug unfriendly)
  be: introduce bufferevent_generic_adj_existing_timeouts_()
  be_openssl: don't add events during bev creation (like be_sock)
  be: add_event: use evutil_timerisset()
2015-11-06 10:36:18 +03:00
Azat Khuzhin
3160716f26 test/regress: fix ssl-less builds (need to make this prettier)
CI: https://travis-ci.org/libevent/libevent/jobs/89590839
2015-11-06 10:21:04 +03:00
Azat Khuzhin
0c66d3210c be_openssl: use bufferevent_enable() instead of bufferevent_add_event_()
By using bufferevent_enable() there will be no event for READ *or* WRITE if
they are not enabled before, and this patch reduces difference for
be_sock_enable/be_openssl_enable (handshake)
2015-11-06 10:21:04 +03:00
Azat Khuzhin
fad5fe2cc1 be_sock: drop be_sock_add() macro (useless and debug unfriendly) 2015-11-06 10:21:04 +03:00
Azat Khuzhin
3c1f58f58b be: introduce bufferevent_generic_adj_existing_timeouts_()
And use it in openssl/sock layers to avoid copy-pasting it's variants.
2015-11-06 10:21:04 +03:00
Azat Khuzhin
f4b6284b83 be_openssl: don't add events during bev creation (like be_sock)
Using the following examples you can get changes between be_openssl and
be_sock:
$ function diff_addr()
{
    eval diff -u $(printf "<(strip_addr %s) " "$@")
}
$ function strip_addr()
{
    sed 's/0x[a-zA-Z0-9]*/0xFFFF/g' "$@"
}
$ EVENT_DEBUG_LOGGING_ALL= regress --verbose --no-fork +http/https_connection_retry 2> /tmp/https-retry.log >&2
$ EVENT_DEBUG_LOGGING_ALL= regress --verbose --no-fork +http/connection_retry 2> /tmp/http-retry.log >&2
$ diff_addr /tmp/http-retry.log /tmp/https-retry.log
2015-11-06 10:21:04 +03:00
Azat Khuzhin
a96b73b9fd be: add_event: use evutil_timerisset() 2015-11-06 10:21:04 +03:00
Azat Khuzhin
45a284acfd Merge branch 'https-coverage-v6'
This patchset adds some basic tests to cover some https cases:
$ regress +http/https_..
http/https_basic: [forking] OK
http/https_simple: [forking] OK
http/https_simple_dirty: [forking] OK
http/https_incomplete: [forking] OK
http/https_incomplete_timeout: [forking] OK
http/https_connection_retry: [forking] OK
http/https_connection_retry_conn_address: [forking] OK
7 tests ok.  (0 skipped)

But there are some leaks in http regression tests (like init_ssl() and others),
must be fixed by using custom setup routine.

* https-coverage-v6:
  test/http: allow dirty shutdown for ssl to fix https_incomplete
  test/http: https basic
  test/http: incomplete{,_timeout} for https
  test/http: add simplest test for http/https/https_dirty_shutdown
  test/http: https: retry coverage
  test/http: https server support (plus some helpers)
  test/http: more sanity checks
  test/ssl: export getkey()/getcert()/get_ssl_ctx()/init_ssl() for https
2015-11-06 09:47:38 +03:00
Azat Khuzhin
1ede3262cc test/http: allow dirty shutdown for ssl to fix https_incomplete 2015-11-06 09:43:25 +03:00
Azat Khuzhin
59714b46bc test/http: https basic 2015-11-06 09:43:25 +03:00
Azat Khuzhin
615490d048 test/http: incomplete{,_timeout} for https 2015-11-06 09:42:44 +03:00
Azat Khuzhin
93b19dc569 test/http: add simplest test for http/https/https_dirty_shutdown
There is "basic" before, but it uses bufferevent's for creating requests for
http layer, while this test uses http layer for client requests too.
2015-11-06 09:42:43 +03:00
Azat Khuzhin
7c2d24ae6b test/http: https: retry coverage 2015-11-06 09:42:43 +03:00
Azat Khuzhin
a7088ad095 test/http: https server support (plus some helpers)
TODO:
- check BEV_OPT_DEFER_CALLBACKS separately
2015-11-06 09:42:28 +03:00
Azat Khuzhin
a27c53c531 test/http: more sanity checks 2015-11-06 09:29:31 +03:00
Azat Khuzhin
0c4c387c15 test/ssl: export getkey()/getcert()/get_ssl_ctx()/init_ssl() for https 2015-11-05 11:00:06 +03:00
Bill Vaughan
f45d39d1a4 Fix lock leak in be_pair_flush() if flush type is BEV_NORMAL
Fixes: bufferevent/bufferevent_pair_flush_normal
  $ regress --no-fork bufferevent/bufferevent_pair_flush_normal
  bufferevent/bufferevent_pair_flush_normal:
    FAIL ../test/regress_bufferevent.c:181: assert(bufferevent_pair_get_partner(bev1) == NULL): 0x177fa20 vs (nil)
    [bufferevent_pair_flush_normal FAILED]

Fixes #266
2015-10-30 18:55:39 +03:00
Azat Khuzhin
ad52602ffd test/regress_be: basic coverage bufferevent_flush() for pair/sock layers
Refs #266
2015-10-30 18:55:34 +03:00
Azat Khuzhin
f8081afc5e test/regress_be: socket_filter_inactive: check bufferevent after creation
Fixes:
../test/regress_bufferevent.c: In function ‘test_bufferevent_socket_filter_inactive’:
../test/regress_bufferevent.c:1180:1: warning: label ‘end’ defined but not used [-Wunused-label]
 end:
2015-10-30 18:38:09 +03:00