4593 Commits

Author SHA1 Message Date
Azat Khuzhin
048907a501 github/workflows/macos.yml: fix test step name 2021-09-19 16:00:35 +03:00
Azat Khuzhin
357dca4f70 Merge branch 'skip-tests' -- fix/skip some tests to avoid complete check failures
* skip-tests:
  test: add --retries-delay (and set to 1 second by default)
  test: add --retries argument
  Add -Wno-void-pointer-to-enum-cast (we use this hack in tests)
  test/regress_http: mark data_length_constraints as retriable
  github/workflows/mingw: use ctest --output-on-failure
  test/dns: mark TCP tests as retriable
  test/regress: retry some signal rlated tests in darwin
  test/regress_util: mark monotonic_prc as retriable
  test/regress_http: fix unix_socket test
  test/regress_http: disable max_connections/data_length_constraints under windows
  Add EV_WINDOWS macro
2021-09-19 15:59:57 +03:00
Azat Khuzhin
90846c30ff test: add --retries-delay (and set to 1 second by default)
In attemp to address failures of dns/tcp_* tests under windows [1].

  [1]: https://github.com/azat/libevent/runs/3644218468?check_suite_focus=true
2021-09-19 13:49:18 +03:00
Azat Khuzhin
d7d6af7578 test: add --retries argument 2021-09-19 13:47:32 +03:00
Azat Khuzhin
7179ceddf0 Add -Wno-void-pointer-to-enum-cast (we use this hack in tests)
Refs: https://reviews.llvm.org/D75758
2021-09-19 13:47:32 +03:00
Azat Khuzhin
29492364a2 test/regress_http: mark data_length_constraints as retriable
CI: https://github.com/libevent/libevent/runs/3643914024?check_suite_focus=true
2021-09-19 12:56:24 +03:00
Azat Khuzhin
12e6d6ebaf github/workflows/mingw: use ctest --output-on-failure
Otherwise it is hard to understand the problem [1].

  [1]: https://github.com/azat/libevent/runs/3643912284
2021-09-19 12:33:59 +03:00
Azat Khuzhin
7855900c01 test/dns: mark TCP tests as retriable
CI: https://github.com/azat/libevent/runs/3643912296 # tcp_resolve_many_clients
CI: https://github.com/azat/libevent/runs/3643912192 # tcp_timeout
CI: https://github.com/azat/libevent/runs/3643912336 # tcp_resolve
CI: https://github.com/azat/libevent/runs/3643912174 # tcp_resolve_pipeline
2021-09-19 12:29:02 +03:00
Azat Khuzhin
6ad6afb646 test/regress: retry some signal rlated tests in darwin
CI: https://github.com/azat/libevent/runs/3643912290 # simplestsignal
CI: https://github.com/azat/libevent/runs/3643912296 # simplesignal
CI: https://github.com/azat/libevent/runs/3643912228 # multiplesignal
2021-09-19 12:26:14 +03:00
Azat Khuzhin
58606a62e2 test/regress_util: mark monotonic_prc as retriable
CI: https://github.com/azat/libevent/runs/3643966877
2021-09-19 12:21:39 +03:00
Azat Khuzhin
de53da2e3c test/regress_http: fix unix_socket test 2021-09-19 11:13:30 +03:00
Azat Khuzhin
95eadf0426 test/regress_http: disable max_connections/data_length_constraints under windows
CI: https://github.com/libevent/libevent/runs/3643554394
2021-09-19 10:56:52 +03:00
Azat Khuzhin
a35d2d01ff Add EV_WINDOWS macro 2021-09-19 10:54:08 +03:00
Azat Khuzhin
39dcd52b94 ci: split build and test into separate jobs 2021-09-19 09:21:43 +03:00
Azat Khuzhin
f1e9e4dad3 test: cleanup stalled socket after running http/unix_sock
Otherwise it breaks upload-artifacts:

    Run actions/upload-artifact@v1
    Uploading artifact 'ubuntu-18.04-cmake-NONE-build' from '/home/runner/work/libevent/libevent/build' for run #346
    Uploading 1095 files
    File error 'No such device or address' when uploading file '/home/runner/work/libevent/libevent/build/foo'.
    ...
    Error: No such device or address
    Error: Exit code 1 returned from process: file name '/home/runner/runners/2.282.1/bin/Runner.PluginHost', arguments 'action "GitHub.Runner.Plugins.Artifact.PublishArtifact, Runner.Plugins"'.
2021-09-19 01:47:42 +03:00
Azat Khuzhin
f89e86123c test: check return value of write()/send() in bufferevent_read_failed
This will also suppress:

    ../test/regress_bufferevent.c: In function ‘test_bufferevent_read_failed’: 1102
    ../test/regress_bufferevent.c:1395:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] 1103
      write(data->pair[0], buf, strlen(buf));
