test


Log

Author Commit Date CI Message
Azat Khuzhin 89932001 2019-04-03T07:26:21 Disable logging for tests that assume printing warnings To avoid possible confusion But there is still one test that has some messages on windows: main/methods Because this test needs >1 of avaiable methods, otherwise it will warn. (cherry picked from commit 47d348a63130c91f2a6aadef291ff5687275df72)
Azat Khuzhin 22380996 2019-03-25T01:40:46 Link test/regress with event_core/event_extra over event Due to regress linked with event and event_core (both of them includes evthread.c) there will be two different evthread_id_fn_ variables under mingw64: evthread_id_fn_: &0x5294f20a8 evthread_id_fn_: &0x4ba0030a8 And because of this evthread_use_pthreads() can/will set one copy of variables while evthread*() functions will access another, which will break a lot of things (for example main/del_notify test). Fixes: #792 (cherry picked from commit 2ae875ed1216a8896d8af0414cb4efbcb907bae5)
Azat Khuzhin 75d7e1ff 2019-03-24T20:36:16 tinytest: fix parsing --timeout argument Fixes: 15b2f41d ("tinytest: implement per-test timeout (via alarm() under !win32 only)") (cherry picked from commit 8a674243b444da9e0742ac837334aaf38e6a703a)
Azat Khuzhin b64dbfb6 2019-03-24T16:44:56 tinytest: implement per-test timeout (via alarm() under !win32 only) (cherry picked from commit 15b2f41d748643393b9f95b790d32e6bbbf38062)
Azat Khuzhin 58e81106 2019-04-01T01:47:00 evdns: add DNS_OPTION_NAMESERVERS_NO_DEFAULT/EVDNS_BASE_NAMESERVERS_NO_DEFAULT - DNS_OPTION_NAMESERVERS_NO_DEFAULT Do not "default" nameserver (i.e. "127.0.0.1:53") if there is no nameservers in resolv.conf, (iff DNS_OPTION_NAMESERVERS is set) - EVDNS_BASE_NAMESERVERS_NO_DEFAULT If EVDNS_BASE_INITIALIZE_NAMESERVERS isset, do not add default nameserver if there are no nameservers in resolv.conf (just set DNS_OPTION_NAMESERVERS_NO_DEFAULT internally) Fixes: #569 (cherry picked from commit e5b8f4c1925867d8e4cd7dc0390e5141d7ef1106)
John Ohl 3f893f0a 2014-12-09T21:43:18 Add support for EV_TIMEOUT to event_base_active_by_fd Closes: #194 (cherry-pick) (cherry picked from commit 62df1301ca943011fa9c398323049bcddca2694d)
Azat Khuzhin 6a3dd717 2019-03-03T18:58:57 Merge branch 'evbuffer-empty-chain-handling' * evbuffer-empty-chain-handling: buffer: do not rely on ->off in advance_last_with_data() buffer: fix evbuffer_remove_buffer() with empty chain in front test: verify content of the buffer in evbuffer/remove_buffer_with_empty* (cherry picked from commit b69524c004fb68bcd9475e7aa61f5a7cdb45d304)
Azat Khuzhin b6724b60 2019-03-16T16:52:05 bench: suppress int conversion warnings (cherry picked from commit efcc18442b338d931f6dfe71d5ebaff3c6fa2b03)
Azat Khuzhin a45f6733 2019-02-24T17:25:31 Revert "test: avoid regress hanging in macOS" After we started to use kill() over raise() everything should work just fine. This reverts commit a86f89d333d870e6714bd28c695ba1774df3d7f5. Fixed-in: 728c5dc1 ("Use kill() over raise() for raising the signal (fixes osx 10.14 with kqueue)") Fixes: #747 (cherry picked from commit 14eb903ba31987d24357abd05923677d194fedae)
Azat Khuzhin 3db5296b 2019-02-24T17:07:18 Use kill() over raise() for raising the signal (fixes osx 10.14 with kqueue) On OSX 10.14+ the raise() uses pthread_kill() (verified with dtruss) and by some reason signals that has been raised with pthread_kill() do not received by kqueue EVFILT_SIGNAL. While on OSX 10.11 the raise()/pthread_kill() uses plain kill() and everything work just fine (linux also does the same, but instead of kill() it uses tgkill()) Here is a simple reproducer that installs alarm to show that the signal does not received by the kqueue backend: https://gist.github.com/azat/73638b8e3b0fa563a20dadcca9e652a1 Refs: #747 Fixes: #765 (cherry picked from commit 728c5dc11f55b4ba5f518812833eab5a2cc3d550)
Azat Khuzhin e0e5d53b 2019-02-04T22:34:10 test/dns: in solaris under EMFILE devpoll does not dispatch (cherry picked from commit 3ce38f6d2d74edcacfe17d612c611ae35e97acfc)
Azat Khuzhin 5a26e7bd 2019-02-03T18:54:00 test/dns: in solaris under EMFILE the error is EAI_FAIL (cherry picked from commit d234902da713cb722596f6bf66bb0dde8a3842dc)
Azat Khuzhin ce4e2b7b 2019-02-03T18:47:14 test/ssl/bufferevent_wm: explicitly break the loop once client/server received enough There can be tricky cases (that can be reproduced by reducing SO_RCVBUF/SO_SNDBUF to 6144, on linux, and be aware, since linux doubles this const), when there is still write event pending, although we read enough. This should be fixed in a more sophisticated way, but to backport the patch, let's simply break the loop manually. The ssl/bufferevent_wm originally failed on solaris. (cherry picked from commit ae9b285d2d7c9b898049072c157d50769d8014ea)
Azat Khuzhin e66078a0 2019-01-29T21:12:33 Eliminate fd conversion warnings and introduce EVUTIL_INVALID_SOCKET (windows) windows has intptr_t instead of regular int. Also tt_fd_op() had been introduced, since we cannot use tt_int_op() for comparing fd, since it is not always int. (cherry picked from commit b29207dceee33832bb28ab103a833df6a2fd29d3)
Azat Khuzhin 283da047 2019-01-29T21:06:37 test/et/et: use evutil_socket_t* over int* for pointer to the pair Next code will not work correctly under win x64: evutil_socket_t very_long_pair_name[2]; int *pair = very_long_pair_name; // <-- accessing the second word of the first element Because sizeof(evutil_socket_t) == sizeof(intptr_t) == 8 P.S. in the 5334762f another test had been fixed instead of the one that really fails. Fixes: 5334762f ("test/et/et: fix it by using appropriate type for the SOCKET (evutil_socket_t)") Refs: #750 (cherry picked from commit 0791a17204ff70bbea92520352a0c6e8d185fa4b)
Azat Khuzhin aee0fcd5 2019-01-29T10:54:39 Merge branch 'win64-fixes' * win64-fixes: test/et/et: fix it by using appropriate type for the SOCKET (evutil_socket_t) test/et/et: verify return codes appveyor: switch to new VS/MinGW and x64 (cherry picked from commit 97a3e7f5802ce1baa3c959905e312cab2bebf4bf)
Azat Khuzhin eb7b472b 2019-01-29T01:18:39 Merge branch 'http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2' * http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2: http: try to read existing data in buffer under EVHTTP_CON_READ_ON_WRITE_ERROR test: add logging for http/read_on_write_error and rearrange code http: do not call deferred readcb if readcb is not set Refs: #749 (cherry picked from commit 7bfe93886d7fccad2d9a6c76cf47c47d3668f9d1)
Azat Khuzhin 170debc7 2019-01-26T18:52:33 test: adjust expecting error for getaddrinfo() under EMFILE When getaddrinfo() cannot allocate file descriptor glibc/musl-libc on linux report EAI_SYSTEM error. But this is not true for freebsd libc [1] (and hence apple libc [2]), they report EAI_NONAME error instead, so adjust expectation. [1]: https://github.com/freebsd/freebsd/blob/master/lib/libc/net/getaddrinfo.c [2]: https://opensource.apple.com/source/Libc/ Refs: #749 Refs: https://github.com/libevent/libevent/issues/749#issuecomment-457838159 (cherry picked from commit 4ffc7116177230ad2b8b94d51bbf89a14dc83687)
Azat Khuzhin 982a7e88 2019-01-12T13:58:50 test/nonpersist_readd: use assert helpers To debug failure under win32 in appveyor: https://ci.appveyor.com/project/nmathewson/libevent/builds/21559140/job/dn16qdo1j6sr497t#L1620 (cherry picked from commit 91a2f1346e80c67526261ba81c8f3b3736107bcb)
Azat Khuzhin f9c5d17b 2018-12-08T17:35:53 test-fdleak: fix memory leaks Fixes: #726 (cherry picked from commit e5ec52d100ee94af14753513f4b4594e94eb02e1)
Azat Khuzhin f9b592aa 2018-11-23T00:42:46 test: add TT_RETRIABLE for http/cancel_by_host_no_ns Could fail from time to time in travis-ci: https://travis-ci.org/libevent/libevent/jobs/458554097#L1702 Follow-up-for: fe5b0719 ("Mark a lot of flacky tests with TT_RETRIABLE (for linux/win32 only)") (cherry picked from commit 1d2ef90032bc842bc2e295ee4adce3408b6d85da)
Azat Khuzhin 6ea1ec68 2018-11-21T00:10:43 Merge branch 'TT_RETRIABLE' * TT_RETRIABLE: Mark a lot of flacky tests with TT_RETRIABLE (for linux/win32 only) regress: introduce TT_RETRIABLE Fixes: #704 (cherry picked from commit 4d2f013b5d20e674b22e5a8244f7fa63172dbdbf)
Azat Khuzhin 241780bd 2018-11-20T06:20:51 regress_http: fix compilation with !EVENT__HAVE_OPENSSL Fixes: 811c63f7 ("regress: test for HTTP/HTTPS with IOCP enabled") (cherry picked from commit 3036f15a176b038f42d3896463c39058c6bac943)
Azat Khuzhin 018ac6fd 2018-11-13T23:20:10 regress_bufferevent: add TT_IOCP_LEGACY/TT_IOCP (cherry picked from commit f8d510f61777bcb194b945163b84047969a46cef)
Azat Khuzhin 77b587b3 2018-11-13T23:30:51 t/bench_http: disable buffering (win32 do not show anything otherwise) Refs: #255 (cherry picked from commit 903c6acea52a2a2922b5cd43faec1e64631c3da8)
Azat Khuzhin 6bfac964 2018-11-13T22:47:43 Merge branch 'iocp-fixes' * iocp-fixes: regress: test for HTTP/HTTPS with IOCP enabled bev_async: trigger/run only deferred callbacks bev_async: do not initialize timeouts multiple times bev_async: set "ok" on setfd if fd>=0 (like we do during creation) bev_async: ignore ERROR_INVALID_PARAMETER on .setfd for iocp Closes: #709 Refs: nmathewson/Libevent#160 (cherry picked from commit 3d815cf22074792f31274fd6d810a94984661dbf)
Azat Khuzhin 91bb15e6 2018-11-13T09:25:13 regress: add EVENT_NO_FILE_BUFFERING, to disable buffering for stdout/stderr Useful for win32 (cherry picked from commit b2d4fb4176c645b45b8514e4a5a942228ea4e6a9)
Azat Khuzhin 3bc602c2 2018-11-08T00:36:07 regress_ssl: fix ssl/bufferevent_wm_filter for non defered callbacks Even after referenced patch there is still possible recursive callbacks from evbuffer_drain(bev_input), i.e.: wm_transfer() -> evbuffer_drain() -> wm_transfer() inc(ctx->get) But if we will increment ctx->get before drain that we will not add more data to buffer. Refs: 54c6fe3c ("regress_ssl: make ssl/bufferevent_wm_filter more fault-tolerance") CI: https://ci.appveyor.com/project/nmathewson/libevent/build/job/f0rv299i71wnuxdq#L2546 (cherry picked from commit 1fc1c7ef1dabbbb358b99b893712bccc5761f82d)
Azat Khuzhin 98d0f923 2018-11-05T22:25:15 regress_ssl: make ssl/bufferevent_wm_filter more fault-tolerance Due to inplace callbacks (i.e. no BEV_OPT_DEFER_CALLBACKS) we cannot be sure that wm_transfer() will not be called recursively and indeed it still happens sometimes, and the referenced patch increase amount of this times, especially for linux/poll. Fixes: 66304a23cf748714159c988e78f35401c5352827 ("Fix ssl/bufferevent_wm_filter when bev does not reach watermark on break") (cherry picked from commit 54c6fe3c06cb5342130467ecf0f78e3f6d854a36)
Azat Khuzhin 35ca9643 2018-11-05T21:33:54 regress_http: disable http/read_on_write_error under win32 EVHTTP_CON_READ_ON_WRITE_ERROR works only if an error already read from the socket, but if we already got EPIPE on write we cannot read from the socket anymore, and win32 does not guarantee that read will happens before (although it happens from time to time). In the referenced patch I just replaced callback with not expecting 417, but like I already wrote, this is not always true (i.e. it is flacky). Fixes: 3b581693ac1967f7f8d98491cb772a1b415eb4cd ("test/http: read_on_write_error: fix it for win32") (cherry picked from commit 9040707fb176040acf250b09a223d6b4400f4086)
Azat Khuzhin 30020a35 2018-11-04T21:41:20 Merge branch 'ssl_bufferevent_wm_filter-fix' * ssl_bufferevent_wm_filter-fix: Fix ssl/bufferevent_wm_filter when bev does not reach watermark on break regress_ssl: cover watermarks with deferred callbacks regress_ssl: improve bufferevent_wm/bufferevent_wm_filter logging (cherry picked from commit 9d93fbe77968da5ca5b2dbe8973e6f3c3045c5ba)
Azat Khuzhin 6594bfb4 2018-11-02T23:43:57 regress_http: make https_basic non time dependent Fixes: #454 (cherry picked from commit e29afd4b9428631444b208edfe3a4ba6ce4423af)
Azat Khuzhin a39898f3 2018-11-04T01:21:48 Merge branch 'check-O_NONBLOCK-in-debug' * check-O_NONBLOCK-in-debug: regress: use non blocking descriptors whenever it is possible assert that fds are nonblocking in debug mode Closes: nmathewson/Libevent#90 (cherry picked from commit 6f988ee161680925fc3308f17d293c680e3ac916)
Azat Khuzhin ca4b6404 2018-10-31T01:22:30 Merge branch 'event-ET-#636-v2' * event-ET-#636-v2: Preserve ET bit for backends with changelist Epoll ET setting lost with multiple events for same fd Cover ET with multiple events for same fd Add ET flag into event_base_dump_events() Fixes: #636 (cherry picked from commit 33053cdd8a9e1a7330b47759dee9cb209bed8f1b)
Azat Khuzhin 349081e1 2018-10-28T19:48:37 Merge branch 'win32-visibility-event_debug_logging_mask_' * win32-visibility-event_debug_logging_mask_: Introduce EVENT_VISIBILITY_WANT_DLLIMPORT regress_http: use TT_BLAZER() over event_debug() Fixes: #702 (cherry picked from commit fb8666453ce8bb1d599a68636bed5db5ef4a7a57)
Azat Khuzhin 2ad11022 2018-10-28T02:00:16 bench_cascase: include getopt.h only for _WIN32 (like in other places) Fixes: #561 (cherry picked from commit fb42e0fac60d31e081cce4c19df6061bcb56df20)
Azat Khuzhin f895e17e 2018-10-27T19:34:52 regress_ssl: reset static variables on test setup/cleanup and eliminate leaks One tricky bit is reply to the BIO_C_GET_FD command, since otherwise it will try to close(0) and accepted bev in ssl/bufferevent_connect_sleep will leak. Other seems more or less trivial. This was done to make sure that for at least generic cases does not leak (tricky cases was listed here nmathewson/Libevent#83). And this will allow run ssl/.. with --no-fork (cherry picked from commit 9fe952a0aea25474de3dbc30350b1ffa5abcd65a)
Azat Khuzhin a9a5cf4d 2018-10-27T19:41:52 test: export basic_test_setup/basic_test_cleanup to extend them (cherry picked from commit 7cec9b95a3aefb85fcf75610abc8e27e284b251d)
Azat Khuzhin f3aa6a47 2018-10-27T17:36:09 regress_http: basic evhttp_parse_query_str() coverage (cherry picked from commit d161ec3842259f2896fc9b15a1e4d5a1ed178bb2)
Azat Khuzhin b07e43e6 2018-10-25T00:50:50 Merge branch 'evutil_found_ifaddr-dev' * evutil_found_ifaddr-dev: Cover evutil_v4addr_is_local_()/evutil_v6addr_is_local_() Split evutil_found_ifaddr() into helpers (evutil_v{4,6}addr_is_local()) Use INADDR_ANY over 0 in evutil_found_ifaddr() Replace EVUTIL_V4ADDR_IS_*() macroses with static inline functions Filter link-local IPv4 addresses in evutil_found_ifaddr() (cherry picked from commit b2667b76969c2ea382373f885062b45e82d0ac59)
Azat Khuzhin cdcfbafe 2018-10-23T00:12:23 Merge branch 'http-request-line-parsing' * http-request-line-parsing: Fix http https_basic/https_filter_basic under valgrind (increase timeout) http: cover various non RFC3986 conformant URIs http: allow non RFC3986 conformant during parsing request-line (http server) http: do not try to parse request-line if we do not have enough bytes http: allow trailing spaces (and only them) in request-line (like nginx) http: cleanup of the request-line parsing (cherry picked from commit 0ec12bc84cf09307e01dc3b00d08ac1f816b6ff7)
Azat Khuzhin 731053b0 2018-10-21T18:31:01 Simplify bufferevent timeout tests to reduce CPU usage in between start/compare Between start (setting "started_at") and comparing the time when timeouts triggered with the start (test_timeval_diff_eq), there is too much various things that can introduce extra delays and eventually could fail the test on machine with shortage of CPU. And this is exactly what happend on: - travis-ci - #262 Here is a simple reproducer that I came up with for this issue: docker run --cpus=0.01 -e LD_LIBRARY_PATH=$PWD/lib -e PATH=/usr/bin:/bin:$PWD/bin -v $PWD:$PWD --rm -it debian:testing regress --no-fork --verbose bufferevent/bufferevent_timeout Under limited CPU (see reproducer) the test almost always has problems with that "write_timeout_at" exceed default timeval diff tolerance (test_timeval_diff_eq() has 50 tolerance), i.e.: FAIL ../test/regress_bufferevent.c:1040: assert(labs(timeval_msec_diff(((&started_at)), ((&res1.write_timeout_at))) - (100)) <= 50): 101 vs 50 But under some setup write timeout can even not triggered, and the reason for this is that we write to the bufferevent 1024*1024 bytes, and hence if evbuffer_write_iovec() will has some delay after writev() and not send more then one vector at a time [1], it is pretty simple to trigger, i.e.: FAIL ../test/regress_bufferevent.c:1040: assert(labs(timeval_msec_diff(((&started_at)), ((&res1.write_timeout_at))) - (100)) <= 50): 1540155888478 vs 50 [1]: https://gist.github.com/azat/b72773dfe7549fed865d439e03de05c1 So this patch just send static small payload for all cases (plus a few more asserts added). The outcome of this patch is that all regression tests passed on travis-ci for linux box [2]. While before it fails almost always [3]. Also reproducer with CPU limiting via docker also survive some iterations (and strictly speaking it should has less CPU then travis-ci workers I guess). [2]: https://travis-ci.org/azat/libevent/builds/444391481 [3]: https://travis-ci.org/libevent/libevent/builds/444336505 (cherry picked from commit 6ac8e775bb3cba49c276c90e288554635d38b466)
Azat Khuzhin 6e759975 2018-10-21T03:15:34 Merge branch 'regress-dns-fixes' * regress-dns-fixes: Do not rely on getservbyname() for most of the dns regression tests Turn off dns/getaddrinfo_race_gotresolve by default Fix an error for debug locking in dns/getaddrinfo_race_gotresolve (cherry picked from commit bd2184d8d42f721fa523d01b9a9250c75fedb855)
Azat Khuzhin 3f692fff 2018-10-17T23:21:32 Merge branch 'be-wm-overrun-v2' * be-wm-overrun-v2: Fix hangs due to watermarks overruns in bufferevents implementations test: cover watermarks (with some corner cases) in ssl bufferevent Fixes: #690 (cherry picked from commit 878bb2d3b9484b27594308da1d0d6a7c9bdf6647)
Azat Khuzhin e05136c7 2018-09-14T02:24:44 evrpc: avoid NULL dereference on request is not EVHTTP_REQ_POST Fixes: #660 (cherry picked from commit 8483c5351abdd18766232de8431290165717bd57)
Carlo Marcelo Arenas Belón 7d6c88dd 2018-08-15T13:57:01 test: make sure pthread is defined avoid warnings with any modern C99 compiler due to implicit function declaration for pthread_create, as shown by the following : test/regress_dns.c:2226:2: warning: implicit declaration of function 'pthread_create' is invalid in C99 [-Wimplicit-function-declaration] THREAD_START(thread[0], race_base_run, &rp); ^ test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START' pthread_create(&(threadvar), NULL, fn, arg) ^ test/regress_dns.c:2226:2: warning: this function declaration is not a prototype [-Wstrict-prototypes] test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START' pthread_create(&(threadvar), NULL, fn, arg) ^ $ clang --version Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Closes: #686 (cherry-picked) (cherry picked from commit 7af974eeaa7e5cf2f73e3176782c5a788a74f08e)
Philip Prindeville d6c293af 2018-06-16T17:16:10 Eliminate compiler warnings (at least for gcc/linux) Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Closes: #646 # cherry-picked from the PR (cherry picked from commit be371163027d3988a30620537bf3fcb81fb7f077)
Azat Khuzhin 3237d697 2018-08-02T09:29:29 Merge branch 'evdns_getaddrinfo-race-fix' * evdns_getaddrinfo-race-fix: evdns: add regress test for getaddrinfo race evdns: fix race condition in evdns_getaddrinfo() Merges: #673 (cherry picked from commit ee12c516cf5766b2c32203dcc20c32b8691a8ebb)
Leo Zhang 780eaac8 2018-05-15T12:14:05 test: make regress_dns C89 compatible Closes: #635 (cherry-picked) (cherry picked from commit d9ffd2213702bc22c467bd83c230a1a5e97e9e67)
Azat Khuzhin e2732c90 2018-05-07T02:39:44 Make rpc headers self-compilable Fixes: #633 (cherry picked from commit c57f5c34903b02c6e7378865f71a2b83a5befb96)
Azat Khuzhin d9d1c09e 2018-04-24T00:59:11 Notify event base if there are no more events, so it can exit without delay Fixes: #623 (cherry picked from commit 23c2914f6b430f2c2d74c267c13ffab3dda1b325)
Azat Khuzhin 0d194c4e 2018-04-24T14:46:06 test/dns: install correct RLIMIT_NOFILE in bufferevent_connect_hostname_emfile Otherwise poll() will fail with EINVAL: EINVAL The nfds value exceeds the RLIMIT_NOFILE value. P.S. and cleanup this test a little, with early-return. CI: https://travis-ci.org/libevent/libevent/jobs/370350426 (cherry picked from commit d1c8993c3c34030b68ecb6079bd9dce8cb3d3604)
Azat Khuzhin 61b95600 2018-04-24T02:22:58 test/http: cover evhttp_connection_get_addr() for incomming connections Refs: #510 (cherry picked from commit e4edc7fc27bb96b4811f1c24d591f5c5bca69bdd)
Azat Khuzhin f3eb294f 2018-04-24T01:45:00 test/dns: verify bufferevent_socket_connect() errorcb invoking if socket() fails Refs: #600 (cherry picked from commit a3d8f2e09302536c6c0ffc3ccb1fc6f43b51dc4f)
Azat Khuzhin 442c7d94 2018-04-24T01:34:06 test/dns: cleanup test_bufferevent_connect_hostname() (cherry picked from commit 623ef3ccdc0aafac7ae77a723cbad6d552ff9a01)
Bernard Spil 894ca48a 2018-04-02T13:18:27 Fix build with LibreSSL 2.7 LibreSSL 2.7 implements OpenSSL 1.1 API except for BIO_get_init() See also: https://bugs.freebsd.org/226900 Signed-off-by: Bernard Spil <brnrd@FreeBSD.org> Closes: #617 (cherry-pick) (cherry picked from commit 28b8075400c70b2d2da2ce07e590c2ec6d11783d)
Greg Hazel ebfac517 2018-03-20T15:12:07 Call underlying bev ctrl GET_FD on filtered bufferevents Fixes: #611 Fixes: #610 (cherry picked from commit 4055081499cba32642dd72427a8f9d3ad7e50e79)
Azat Khuzhin df2ed13f 2018-01-04T19:28:59 Merge branch 'listener-immediate-close' * listener-immediate-close: test/listener: cover immediate-close logic Immediately stop trying to accept more connections if listener disabled (cherry picked from commit 416b48ba7a0b44407b7a053bd21830aa75d7162f)
Azat Khuzhin 42e851bb 2017-12-10T23:57:19 Merge branch 'evconnlistener-do-not-close-client-fd' Fixes: #577 * evconnlistener-do-not-close-client-fd: listener: cover closing of fd in case evconnlistener_free() called from acceptcb Revert "Fix potential fd leak in listener_read_cb()" (cherry picked from commit bc65ffc14c62c10feffefe6c3d9975ce1d1a8cd8)
Azat Khuzhin 01bc36c1 2017-11-22T10:33:15 Add missing includes into openssl-compat.h Before it depends from the caller #include appropriate headers (at least for OPENSSL_VERSION_NUMBER), but let's make it independent. Fixes: #574 (cherry picked from commit c2c08e0203da93938fe35234fa3a1be4d1c3c2e1)
Azat Khuzhin b2581380 2017-11-04T19:13:28 Fix crashing http server when callback do not reply in place from *gencb* This is the second hunk of the first patch 5ff8eb26371c4dc56f384b2de35bea2d87814779 ("Fix crashing http server when callback do not reply in place") Fixes: #567 (cherry picked from commit 306747e51c1f0de679a3b165b9429418c89f8d6a)
Azat Khuzhin 5b40744d 2017-10-23T00:13:37 Fix crashing http server when callback do not reply in place General http callback looks like: static void http_cb(struct evhttp_request *req, void *arg) { evhttp_send_reply(req, HTTP_OK, "Everything is fine", NULL); } And they will work fine becuase in this case http will write request first, and during write preparation it will disable *read callback* (in evhttp_write_buffer()), but if we don't reply immediately, for example: static void http_cb(struct evhttp_request *req, void *arg) { return; } This will leave connection in incorrect state, and if another request will be written to the same connection libevent will abort with: [err] ../http.c: illegal connection state 7 Because it thinks that read for now is not possible, since there were no write. Fix this by disabling EV_READ entirely. We couldn't just reset callbacks because this will leave EOF detection, which we don't need, since user hasn't replied to callback yet. Reported-by: Cory Fields <cory@coryfields.com> (cherry picked from commit 5ff8eb26371c4dc56f384b2de35bea2d87814779)
Kiyoshi Aman 532a8cc3 2017-09-14T17:39:20 Port `event_rpcgen.py` and `test/check-dumpevents.py` to Python 3. These scripts remain compatible with Python 2. (cherry picked from commit 8b0aa7b36a3250fad4953f194c8a94ab25032583)
Vincent JARDIN 7cc034c3 2017-09-11T21:56:30 test: fix warning In function ‘send_a_byte_cb’: test/regress.c:1853:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void) write(*sockp, "A", 1); (cherry picked from commit 56010f37ae5b49881f7fd255d5c8a936e1c36909)
Carlo Marcelo Arenas Belón 1811a040 2017-08-16T16:52:33 test: avoid regress hanging in macOS a backtrace of the process without this patch : * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00007fffb1fb7d96 libsystem_kernel.dylib`kevent + 10 frame #1: 0x0000000108ed0a58 libevent-2.2.1.dylib`kq_dispatch + 696 frame #2: 0x0000000108ec53d8 libevent-2.2.1.dylib`event_base_loop + 696 frame #3: 0x0000000108e1763b regress`test_fork + 1931 frame #4: 0x0000000108e5c7ad regress`run_legacy_test_fn + 45 frame #5: 0x0000000108e690aa regress`testcase_run_one + 858 frame #6: 0x0000000108e6954f regress`tinytest_main + 495 frame #7: 0x0000000108e5c94b regress`main + 171 frame #8: 0x00007fffb1e88235 libdyld.dylib`start + 1 frame #9: 0x00007fffb1e88235 libdyld.dylib`start + 1 Issue: #546 (cherry picked from commit a86f89d333d870e6714bd28c695ba1774df3d7f5)
Carlo Marcelo Arenas Belón 8983e511 2017-09-01T15:50:36 test: fix 32bit linux regress (cherry picked from commit 63c4bf78d6af3c6ff46d2e8e4b53dd9f577a9ca9)
Ondřej Kuzník c46ff439 2017-06-28T12:29:29 Fix tests with detached builds Closes: #524 (cherry picked from commit cf7f5b0dc484152ae3be7ea6ba57552595891608)
Azat Khuzhin 300a0dc6 2017-05-01T21:56:27 test: do not use .fieldname in structure initializations (fixes win32) Fixes: #497 (cherry picked from commit 15da23cfdbeb5d5b4eeafca0cd93962c26641ae5)
Azat Khuzhin 822d6462 2017-05-01T21:55:00 Add missing print-winsock-errors.c into dist archive Refs: #497 (cherry picked from commit 8d89c212587c560df8cd7089fb1a2fcd2a3dca82)
Azat Khuzhin 23db7476 2017-04-30T01:11:31 test: cover that after event_del() callback will not be scheduled again Refs: #236 Refs: #225 (cherry picked from commit 5ff83989f30daef93a851c2162667375ed1663a5)
Azat Khuzhin ebd12e6d 2017-03-14T13:31:02 Merge branch 'win32-fixes' This patchset fixes win32 builds after some previous patches (referenced in particular commits), and also removes some quirks for win32. * win32-fixes: test: do not return void log/win32: fix exporting extern variable log-internal: missing extern "C" log: remove USE_GLOBAL_FOR_DEBUG_LOGGING cmake: Export missing symbols for win32 cmake: eliminate EVENT_BUILDING_REGRESS_TEST, since we link with shared libs test: windows doesn't have WNOWAIT cmake: clean not used #defines from event-config.h cmake: add <pthread.h> only for non-win32 (cherry picked from commit d84f0205453941235b0e04729098d4329c189bba)
Azat Khuzhin a0bfe2c4 2017-03-08T17:58:26 Merge branch 'cmake-configure-fixes-v2' Fixes in cmake, to make it more like configure and support some cross-compiling. * cmake-configure-fixes-v2: cmake: fix extracting of the version from git (check for number of matches) Detect arch4random_addrandom() existence Use off_t instead of ev_off_t for sendfile() (fixes android build) cmake: detect _GNU_SOURCE not by __GNU_LIBRARY__ only (fallback to _GNU_SOURCE) Check for WNOWAIT in waitpid() in runtime (not in cmake/configure) cmake: add <pthread.h> into CMAKE_REQUIRED_INCLUDES for sizeof(pthread_t) cmake: fix values for #cmakedefine cmake: drop duplicates from event-config template cmake: add value for the #cmakedefine macros (like autoconf) cmake: Fix checking of enum values from sysctl.h (cherry picked from commit 5aade2d30b6c5eff226cbf7b63fda5a01987ba4f)
Jan Beich 230af9f0 2017-01-28T16:42:13 Unbreak build with LibreSSL after openssl 1.1 support added Fixes: 3e9e0a0d46e4 ("Make it build using OpenSSL 1.1.0") Fixes: #445 (cherry picked from commit d057c45e8f48aa90d8b340cac4c8ae4cc8b5d0ac)
Azat Khuzhin 8567f2f5 2017-01-29T23:07:40 Merge branch 'fix-struct-linger' @jbech "Accidentally disabled by 0dda56a due to confusion between struct linger vs. SO_LINGER and #define vs. AC_DEFINE. Try adding synthetic #error test to confirm." * fix-struct-linger: cmake: check for 'struct linger' existence test/bench*: prefix event-config.h macros after 0dda56a48e94 test/bench_httpclient: restore SO_LINGER usage after 0dda56a48e94 Fixes: #444 (original pull-request) (cherry picked from commit 9d5a4bdc5cfbf2385efc7c58103161b3512c4500)
Azat Khuzhin ea1d30ca 2017-01-20T16:29:19 test: register different tests in automake Before this patch we have one test.sh (well test-script.sh), and tooks very long to run it sequentially, but they are pretty lightweight, so we should run then in parallel.
Azat Khuzhin 54d7473f 2017-01-20T16:29:02 test: run different tests under different options (in a wrapper)
Azat Khuzhin d6bafbbe 2017-01-20T02:11:35 test/dns: replace servname since solaris does not have "http" Yes, by default solaris (solaris10.dev 5.10 Generic_147148-26 i86pc i386 i86pc) does not have "http" in /etc/services
Azat Khuzhin 09b62013 2016-12-08T02:11:22 test/ssl: fix bufferevent_getfd() for bufferevent_openssl_filter_new()
Azat Khuzhin d77fcea1 2016-12-07T03:07:59 test/https: separate cases for https client with filtered openssl bufferevent - http/https_filter_chunk_out # now hang - http/https_filter_basic # works, since writes only before connect()
Azat Khuzhin d047c241 2016-12-02T18:32:03 test/ssl: cover case when we writing to be_openssl after connecting Right now it fails because of regression for filtered openssl bufferevent, and by it I mean ssl/bufferevent_filter_write_after_connect test, and by fails - hang. Regression-for: da52933550fd4736aa1c213b6de497e2ffc31e34 ("be_openssl: don't call do_write() directly from outbuf_cb")
Azat Khuzhin 3c7422fc 2017-01-19T20:51:38 test/thread: netbsd is too slow, increase timeout for conditions_simple
Azat Khuzhin 07862531 2017-01-19T20:34:41 test/dns: run async resolving after sync one (to avoid timeouts) If system resolver (sync one) will respond too slow, then we can fail async request and evdns will retransmit tham again, but evdns server will accept that failed requets, so we will have not 2 requests but 4. Reproduced on centos box sometimes.
Azat Khuzhin 26f416c1 2017-01-07T11:48:28 test/http: turn off some tests that based on backlog filling (falky) Since this technique does not work well everywhere, anyway it fails from time to time. See: https://travis-ci.org/libevent/libevent/jobs/186426446
Azat Khuzhin 4798de6c 2016-12-22T14:55:33 test: fix util/date_rfc1123 under win32 Refs: #417 v2: check when gmtime() returns NULL v3: fix overflow cases
Azat Khuzhin 4545807d 2016-12-19T10:22:51 Fix UB in evutil_date_rfc1123() As pointed in https://github.com/libevent/libevent/pull/417#issuecomment-267860738 "code is unsafe because in evutil_date_rfc1123() the pointer to the automatic variable struct tm cur is used outside the scope it defined." Checked with `clang -fsanitize=address -fsanitize-address-use-after-scope` and test that call evutil_date_rfc1123() with tm==NULL
Vis Virial 360aa233 2016-12-16T14:49:59 add tests for evutil_date_rfc1123().
Azat Khuzhin cfe2ab22 2016-11-19T17:53:38 test/https: fix ssl dirty bypass for https_simple Tests: - http/https_simple_dirty # not affected, since dirty is the default - http/https_simple # affected v2: fix compilation with -DEVENT__DISABLE_OPENSSL=ON
Azat Khuzhin 45247e6f 2016-11-19T15:54:52 test/https: cover multiple request over the same connection Introduce two new tests: - http/https_connection # fail - http/https_persist_connection # ok Reported-by: liutao74748@163.com
Azat Khuzhin e6ae069b 2016-11-19T17:11:35 test/http: sanity check for http_request_empty_done()
Azat Khuzhin 532a47ce 2016-11-14T02:17:51 test: fix building under openssl 1.1 (init functions has been deprecated) Refs: #397
Azat Khuzhin 336f3b11 2016-12-06T13:15:27 Fix _FILE_OFFSET_BITS redinition (solaris/autotools) So firstly include our header (config.h) -- <evconfig-private.h>, and only after it <sys/types.h> since latest has #ifdef guard, while our config.h is not inteded for this. And besides all this thing with LARGE_FILE is a abit awkward, since we don't nefine _LP64/_LP32 anyway, and so we have next error actually (64bit VS 32bit): ==> solaris: In file included from ./util-internal.h:30:0, ==> solaris: from test/regress_ssl.c:49: ==> solaris: ./evconfig-private.h:29:0: warning: "_FILE_OFFSET_BITS" redefined ==> solaris: #define _FILE_OFFSET_BITS 64 ==> solaris: ^ ==> solaris: In file included from /usr/include/sys/types.h:17:0, ==> solaris: from test/regress_ssl.c:38: ==> solaris: /opt/csw/lib/gcc/i386-pc-solaris2.10/5.2.0/include-fixed/sys/feature_tests.h:196:0: note: this is the location of the previous definition ==> solaris: #define _FILE_OFFSET_BITS 32 ==> solaris: ^ For cmake it commented in: 8b228e27f57300be61b57a41a2ec8666b726dc34 ("Lot's of cmake updates")
Azat Khuzhin 253e7fa9 2016-12-06T12:08:32 util-internal: fix __func__ redefinition (netbsd) ==> netbsd: In file included from ../listener.c:57:0: ==> netbsd: ../util-internal.h:58:0: warning: "__func__" redefined [enabled by default] ==> netbsd: #define __func__ EVENT____func__ ==> netbsd: ^ ==> netbsd: In file included from /usr/include/amd64/types.h:39:0, ==> netbsd: from /usr/include/sys/types.h:45, ==> netbsd: from ../listener.c:30: ==> netbsd: /usr/include/sys/cdefs.h:394:0: note: this is the location of the previous definition ==> netbsd: #define __func__ __PRETTY_FUNCTION__
Azat Khuzhin 2c62062e 2016-12-06T11:55:44 Fix signedness differ for iov_base (solaris)
Philip Prindeville 6bf2061c 2016-11-11T17:51:37 C90 doesn't like declarations intermingled with statements So move all of the declarations to the top of the offending function. This patch includes both of issues (Fixes:), from @jeking3 and @pprindeville Fixes: #418 Fixes: nmathewson/Libevent#136
Tim Hentenaar cb0df5cf 2016-07-15T02:27:23 test/regress: cover a polling of invalid fd Test that an event's callback is called if the fd is closed prior to being polled for activity. azat: make it run only for poll backend/method, and do not close fd twice
Thomas Bernard e9837124 2014-12-13T19:42:42 use ev_uint16_t instead of unsigned short for port Like in `sockaddr_in` structure in /usr/include/netinet/in.h @azat: convert all other users (bench, compat, ..) and tweak message Fixes: #178 Fixes: #196 Refs: 6bf1ca78 Link: https://codereview.appspot.com/156040043/#msg4
Kurt Roeckx 3e9e0a0d 2016-09-19T22:05:15 Make it build using OpenSSL 1.1.0 Rebased (azat): - tabs instead of whitespaces - make openssl-compat.h safe for complex expressions - do not call sk_SSL_COMP_free() in 1.1 (fixes double free) TODO: - clean methods_bufferevent Closes: #397 (cherry-picked)
Adam Langley f9803a69 2016-10-12T17:49:10 Switch from a 512 to 2048-bit RSA key. The 512 bit key is too small to sign larger hashes. This can cause the regression tests to fail depending on the defaults in libssl.
Azat Khuzhin 43eb56c7 2016-08-11T16:15:45 tests: use waitpid(..., WNOWAIT) to fix failing of main/fork under solaris According to solaris docs: "One instance of a SIGCHLD signal is queued for each child process whose status has changed. If waitpid() returns because the status of a child process is available, and WNOWAIT was not specified in options, any pending SIGCHLD signal associated with the process ID of that child process is discarded. Any other pending SIGCHLD signals remain pending." And interesting thing that it works if you add sleep(1) before waitpid(), and also if you run with --verbose (some race or what). But linux doesn't support WNOWAIT in waitpid() so add detection into cmake/autotools. Fixes: #387 Link: https://bugzilla.redhat.com/show_bug.cgi?id=840782
Azat Khuzhin 16d220cb 2016-08-11T13:43:14 test: replace sleeping with syncing pair in main/fork About this syncing pair: - read endpoint, must be blocked, to make it a checkpoint or smth like this - write endpoint, must be nonblocking, to avoid readcb hung Refs: #387