Log

Author Commit Date CI Message
Alexander Drozdov 68eb526d 2019-03-13T10:51:55 http: add WebDAV methods support WebDAV introduced new HTTP methods (RFC4918): PROPFIND, PROPPATCH, MKCOL, LOCK, UNLOCK, COPY, MOVE. Add support of the methods.
Azat Khuzhin bf19462a 2019-03-13T00:20:25 http: suppress -Wwrite-string in evhttp_parse_query_impl()
Azat Khuzhin 42d5a36b 2019-03-13T00:02:39 cmake: sync warnings with autotools v2 By some reason gcc reports next error: ../http.c:3330:11: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] value = ""; Only under -Wwrite-strings, well this is logical, but this information does not reflected in any documentation. Follow-up: 8348b413 ("cmake: add various warning flags like autotools has") f
Sayan Nandan 42cc731b 2019-03-10T19:51:44 Update documentation [ci skip] The documentation for building and installing has been moved into a new Documentation section Closes: #788 (cherry-picked)
Sayan Nandan 56c9551e 2019-03-08T16:47:56 Move list of contributors into separate file Closes: #786 (cherry-picked)
Azat Khuzhin 5ee507c8 2019-03-04T06:53:42 http: implement separate timeouts for read/write/connect phase This patch allows to change timeout for next events read/write/connect separatelly, using new API: - client: evhttp_connection_set_connect_timeout_tv() -- for connect evhttp_connection_set_read_timeout_tv() -- for read evhttp_connection_set_write_timeout_tv() -- for write - server: evhttp_set_read_timeout_tv() -- for read evhttp_set_write_timeout_tv() -- for write It also changes a logic a little, before there was next fallbacks which does not handled in new API: - HTTP_CONNECT_TIMEOUT - HTTP_WRITE_TIMEOUT - HTTP_READ_TIMEOUT And introduce another internal flag (EVHTTP_CON_TIMEOUT_ADJUSTED) that will be used in evrpc, which adjust evhttp_connection timeout only if it is not default. Fixes: #692 Fixes: #715
John Ohl 62df1301 2014-12-09T21:43:18 Add support for EV_TIMEOUT to event_base_active_by_fd Closes: #194 (cherry-pick)
Azat Khuzhin c4fbae3a 2019-03-03T19:03:29 buffer: make evbuffer_prepend() of zero-length array no-op Refs: #774
Azat Khuzhin b69524c0 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*
Azat Khuzhin 5b19c9f6 2019-03-03T16:29:52 buffer: do not rely on ->off in advance_last_with_data() advance_last_with_data() adjusts evbuffer.last_with_datap, and if we will have empty chain in the middle advance_last_with_data() will stop, while it should not, since while empty chains is not regular thing they can pops up in various places like, and while I did not look through all of them the most tricky I would say is: evbuffer_reverse_space()/evbuffer_commit_space() evbuffer_add_reference() Test case from: https://github.com/envoyproxy/envoy/pull/6062 Fixes: #778 v2: keep last_with_datap really last with data, i.e. update only if chain has data in it
Azat Khuzhin fdfabbec 2019-03-02T22:50:00 buffer: fix evbuffer_remove_buffer() with empty chain in front In case we have empty chain (chain that do not have any data, i.e. ->off == 0) at the beginning of the buffer, and no more full chains to move to the dst, we will skip moving of this empty chain, and hence last_with_datap will not be adjusted, and things will be broken after. Fix this by not relying on ->off, just count if we have something to move that's it. Test case from: https://github.com/envoyproxy/envoy/pull/6062 Fixes: #774
Azat Khuzhin 91acedcc 2019-03-03T17:43:37 test: verify content of the buffer in evbuffer/remove_buffer_with_empty* And replace spaces with tab in remove_buffer_with_empty
Seong-Joong Kim 16a151df 2019-02-21T16:19:10 Remove needless check for arc4_seeded_ok
Enji Cooper 91dad75f 2019-02-28T17:47:51 Fix typos: warnigns -> warnings Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Enji Cooper 0b468bb0 2019-02-28T17:22:30 Fix typos in a comment describing the purpose of `VersionViaGit.cmake` Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Enji Cooper 5f87be42 2019-02-25T11:59:15 Define `_GNU_SOURCE` properly/consistently per autoconf Although `_GNU_SOURCE` can be defined as an arbitrary #define per the glibc docs [1], it's best to define it in a manner consistent with the way that autoconf defines it, i.e., `1`. While this shouldn't matter in most cases, it does when the headers from other projects follow the poorly defined GNU convention implemented by autoconf and are included after the libevent's util.h header. An example failure with clang, similar to the failure I encountered, is as follows: ``` $ printf "#define _GNU_SOURCE\n#define _GNU_SOURCE 1" | clang -c -x c - <stdin>:2:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined] ^ <stdin>:1:9: note: previous definition is here ^ 1 warning generated. ``` This happened when compiling python [2] with a stale homebrew util.h file from libevent (which admittedly would not happen in a correct libevent install, as the header should be installed under /usr/local/include/event2/util.h). However, if both headers had been combined (which is more likely), it would have failed as shown above. Removing the ad hoc definition unbreaks compiling python's pyconfig.h.in header when included after util.h from libevent. 1. http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html 2. https://github.com/python/cpython/blob/master/configure.ac#L126 Closes: #773 (cherry-picked) Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Yury Korzhetsky a30d6d85 2019-02-26T12:33:49 Don't loose top error in SSL Closes: #775 (cherry-picked)
Azat Khuzhin b34192ba 2019-02-25T00:26:39 Ignore bitrise branches for travis-ci/appvyeor [ci skip]
Azat Khuzhin 2fccb967 2019-02-24T22:59:33 Update link to the appveyor project Since the migration request has been hanged for a while, let's switch it for now without beauty API URL. Fixes: #555
Azat Khuzhin 5722e13b 2019-02-24T17:34:20 Match definition with prototype for bufferevent_socket_set_conn_address_fd_() Fixes: #772 Fixes: b29207dc ("Eliminate fd conversion warnings and introduce EVUTIL_INVALID_SOCKET (windows)")
Azat Khuzhin 14eb903b 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
Azat Khuzhin 728c5dc1 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
Nathan French 8d5b14d4 2019-02-21T10:21:02 Merge pull request #769 from sungjungk/fix-return-handling Add error-handling routine for arc4_seed()
Seong-Joong Kim 493a1da9 2019-02-21T18:13:05 Add error-handling routine for arc4_seed()
Nathan French fb134939 2019-02-07T11:43:14 Added DNS header mask definitions. Currently, we do a lot of data munging with manual hex. This is ugly and can lead to bugs. I defined the following: _QR_MASK 0x8000U _OP_MASK 0x7800U _AA_MASK 0x0400U _TC_MASK 0x0200U _RD_MASK 0x0100U _RA_MASK 0x0080U _Z_MASK 0x0040U _AD_MASK 0x0020U _CD_MASK 0x0010U _RCODE_MASK 0x000fU So that we can more easily twiddle flags. v2: make evdns flag masks unsigned literal Closes: #756 (cherry-picked)
Azat Khuzhin 63c6669f 2019-02-06T00:12:35 Use the logo from the libevent.org
Azat Khuzhin 6dbad0f6 2019-02-04T22:34:10 test/dns: in solaris under EMFILE devpoll does not dispatch (due DP_POLL failure)
Azat Khuzhin 8e87de3c 2019-02-04T22:18:45 cmake: fix checking of devpoll backend (like in autotools, by devpoll.h existence)
Azat Khuzhin d234902d 2019-02-03T18:54:00 test/dns: in solaris under EMFILE the error is EAI_FAIL
Azat Khuzhin ae9b285d 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.
Azat Khuzhin b29207dc 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.
Azat Khuzhin 74c10894 2019-01-29T21:31:19 evmap: use approparite type for changes to avoid warnings under windows
Azat Khuzhin 0791a172 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
Azat Khuzhin e2e82241 2019-01-29T20:58:01 appveyor: disable verbosity of MSBuild
Azat Khuzhin 97a3e7f5 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
Azat Khuzhin 5334762f 2019-01-29T10:42:50 test/et/et: fix it by using appropriate type for the SOCKET (evutil_socket_t) Fixes: #750
Azat Khuzhin 3e37fcd4 2019-01-29T01:44:33 test/et/et: verify return codes
Azat Khuzhin 588ee6df 2018-11-24T20:22:40 appveyor: switch to new VS/MinGW and x64 The cache had been reseted with the following REST API requests: DELETE https://ci.appveyor.com/api/projects/nmathewson/libevent/buildCache DELETE https://ci.appveyor.com/api/projects/libevent/libevent/buildCache DELETE https://ci.appveyor.com/api/projects/azat/libevent/buildCache
Azat Khuzhin 8882f4fd 2019-01-29T07:56:21 win32select: print an error in case of failure
Azat Khuzhin f88b8946 2019-01-29T10:10:23 Add OS-specific exclude patterns of the branch names for the CI
Azat Khuzhin afdccee9 2019-01-29T01:23:02 s/http-server: fix cleanup routines Fixes: bdd71f18 ("s/http-server: graceful cleanup")
Azat Khuzhin 7bfe9388 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
Azat Khuzhin 30791ecc 2019-01-29T01:09:44 http: try to read existing data in buffer under EVHTTP_CON_READ_ON_WRITE_ERROR There are two possible ways of getting response from the server: - processing existing bufferevent buffer - reading from the socket (even after write() errored with -1, it is still possible) But we did not tried the first option, only the second one. Fixes: http/read_on_write_error (on freebsd/osx)
Azat Khuzhin b8ca5a68 2019-01-27T15:28:28 test: add logging for http/read_on_write_error and rearrange code
Azat Khuzhin d3dcb5ac 2019-01-27T15:16:39 http: do not call deferred readcb if readcb is not set Otherwise evhttp_read_cb can be called with invalid connection state: http/read_on_write_error: [forking] [msg] libevent using: kqueue FAIL ../test/regress_http.c:4079: assert(req) FAIL ../test/regress_http.c:4087: assert(req)[err] evhttp_read_cb: illegal connection state 0
Azat Khuzhin 5613bfb8 2019-01-28T22:19:20 Merge branch 'travis-ci-osx-fixes' * travis-ci-osx-fixes: travis-ci/osx: switch to xcode 10.1, since 9.4 is not compatible with gcc-8 travis-ci/osx: install gcc and fix CC
Azat Khuzhin b35b5336 2019-01-28T21:22:27 travis-ci/osx: switch to xcode 10.1, since 9.4 is not compatible with gcc-8 Refs: travis-ci/travis-ci#9640
Azat Khuzhin 9432fa2e 2019-01-28T20:30:57 travis-ci/osx: install gcc and fix CC Since there is no gcc in osx_image [1]: ls: /usr/local/bin/gcc-?.?: No such file or directory [1]: https://travis-ci.org/libevent/libevent/jobs/484794192#L95 And use ls(1) over echo(1) to show an error if there is no such file.
Azat Khuzhin 4ffc7116 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
Azat Khuzhin 91a2f134 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
Azat Khuzhin 99b231b0 2019-01-11T21:52:11 rpc: use *_new_with_arg() to match function prototype In 755fbf16c ("Add void* arguments to request_new and reply_new evrpc hooks") this new functions had been introduced, but newer used, what for? So let's use them.
Luke Dashjr 28d7221b 2018-12-28T04:42:20 http: Preserve socket error from listen across closesocket cleanup Closes: #738 (cherry-picked)
Azat Khuzhin 246f4404 2018-12-17T21:31:54 cmake: support static runtime (MSVC) Fixes: #737
Azat Khuzhin 51945fd9 2018-12-17T21:41:32 appveyor: cover static libs for MSVC
baixiangcpp 972da7c8 2018-12-15T21:45:36 fix a comment error Closes: #736 (cherry-picked)
Fredrik Strupe f33c2ce5 2018-12-15T12:54:31 cmake: Fix some typos in option descriptions
Azat Khuzhin f3f7aa5a 2018-12-07T21:46:27 http: fix connection retries when there more then one request for connection We should not attemp to establishe the connection if there is retry timer active, since otherwise there will be a bug. Imagine next situation: con = evhttp_connection_base_new() evhttp_connection_set_retries(con, 2) req = evhttp_request_new() evhttp_make_request(con, req, ...) # failed during connecting, and timer for 2 second scheduler (retry_ev) Then another request scheduled for this evcon: evhttp_make_request(con, req, ...) # got request from server, # and now it tries to read the response from the server # (req.kind == EVHTTP_RESPONSE) # # but at this point retry_ev scheduled, # and it schedules the connect again, # and after the connect will succeeed, it will pick request with # EVHTTP_RESPONSE for sending and this is completelly wrong and will # fail in evhttp_make_header_response() since there is no # "http_server" for this evcon This was a long standing issue, that I came across few years ago firstly, bad only now I had time to dig into it (but right now it was pretty simple, by limiting amount of CPU for the process and using rr for debug to go back and forth).
Azat Khuzhin 9d3a415a 2018-12-09T14:48:44 Do not check O_NONBLOCK for invalid fds Fixes: 6f988ee1 ("Merge branch 'check-O_NONBLOCK-in-debug'")
Azat Khuzhin e5ec52d1 2018-12-08T17:35:53 test-fdleak: fix memory leaks Fixes: #726
Azat Khuzhin 3e6bec7c 2018-12-05T11:40:40 travis-ci: do not run coveralls with clang (SIGSEGV) This will fix coveralls badge See: https://travis-ci.org/libevent/libevent/jobs/458590276#L1425
Azat Khuzhin 196e3a7b 2018-12-05T11:46:30 Add mailmap
Azat Khuzhin 1d2ef900 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)")
Azat Khuzhin 1a79fd38 2018-11-21T07:04:33 appveyor: enable parallel build
Azat Khuzhin 90d80ef4 2018-11-23T00:29:55 cmake: do not build both (SHARED and STATIC) for MSVC/win32 MSVC does not support SHARED and STATIC libraries with the same name, so let's just build SHARED libraries by default instead (yes we can add prefix but let's stick with this). The reason for this is that in windows shared libraries requires .lib file too, but this is not static library it is imported library for shared (doh...), for more info [1] and [2]. [1]: https://docs.microsoft.com/en-us/windows/desktop/dlls/dynamic-link-library-creation [2]: https://blogs.msdn.microsoft.com/oldnewthing/20091013-00/?p=16403 And when we build both static library can and will override shared library imported part, let's take a look at event_extra.lib: - before patch [3]: $ less libevent-fail/lib/Debug/event_extra.lib | head ==> use library:contained_file to view a file in the archive rw-rw-rw- 100666/100666 59568 Nov 21 23:55 2018 event_extra_static.dir/Debug/evrpc.obj rw-rw-rw- 100666/100666 252219 Nov 21 23:55 2018 event_extra_static.dir/Debug/evdns.obj rw-rw-rw- 100666/100666 203850 Nov 21 23:55 2018 event_extra_static.dir/Debug/http.obj rw-rw-rw- 100666/100666 25907 Nov 21 23:55 2018 event_extra_static.dir/Debug/event_tagging.obj [3]: https://ci.appveyor.com/project/azat/libevent/builds/20472024/job/t0o93v042jai0dj7 - "after patch" [4] (not after but the same effect): $ less libevent-ok/lib/Debug/event_extra.lib | head ==> use library:contained_file to view a file in the archive --------- 0/0 509 Nov 21 23:38 2018 event_extra.dll ... [4]: https://ci.appveyor.com/project/azat/libevent/builds/20478998/job/ca9k3c76amc4qr76 Refs: #691
Azat Khuzhin c9a073ea 2018-11-22T23:00:11 cmake: introduce EVENT__LIBRARY_TYPE option Long time ago in [1] cmake build was forced to compile both libraries (SHARED and STATIC), since this is how our autotools build works. [1]: 7182c2f561570cd9ceb704623ebe9ae3608c7b43 ("cmake: build SHARED and STATIC libraries (like autoconf does)") And there is no way to configure this (and indeed you need to do this for MSVC for example), so let's introduce option for this -- EVENT__LIBRARY_TYPE. Plus now we have INTERFACE libraries, that we can use internally in libevent's cmake rules to avoid strict to _shared/_static variant of the libraries to link with samples/tests (we prefer SHARED over STATIC for linking). Also bump minimal cmake required version to 3.1 by the following reasons: - 3.1 is required for RPATH configuration under APPLE - 3.0 is required for add_library(INTERFACE) (did not found it in 2.8.x documentation) - remove extra conditions (anyway 3.1 was release 4 years ago, so I guess that most of the systems will have it)
Azat Khuzhin d705e8c0 2018-11-21T07:31:57 cmake: drop redundant add_dependencies()
Azat Khuzhin 4d2f013b 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
Azat Khuzhin fe5b0719 2018-11-20T11:46:44 Mark a lot of flacky tests with TT_RETRIABLE (for linux/win32 only) This patch mark testcases that only fail under travis-ci/appveyor with TT_RETRIABLE, since otherwise there is too much noise, other issues (like failures under vagrant boxes) would be investigated separatelly. linux (from travis-ci only): - http/cancel_by_host_no_ns - http/cancel_by_host_inactive_server - http/cancel_by_host_ns_timeout - http/cancel_by_host_ns_timeout_inactive_server - thread/conditions_simple - util/monotonic_prc_precise - util/usleep - main/del_wait vagrant/ubuntu box (this is the only exception): - thread/no_events win32 (from appveyor only): - main/active_later - main/persistent_active_timeout And we should use TT_RETRIABLE over TT_OFF_BY_DEFAULT/TT_SKIP when it make sense. But there is still "test-ratelim__group_lim" left.
Azat Khuzhin 63b065be 2018-11-20T01:06:04 regress: introduce TT_RETRIABLE We have some tests that has false-positive due to real/CPU time bound, but they are pretty generic and we do not want to skip them by default. TT_RETRIABLE is the flag that will indicate tinytest to retry the test in case of failure, use it to avoid next possible false-positives: - real time-related - CPU time-related Since I guess it is better to see/grepping RETRYING messages over ignoring completely failed builds. No configuration switch for number of retries was done on purpose (only 3 retries and no more). And this is how it looks BTW: $ gcc ../test/tinytest_demo.c ../test/tinytest.c $ ./a.out --verbose --no-fork demo/timeout_retry demo/timeout_retry: FAIL ../test/tinytest_demo.c:201: assert(i != 1): 1 vs 1 [timeout_retry FAILED] [RETRYING timeout_retry (3)] demo/timeout_retry: OK ../test/tinytest_demo.c:201: assert(i != 1): 2 vs 1 OK ../test/tinytest_demo.c:213: assert(t2-t1 >= 4): 5 vs 4 OK ../test/tinytest_demo.c:215: assert(t2-t1 <= 6): 5 vs 6 1 tests ok. (0 skipped)
Azat Khuzhin 57765b23 2018-11-20T00:58:47 bufferevent: add debug messages when .setfd/.getfd/.enable/.disable failed
Azat Khuzhin b98d32d0 2018-11-14T00:20:20 http: improve error path for bufferevent_{setfd,enable,disable}() We have calls to the next functions but do not check return values, though they can be invalid and it is better to show this somehow. Also do bufferevent_setfd() first and only after it bufferevent_enable()/bufferevent_disable() since: a) it is more natural b) it will avoid extra operations c) it will not fail first bufferevent_enable() (this is the case for buffbufferevent_async at least) In this case we could add more information for issues like #709
Azat Khuzhin 3036f15a 2018-11-20T06:20:51 regress_http: fix compilation with !EVENT__HAVE_OPENSSL Fixes: 811c63f7 ("regress: test for HTTP/HTTPS with IOCP enabled")
Azat Khuzhin f8d510f6 2018-11-13T23:20:10 regress_bufferevent: add TT_IOCP_LEGACY/TT_IOCP
Azat Khuzhin 903c6ace 2018-11-13T23:30:51 t/bench_http: disable buffering (win32 do not show anything otherwise) Refs: #255
Azat Khuzhin 56f3bdef 2018-11-13T23:23:09 s/http-server: check for EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED
Azat Khuzhin 3d815cf2 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
Azat Khuzhin 811c63f7 2018-11-13T11:25:35 regress: test for HTTP/HTTPS with IOCP enabled Next tests added: - iocp/http/simple - iocp/http/https_simple
Azat Khuzhin 908e710d 2018-11-13T21:31:44 bev_async: trigger/run only deferred callbacks Otherwise callbacks will be runned even without event_loop, due to nature of IOCP. A simple example is: evhttp_connection_free(client) # freeing the client will trigger evhttp_connection_free() for the # client on the server side, and hence there will double free evhttp_free(server) Fixes: iocp/http/simple
Azat Khuzhin 2bf673a4 2018-11-13T11:47:14 bev_async: do not initialize timeouts multiple times You cannot event_assign() event multiple times, this is UB, and most likely will fail. Fixes: af9b2a7ae0be11c79a909d212b1833a9379e4ba0 ("Initialize async bufferevent timeout CBs unconditionally")
Azat Khuzhin e73875df 2018-11-11T21:51:46 bev_async: set "ok" on setfd if fd>=0 (like we do during creation) Otherwise after .setfd, .enable will not work.
Azat Khuzhin a54c0349 2018-11-11T21:35:20 bev_async: ignore ERROR_INVALID_PARAMETER on .setfd for iocp listener already calls event_iocp_port_associate_() the second call will return ERROR_INVALID_PARAMETER. Plus we already ignore it on creation, so why we should care about it here?
Azat Khuzhin 5dc88b38 2018-11-13T21:26:12 Fix conceivable UAF of the bufferevent in evhttp_connection_free() Although this is not a problem, since bufferevent uses finalizers and will free itself only from the loop (well this is not a problem if you do not play games with various event_base in different threads) it generates questions, so rewrite it in more reliable way. Fixes: #712
Azat Khuzhin 7bcf576b 2018-11-30T22:25:41 Use BEV_UPCASE() everywhere Done with coccinelle and manual line rewrap: $ cat > BEV_UPCAST.cocci @@ expression field_; expression var; @@ - EVUTIL_UPCAST(var, struct bufferevent_private, field_) + BEV_UPCAST(var) $ spatch --sp-file BEV_UPCASE.cocci --in-place bufferevent*.c > /dev/null
Azat Khuzhin b2d4fb41 2018-11-13T09:25:13 regress: add EVENT_NO_FILE_BUFFERING, to disable buffering for stdout/stderr Useful for win32
Azat Khuzhin f2da6198 2018-11-13T08:24:55 event: add some debug information into loop for event_base_free_queues_() Refs: 7c8d0152dda18ecc52d3099fea235b04ddb850d9 ("Free event queues even for recursive finalizers")
Azat Khuzhin 9a4b8ec1 2018-11-13T11:10:25 Merge branch 'sample-http-server' Some improvements for http-server sample: - getopt - persistent port via -p option - IOCP for win32 via -I - disable buffering - enable debug logging via -v/EVENT_DEBUG_LOGGING_ALL - cleanup (by signal and separate error path on errors) * sample-http-server: s/http-server: graceful cleanup s/http-server: enable debug logging if EVENT_DEBUG_LOGGING_ALL env isset s/http-server: turn off buffering (otherwise do output on win32) s/http-server: add an option to use IOCP s/http-server: add options (for persistent port) Refs: #709
Azat Khuzhin bdd71f18 2018-11-13T10:48:41 s/http-server: graceful cleanup
Azat Khuzhin 41b6b279 2018-11-13T10:26:17 s/http-server: enable debug logging if EVENT_DEBUG_LOGGING_ALL env isset
Azat Khuzhin 3c8ded5c 2018-11-08T11:19:16 s/http-server: turn off buffering (otherwise do output on win32)
Azat Khuzhin 5d3f9d4d 2018-11-08T11:13:21 s/http-server: add an option to use IOCP
Azat Khuzhin ed705ba7 2018-11-13T10:33:24 s/http-server: add options (for persistent port)
Azat Khuzhin 8c1838be 2018-11-08T00:21:08 Remove Vagrantfile (will be moved into libevent-extras) Since: - it is not a library - this file should have (if I had enough time) enough fixes in itself and should not polute libevent history - it "requires" (it more cleaner to use it in this way) script -- tools/vagrant-tests.py (indeed, from libevent-extras) - will has it's own issues/README/... https://github.com/libevent/libevent-extras
Azat Khuzhin 1fc1c7ef 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
Azat Khuzhin 9afe7a6c 2018-11-06T11:30:18 appveyor: skip travis patches (by commit subject/files)
Azat Khuzhin 54fdd6bb 2018-11-05T17:04:47 appveyor: cache build directory to reduce overall time (6x time faster) various build checks (i.e. detecting headers/macroses/functions) takes 7 minutes (from 13 minutes in total) for cmake, which is too high. By using cache we can reduce this to ~0. And set APPVEYOR_SAVE_CACHE_ON_ERROR so that cmake checks will be cached (anyway all sources will be built from scratch due to timestamp updates while extracting from sources).
Azat Khuzhin 50618935 2018-11-06T01:22:13 appveyor: disable verbosity
Azat Khuzhin 1503a9a1 2018-11-05T18:00:41 appveyor: do not run on branches that has "travis" in it's name
Azat Khuzhin 6d3a5396 2018-11-05T18:30:38 cmake: set CMP0075 to NEW (for ws2_32.lib in win32) Otherwise cmake complains: Policy CMP0075 is not set: Include file check macros honor CMAKE_REQUIRED_LIBRARIES. Run "cmake --help-policy CMP0075" for policy details. Use the cmake_policy command to set the policy and suppress this warning. CMAKE_REQUIRED_LIBRARIES is set to: ws2_32.lib For compatibility with CMake 3.11 and below this check is ignoring it.
Azat Khuzhin 65904773 2018-11-05T18:23:31 cmake: set CMP0074 to NEW (for OPENSSL_ROOT in appveyor) We have $env:OPENSSL_ROOT (env) equals to -DOPENSSL_ROOT (cmake variable) anyway. cmake complains: Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables. Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Environment variable OpenSSL_ROOT is set to: C:/OpenSSL-Win64/bin For compatibility, CMake is ignoring the variable. This warning is for project developers. Use -Wno-dev to suppress it.
Azat Khuzhin 58e853f2 2018-11-05T22:58:25 travis: use homebrew via addon (-~4min/16% from the build time)