2021-09-19 01:24:20 +03:00
Azat Khuzhin
04fcd7c6df test: mark util/monotonic_prc_fallback as retriable
Refs: #1193
2021-09-19 00:57:31 +03:00
Azat Khuzhin
41b5ab0f49 bufferevent_ssl: check return value of the evbuffer_drain()
Refs: #1163
2021-09-19 00:39:54 +03:00
Azat Khuzhin
b926af2625 Merge remote-tracking branch 'upstream/pr/1203'
@ploxiln:

  "It seems like a bit of refactoring might be able to clean this code
up a bit, but it's a bit tricky because of the varied tricky usage of
chain structs, so this initial version has minimal changes ... "

* upstream/pr/1203:
  buffer: do not round up allocation for reference-type chain objects
2021-09-19 00:27:53 +03:00
Azat Khuzhin
74af13d5eb Merge !1204 -- tests: fix macOS CI runs
* upstream/pr/1204:
  test: http_unix_socket_test: fix url could be freed uninitialized
  test: regress_http: skip unix socket parsing tests in windows
  test: fix regress_http evhttp_bind_unixsocket() on macOS
  ci: fix macOS mbedtls version/search
2021-09-19 00:23:10 +03:00
Pierce Lopez
5303feff99 test: http_unix_socket_test: fix url could be freed uninitialized
> regress_http.c:2279:2: warning: variable 'uri' is used uninitialized
>     whenever 'if' condition is true
2021-09-17 10:33:55 -04:00
Pierce Lopez
4f73bf3a46 test: regress_http: skip unix socket parsing tests in windows
windows doesn't do unix sockets
2021-09-17 10:33:55 -04:00
Pierce Lopez
58d4e50d3c test: fix regress_http evhttp_bind_unixsocket() on macOS
needs to use evutil socket helper for SOCK_NONBLOCK / SOCK_CLOEXEC
2021-09-17 10:33:55 -04:00
Pierce Lopez
bceab045ea ci: fix macOS mbedtls version/search
mbedtls just updated to version 3.0, install mbedtls@2 variant,
which needs more help being located since it's no longer the
default and no longer linked into the typical /usr/local dirs

also gitignore mbedtls sample program binaries
2021-09-17 10:33:37 -04:00
Pierce Lopez
fd0ce993e9 buffer: do not round up allocation for reference-type chain objects
Skip rounding up memory allocations for:
  * evbuffer_add_reference()
  * evbuffer_add_buffer_reference()
  * evbuffer_add_file_segment()

These chain objects only store small structs with references to
other things, and these small structs do not themselves grow, so
bumping up the allocation to MIN_BUFFER_SIZE (512 bytes) is wasteful.
2021-09-16 23:21:26 -04:00
Pierce Lopez
fabbf3b310 test: skip dns_initialize_nameservers if missing /etc/resolv.conf
some build systems run tests in minimal containers with no resolv.conf,
and the primary thing this test does is load the default /etc/resolv.conf
2021-09-14 01:19:36 -04:00
Yong Wu
68675d5f67
doc: adjust flags notice on event_base_loop() 2021-09-12 18:03:03 +08:00
Yong Wu
990bcfc28e ev_io_timeout consistency 2021-09-12 00:39:46 +03:00
Yong Wu
7459407701
modify typo - timeeouts 2021-09-05 22:42:04 +08:00
Azat Khuzhin
2b92b830a7 http: fix building under windows (guard with _WIN32 for unixsocket free)
Reported-by: @kaend
2021-08-12 01:40:46 +03:00
Azat Khuzhin
86292628e3 test: fix checking test args for http_parse_uri_test 2021-08-10 23:22:10 +03:00
Sean Young
f446229b22 http: support unix domain sockets
There are no standard for encoding a unix socket in an url. nginx uses:

    http://unix:/path/to/unix/socket:/httppath

The second colon is needed to delimit where the unix path ends and where
the rest of the url continues.

Signed-off-by: Sean Young <sean@mess.org>
2021-08-10 23:22:10 +03:00
Azat Khuzhin
6f139b8711 buffer: fix CreateFileMapping() leak from evbuffer_add_file()
evbuffer_file_segment_materialize() is called twice from
evbuffer_add_file(), and so win32 mapping will leak.

Fixes: #1186
2021-08-01 12:05:43 +03:00
moonlightsh
c29f1dbe11 fix evthread_use_pthreads_with_flags dead lock when first return 2021-07-16 10:21:06 +08:00
fanquake
c5642697e7
build: fail with a useful error message if pkg-config isn't available 2021-07-13 15:08:44 +08:00
Tobias Heider
5c0e75c34e Properly initialize sockaddr length on systems with sin_len. 2021-07-12 13:52:59 +02:00
Azat Khuzhin
6d800fd6db Merge remote-tracking branch 'upstream/pr/1171'
* upstream/pr/1171:
  ci: install pkg-config in mingw-w64 CI
  build: test ac_cv_header_sys_time_h once, reformat timer* macro checks
  build: remove call to AC_C_CONST()
  build: replace ntp_pkg_config macro with a call to PKG_PROG_PKG_CONFIG()
  build: remove NTP_PKG_CONFIG call from libevent_mbedtls.m4
  build: stop using the deprecated form of AC_OUTPUT()
  build: quote args in AC_ARG_ENABLE & AS_HELP_STRING
  build: remove call to AC_HEADER_TIME
  build: call AC_PREREQ() first & quote argument
  build: remove call to AC_PREFIX_DEFAULT
  build: remove call to AC_PROG_GCC_TRADITIONAL
2021-07-10 00:12:21 +03:00
fanquake
196a36afc8
ci: install pkg-config in mingw-w64 CI 2021-07-09 12:58:38 +08:00
fanquake
7ab3a06ada
build: test ac_cv_header_sys_time_h once, reformat timer* macro checks 2021-07-09 12:34:11 +08:00
fanquake
041d6f0992
build: remove call to AC_C_CONST()
> This macro is obsolescent, as current C compilers support const.
> New programs need not use this macro.

See: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.67/autoconf.html#index-AC_005fC_005fCONST-877.
2021-07-09 12:34:11 +08:00
fanquake
12996ba9bf
build: replace ntp_pkg_config macro with a call to PKG_PROG_PKG_CONFIG()
Note that 0.15.0 is quite an old version to be testing for, however I've left
this as-is for now.
2021-07-09 12:34:11 +08:00
fanquake
4ed3709637
build: remove NTP_PKG_CONFIG call from libevent_mbedtls.m4
I'm guessing this was just copied from libevent_openssl.m4, however there aren't
actually any pkg-config calls / macros used here.
2021-07-09 12:34:10 +08:00
fanquake
7708f6ce11
build: stop using the deprecated form of AC_OUTPUT()
> The use of AC_OUTPUT with arguments is deprecated.

See: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.67/autoconf.html#AC_005fOUTPUT.
2021-07-09 12:34:10 +08:00
fanquake
5f11857fd7
build: quote args in AC_ARG_ENABLE & AS_HELP_STRING
Previously, some were, some weren't. Consolidate on quoting.
2021-07-09 12:34:10 +08:00
fanquake
67f808ece8
build: remove call to AC_HEADER_TIME
Besides the fact that the *_TIME_WITH_SYS_TIME define doesn't seem to be
used anywhere in the libevent source, this macro is also obselescent.

> This macro is obsolescent, as current systems can include both files when they exist.
> New programs need not use this macro.

See:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.67/autoconf.html#index-AC_005fHEADER_005fTIME-640.
2021-07-09 12:34:10 +08:00
fanquake
eb59d84da2
build: call AC_PREREQ() first & quote argument
> This macro may be used before AC_INIT.

Calling this first means establishing that the required version of
autoconf is actually available, before bothering with AC_INIT().

See:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.67/autoconf.html#Versioning.
2021-07-09 12:34:10 +08:00
fanquake
dfae9557fc
build: remove call to AC_PREFIX_DEFAULT
> By default, configure sets the prefix for files it installs to /usr/local.

A call to AC_PREFIX_DEFAULT, just to set the value the same as the
default, would seem unnecessary. Note that the "initialize prefix"
comment dates back to aa6567fe6475d3230c7c745a7ca208735af0c331, prior to
when an autoconf macro was actually being used.

See:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.67/autoconf.html#Default-Prefix.
2021-07-09 12:34:10 +08:00
fanquake
710ccb7e7c
build: remove call to AC_PROG_GCC_TRADITIONAL
libevent requires Autoconf 2.67+, and from atleast this version
onwards, if not earlier, this macro is obsolescent.

> This macro is obsolescent, since current versions of the GNU
> C compiler fix the header files automatically when installed.

See:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.67/autoconf.html#AC_005fPROG_005fGCC_005fTRADITIONAL.
2021-07-09 12:34:09 +08:00
Azat Khuzhin
3d48c7563c Merge #1176 - make evthread_use_pthreads() a MT-Safe function
* upstream/pr/1176:
  remove emty line for code formating
  make evthread_use_pthreads a MT-Safe function
2021-06-27 18:37:20 +03:00
moonlightsh
bb669d934a remove emty line for code formating 2021-06-25 08:33:30 +08:00