]> granicus.if.org Git - libevent/log
libevent
3 years agoci: fix upload-artifacts for linux dist build
Azat Khuzhin [Tue, 23 Mar 2021 06:40:30 +0000 (09:40 +0300)]
ci: fix upload-artifacts for linux dist build

Fixes [1]:

    Run actions/upload-artifact@v1
    Error: Path does not exist /home/runner/work/libevent/libevent/build
    Error: Exit code 1 returned from process: file name '/home/runner/runners/2.277.1/bin/Runner.PluginHost', arguments 'action "GitHub.Runner.Plugins.Artifact.PublishArtifact, Runner.Plugins"'.

  [1]: https://github.com/libevent/libevent/runs/2172680722?check_suite_focus=true

3 years agoMerge branch 'http-fix-fd-leak'
Azat Khuzhin [Tue, 23 Mar 2021 06:10:00 +0000 (09:10 +0300)]
Merge branch 'http-fix-fd-leak'

* http-fix-fd-leak:
  http: fix fd leak on fd reset (by using bufferevent_replacefd())
  bufferevent: introduce bufferevent_replacefd() (like setfd() but also close fd)

Fixes: #1143
3 years agohttp: fix fd leak on fd reset (by using bufferevent_replacefd())
Azat Khuzhin [Tue, 23 Mar 2021 06:02:39 +0000 (09:02 +0300)]
http: fix fd leak on fd reset (by using bufferevent_replacefd())

Fixes: afa66ea4 ("http: eliminate redundant bev fd manipulating and caching [WIP]")
3 years agobufferevent: introduce bufferevent_replacefd() (like setfd() but also close fd)
Azat Khuzhin [Tue, 23 Mar 2021 06:00:24 +0000 (09:00 +0300)]
bufferevent: introduce bufferevent_replacefd() (like setfd() but also close fd)

3 years agobuild: use AC_CHECK_LIB over AC_HAVE_LIBRARY
fanquake [Tue, 23 Mar 2021 01:52:14 +0000 (09:52 +0800)]
build: use AC_CHECK_LIB over AC_HAVE_LIBRARY

AC_HAVE_LIBRARY is deprecated, see
https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Obsolete-Macros.html,
and has been prior to Autoconf 2.67, which is the minimum required by
the project. It's usage also causes warnings with newer versions of autoconf:
```bash
configure.ac:319: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:319: You should run autoupdate.
```

`AC_HAVE_LIBRARY` was introduced in #969, although it's not clear why it
was decided to revert to using an obselete macro.

3 years agofix compile error in VS2012 in evutil_gettimeofday()
MKCKR [Tue, 16 Feb 2021 05:26:44 +0000 (13:26 +0800)]
fix compile error in VS2012 in evutil_gettimeofday()

Move static variable definition before other statement, to prevent
compile error in VS2012.

Fixes: #1135
3 years agohttp: fix invalid unsigned arithmetic
ihsinme [Fri, 5 Feb 2021 15:54:30 +0000 (18:54 +0300)]
http: fix invalid unsigned arithmetic

3 years agoCheck return value of evbuffer_remove() in bufferevent_read()
lilei [Wed, 3 Feb 2021 06:19:57 +0000 (14:19 +0800)]
Check return value of evbuffer_remove() in bufferevent_read()

The conflict cast convertion between the return value of
bufferevent_read() and evbuffer_remove(), int(-1)->size_t(An undefined
maximum)

Add test case of bufferevent_read() should return 0 in case of
evbuffer_remove() returns -1

Fixes: #1132
4 years agotest/regress_http: cover reading of chunked payload by server
Azat Khuzhin [Mon, 18 Jan 2021 20:23:42 +0000 (23:23 +0300)]
test/regress_http: cover reading of chunked payload by server

This is an example with transfer-encoding by client via bufferevent for
the #1131

4 years agoevdns: add max-probe-timeout/probe-backoff-factor settings
chux0519 [Sat, 9 Jan 2021 09:19:27 +0000 (17:19 +0800)]
evdns: add max-probe-timeout/probe-backoff-factor settings

I recently found that when the network status changed when calling
bufferevent_socket_connect_hostname (e.g. switching between several
WIFIs), all DNS servers would fail, and the timeout of probe would be
very long if there were many DNS requests. I want libevent to support
manual setting of MAX_PROBE_TIMEOUT and TIMEOUT_BACKOFF_FACTOR

So move hardcoded MAX_PROBE_TIMEOUT and TIMEOUT_BACKOFF_FACTOR into
struct, and allow changing them.

4 years agodoc: remove dead link
Emil Engler [Sat, 26 Dec 2020 08:07:07 +0000 (09:07 +0100)]
doc: remove dead link

The link is dead and an archived page cannot be found in the
web.archive.org.

4 years agocmake: do not link libevent with libevent_core
Loïc Yhuel [Mon, 23 Nov 2020 16:24:36 +0000 (17:24 +0100)]
cmake: do not link libevent with libevent_core

When add_event_library macro was called without the INNER_LIBRARIES parameter, it reused the
value set by a previous call, since the INNER_LIBRARIES variable was not reset.

4 years agoDo not try to do SSL handshake if the connect() fails
Azat Khuzhin [Wed, 4 Nov 2020 21:57:39 +0000 (00:57 +0300)]
Do not try to do SSL handshake if the connect() fails

This will avoid this icky error:

    $ https-client -4 -url https://127.1
    some request failed - no idea which one though!
    error:00000005:lib(0):func(0):DH lib

And instead will report only:

    $ https-client -4 -url https://127.1
    some request failed - no idea which one though!
    socket error = Connection refused (111)

Refs: #1115

4 years agoMerge branch 'macos-brew-openssl-v2'
Azat Khuzhin [Mon, 2 Nov 2020 07:01:41 +0000 (10:01 +0300)]
Merge branch 'macos-brew-openssl-v2'

By Azat Khuzhin (2) and fanquake (1)
* macos-brew-openssl-v2:
  Add autodetection of openssl via brew into build matrix
  cmake: find openssl prefix via brew
  autotools: attempt to find OpenSSL via homebrew on macOS

Closes: #1050 (cherry picked one patch from it)
4 years agoAdd autodetection of openssl via brew into build matrix
Azat Khuzhin [Sun, 1 Nov 2020 21:39:26 +0000 (00:39 +0300)]
Add autodetection of openssl via brew into build matrix

4 years agocmake: find openssl prefix via brew
Azat Khuzhin [Sat, 31 Oct 2020 22:39:02 +0000 (01:39 +0300)]
cmake: find openssl prefix via brew

4 years agoautotools: attempt to find OpenSSL via homebrew on macOS
fanquake [Tue, 7 Jul 2020 06:58:29 +0000 (14:58 +0800)]
autotools: attempt to find OpenSSL via homebrew on macOS

When compiling for macOS, where users will likely have OpenSSL installed
via brew, rather than available on the system, use brew  --prefix to
figure out where OpenSSL is, and then augment the pkg-config path so
that libs are found.

4 years agoFix bufferevent_ssl_*flags() w/ disabled OpenSSL but enabled mbedTLS
Azat Khuzhin [Sat, 31 Oct 2020 21:59:16 +0000 (00:59 +0300)]
Fix bufferevent_ssl_*flags() w/ disabled OpenSSL but enabled mbedTLS

4 years agoMerge branch 'ssl-nagle'
Azat Khuzhin [Sat, 31 Oct 2020 20:04:55 +0000 (23:04 +0300)]
Merge branch 'ssl-nagle'

* ssl-nagle:
  Introduce new BUFFEREVENT_SSL_BATCH_WRITE flag to avoid Nagle effect in SSL
  Introduce new API for flags of the SSL bufferevent

4 years agoIntroduce new BUFFEREVENT_SSL_BATCH_WRITE flag to avoid Nagle effect in SSL
Azat Khuzhin [Sat, 31 Oct 2020 19:53:31 +0000 (22:53 +0300)]
Introduce new BUFFEREVENT_SSL_BATCH_WRITE flag to avoid Nagle effect in SSL

4 years agoIntroduce new API for flags of the SSL bufferevent
Azat Khuzhin [Sat, 31 Oct 2020 18:45:22 +0000 (21:45 +0300)]
Introduce new API for flags of the SSL bufferevent

Introduce more generic API (like for evbuffer):
- bufferevent_ssl_set_flags()
- bufferevent_ssl_clear_flags()
- bufferevent_ssl_get_flags()

And deprecate existing:
- bufferevent_openssl_get_allow_dirty_shutdown()
- bufferevent_openssl_set_allow_dirty_shutdown()
- bufferevent_mbedtls_get_allow_dirty_shutdown()
- bufferevent_mbedtls_set_allow_dirty_shutdown()

4 years agoMerge branch 'ssl-fixes-after-mbedtls'
Azat Khuzhin [Sat, 31 Oct 2020 19:50:11 +0000 (22:50 +0300)]
Merge branch 'ssl-fixes-after-mbedtls'

* ssl-fixes-after-mbedtls:
  Fix BEV_IS_SSL() macro
  Fix preprocessor condition for BEV_IS_SSL()
  Remove reduntant BEV_IS_MBEDTLS

Refs: #1028

4 years agoFix BEV_IS_SSL() macro
Azat Khuzhin [Sat, 31 Oct 2020 19:48:37 +0000 (22:48 +0300)]
Fix BEV_IS_SSL() macro

We cannot use the same trick with external declaration,
since there are copy of bufferevent_ops_ssl in each library:
- openssl
- mbedlts

However we can just compare the name of the bufferevent type for now.
(It is totally fine to use memcmp() here since it will be optimized by the compiler).

4 years agoFix preprocessor condition for BEV_IS_SSL()
Azat Khuzhin [Sat, 31 Oct 2020 19:41:16 +0000 (22:41 +0300)]
Fix preprocessor condition for BEV_IS_SSL()

4 years agoRemove reduntant BEV_IS_MBEDTLS
Azat Khuzhin [Sat, 31 Oct 2020 19:27:18 +0000 (22:27 +0300)]
Remove reduntant BEV_IS_MBEDTLS

4 years agohttp: eliminate redundant bev fd manipulating and caching [WIP]
Azat Khuzhin [Tue, 3 Sep 2019 21:56:20 +0000 (00:56 +0300)]
http: eliminate redundant bev fd manipulating and caching [WIP]

At the very beginning we reset the bufferevent fd (if bev has it), which
is not a good idea, since if user passes bufferevent with existing fd he
has some intention.

So we need to:
- use BEV_OPT_CLOSE_ON_FREE for default bufferevent_socket_new() (to
  avoid manual shutdown/closee)
- drop getsockopt(SOL_SOCKET, SO_ERROR), since bufferevent already has
  evutil_socket_finished_connecting_()
- drop supperior bufferevent_setfd(bev, -1) in
  evhttp_connection_connect_()

Closes: #795
Refs: #875

4 years agoMerge branch 'ipv6-tiny-improvements'
Azat Khuzhin [Mon, 26 Oct 2020 23:15:38 +0000 (02:15 +0300)]
Merge branch 'ipv6-tiny-improvements'

* ipv6-tiny-improvements:
  http: add EVHTTP_URI_HOST_STRIP_BRACKETS
  http-server: add -H option to change listen address
  https-client: add newline into error messages
  https-client: add -4/-6 switches

4 years agohttp: add EVHTTP_URI_HOST_STRIP_BRACKETS
Azat Khuzhin [Mon, 26 Oct 2020 22:40:34 +0000 (01:40 +0300)]
http: add EVHTTP_URI_HOST_STRIP_BRACKETS

Refs: #1115

4 years agohttp-server: add -H option to change listen address
Azat Khuzhin [Mon, 26 Oct 2020 22:22:59 +0000 (01:22 +0300)]
http-server: add -H option to change listen address

4 years agohttps-client: add newline into error messages
Azat Khuzhin [Mon, 26 Oct 2020 22:19:40 +0000 (01:19 +0300)]
https-client: add newline into error messages

4 years agohttps-client: add -4/-6 switches
Azat Khuzhin [Mon, 26 Oct 2020 22:17:44 +0000 (01:17 +0300)]
https-client: add -4/-6 switches

4 years agobecat: add timeout (client/server) and verbosity (event_enable_debug_logging())
Azat Khuzhin [Thu, 15 Oct 2020 20:23:15 +0000 (23:23 +0300)]
becat: add timeout (client/server) and verbosity (event_enable_debug_logging())

4 years agoChange log message in evutil_make_socket_nonblocking in win32
guoxiang1996 [Sat, 10 Oct 2020 19:23:14 +0000 (03:23 +0800)]
Change log message in evutil_make_socket_nonblocking in win32

Co-authored-by: guoxiang2 <guoxiang2@yy.com>
4 years agoChange prefix for man pages from "le_" to "libevent_"
Azat Khuzhin [Sun, 4 Oct 2020 19:56:30 +0000 (22:56 +0300)]
Change prefix for man pages from "le_" to "libevent_"

As pointed by @kloczek:
  "With only two characters it would be harder to guess under what kind of name are libevent lvl 3 man pages.
   Longer name with bash/fix/zsh tab competition should not be a problem :)"

Refs: #1099

4 years agoAdd prefix (le_) for man pages
Azat Khuzhin [Sun, 4 Oct 2020 16:55:52 +0000 (19:55 +0300)]
Add prefix (le_) for man pages

This will:
- avoid overlapping (since there is util.h.3 page)
- group everything under some prefix (man le_<TAB><TAB> will show everything)

Fixes: #1099
4 years agoDrop DOXYGEN_MAN_LINKS unsupported cmake flag
Azat Khuzhin [Sun, 4 Oct 2020 16:48:34 +0000 (19:48 +0300)]
Drop DOXYGEN_MAN_LINKS unsupported cmake flag

MAN_LINKS is not a variable in Doxyfile anyway.

4 years agohttp-server: add cli argument for max body size
Azat Khuzhin [Sun, 4 Oct 2020 14:44:34 +0000 (17:44 +0300)]
http-server: add cli argument for max body size

4 years agoRemove dead code from bufferevent_socket_connect
Nikita Gorskikh [Fri, 18 Sep 2020 13:34:34 +0000 (16:34 +0300)]
Remove dead code from bufferevent_socket_connect

4 years agoGenerate only real man pages with doxygen (MAN_LINKS=NO)
Azat Khuzhin [Wed, 16 Sep 2020 05:10:11 +0000 (08:10 +0300)]
Generate only real man pages with doxygen (MAN_LINKS=NO)

WIth MAN_LINKS=YES doxygen will generate ton's of man pages for each
field, function and so on, but it will not contain anything useful
except for link to another man page (header).

So to avoid man pages clashing, disable MAN_LINKS, and this will
generate man pages only for explicitly documented parts.

But even after this we have pretty non-unique man pages names:

    $ find install/ -name '*.3'
    install/share/man/man3/util.h.3
    ...

Looks like we should add prefix for each of them...
But let's see if there will be a problem.

Fixes: #1097
4 years agoRemove man pages from repo (they can be generated via doxygen)
Azat Khuzhin [Wed, 16 Sep 2020 05:25:20 +0000 (08:25 +0300)]
Remove man pages from repo (they can be generated via doxygen)

The problem with this man pages are:
- they are likely outdated
- they don't have install target
- and besides quality of man pages generated by doxygen not worse

4 years agosample: add https-client-mbedtls
okhowang(王沛文) [Wed, 16 Sep 2020 03:31:33 +0000 (11:31 +0800)]
sample: add https-client-mbedtls

4 years agotest: fix windows error when mbedtls https
okhowang(王沛文) [Tue, 15 Sep 2020 10:15:24 +0000 (18:15 +0800)]
test: fix windows error when mbedtls https

4 years agoMerge #1087 - tests for https with mbedtls
Azat Khuzhin [Mon, 14 Sep 2020 18:37:50 +0000 (21:37 +0300)]
Merge #1087 - tests for https with mbedtls

* upstream/pr/1087:
  test: add https with mbedtls
  bufferevent_openssl: fix -Wcast-function-type for SSL_pending

4 years agoAdd build w/o any SSL support (i.e. w/o openssl and mbedtls)
Azat Khuzhin [Mon, 14 Sep 2020 18:30:02 +0000 (21:30 +0300)]
Add build w/o any SSL support (i.e. w/o openssl and mbedtls)

This pure build w/o SSL has been removed in mbedtls PR - #1028

4 years agotest: add https with mbedtls
okhowang(王沛文) [Sun, 6 Sep 2020 07:33:32 +0000 (15:33 +0800)]
test: add https with mbedtls

4 years agobufferevent_openssl: fix -Wcast-function-type for SSL_pending
okhowang(王沛文) [Sat, 25 Jul 2020 09:17:46 +0000 (17:17 +0800)]
bufferevent_openssl: fix -Wcast-function-type for SSL_pending

Introduced-in: #1028

4 years agohttp: const out address param to evcon_get_peer
Leon M. George [Tue, 8 Sep 2020 13:38:16 +0000 (15:38 +0200)]
http: const out address param to evcon_get_peer

4 years agobuild: fix building under windows with thread support
Azat Khuzhin [Mon, 31 Aug 2020 22:08:16 +0000 (01:08 +0300)]
build: fix building under windows with thread support

Fixes: 972289f3 ("Detect existence of pthread_mutexattr_setprotocol()")
4 years agoFix: long -> enum evhttp_cmd_type type
Berbe [Sat, 29 Aug 2020 16:41:39 +0000 (18:41 +0200)]
Fix: long -> enum evhttp_cmd_type type

4 years agotest/regress_dns: fix -Wmaybe-uninitialized
Azat Khuzhin [Fri, 28 Aug 2020 22:15:20 +0000 (01:15 +0300)]
test/regress_dns: fix -Wmaybe-uninitialized

Was not noticed since it is reported only with optimization enabled, as
stated in gcc(1):

   The effectiveness of some warnings depends on optimizations also
   being enabled. For example -Wsuggest-final-types is more effective with
   link-time optimization and -Wmaybe-uninitialized does not warn at all
   unless optimization is enabled.

And interesting thing is that it is reported only for -O2, not for -O3,
that's why I did not catched it in both cmake env that I had:
- debug (it has -O0)
- release (it has -O3)

While autoconf has -O2.

4 years agoDetect existence of pthread_mutexattr_setprotocol()
Azat Khuzhin [Fri, 28 Aug 2020 22:15:20 +0000 (01:15 +0300)]
Detect existence of pthread_mutexattr_setprotocol()

Fixes: #1084
4 years agobuild: add doxygen to all
Azat Khuzhin [Mon, 10 Aug 2020 23:12:23 +0000 (02:12 +0300)]
build: add doxygen to all

Fixes: 7e6c5fb4 ("build: do not try install doxygen man pages if they were not requested")
Fixes: #1075
Fixes: #886
4 years agobuild: do not try install doxygen man pages if they were not requested
Azat Khuzhin [Thu, 6 Aug 2020 07:24:55 +0000 (10:24 +0300)]
build: do not try install doxygen man pages if they were not requested

Fixes: #1075
4 years agoMerge #1074
Azat Khuzhin [Thu, 6 Aug 2020 07:12:07 +0000 (10:12 +0300)]
Merge #1074

yuangongji:
  "Fix CI failures #1071
  - Install vcpkg through the source code to temporarily solve the windows CI problem.
  - Update cache version and replace setup-msys2."

* upstream/pr/1074:
  fix CI:Update cache version and replace setup-msys2
  fix CI: Install vcpkg through the source code to temporarily solve the windows CI problem

4 years agofix CI:Update cache version and replace setup-msys2
yuangongji [Wed, 5 Aug 2020 04:12:08 +0000 (12:12 +0800)]
fix CI:Update cache version and replace setup-msys2

4 years agofix CI: Install vcpkg through the source code to temporarily solve the windows CI...
yuangongji [Wed, 5 Aug 2020 02:14:53 +0000 (10:14 +0800)]
fix CI: Install vcpkg through the source code to temporarily solve the windows CI problem

4 years agoConvert from WinCrypt to Windows BCrypt
Gerry Garvey [Sat, 1 Aug 2020 15:10:48 +0000 (16:10 +0100)]
Convert from WinCrypt to Windows BCrypt

Fixes: #1069
4 years agoHandle return value from getrandom()
Gerry Garvey [Sat, 1 Aug 2020 13:05:39 +0000 (14:05 +0100)]
Handle return value from getrandom()

4 years agoRemove reduntant variables in workflows with deploy
Azat Khuzhin [Tue, 28 Jul 2020 08:03:46 +0000 (11:03 +0300)]
Remove reduntant variables in workflows with deploy

Fixes: bfbbc882 ("Change user.name/user.email to robot for deploy via github actions")
4 years agoChange user.name/user.email to robot for deploy via github actions
Azat Khuzhin [Tue, 28 Jul 2020 08:02:15 +0000 (11:02 +0300)]
Change user.name/user.email to robot for deploy via github actions

4 years agotest/dns: fix initialize_nameservers when there is ipv6 in /etc/resolv.conf
Azat Khuzhin [Mon, 27 Jul 2020 22:19:28 +0000 (01:19 +0300)]
test/dns: fix initialize_nameservers when there is ipv6 in /etc/resolv.conf

Fixes: #1060
4 years agowindows socketpair tmpfile: use random prefix
Pierce Lopez [Sun, 26 Jul 2020 01:17:21 +0000 (21:17 -0400)]
windows socketpair tmpfile: use random prefix

fixes #1058

GetTempFileNameA() takes an optional prefix, and a "unique" long value
which can optionally be zero, which causes it to automatically
increment until a not-yet-existing filename is found.

When libevent creates many AF_UNIX socketpairs on windows,
it slows down dramatically, due to always using the same blank prefix,
and GetTempFileNameA() needing to iterate through all the existing
socketpair filenames. With a present and varying prefix, it will have
much less need to iterate.

It was also possible for a race with other processes also using
blank-prefix tmpfile names to result in both trying to start using
the same name at the same time (because libevent deletes the file
and then re-creates it as a unix socket), which should now be
much less likely.

Unfortuantely, "much" is just a factor of 32k, because the prefix
is only 3 characters, and windows filesystems are case-insensitive,
so doing better would require more sophisticated windows API usage
and charset trickyness.

4 years agofix: compat mbedtls < 2.4
okhowang(王沛文) [Fri, 24 Jul 2020 09:19:14 +0000 (17:19 +0800)]
fix: compat mbedtls < 2.4

4 years agoFix bufferevent_get_{openssl,mbedtls}_error()
Azat Khuzhin [Thu, 23 Jul 2020 20:38:53 +0000 (23:38 +0300)]
Fix bufferevent_get_{openssl,mbedtls}_error()

The bufferevent_get_openssl_error() returns unsigned long, so returning
-1 on error in unclear. Let's use 0.

Fixes: #1028
4 years agoci/doxygen: install missing libmbedtls-dev
Azat Khuzhin [Wed, 22 Jul 2020 23:01:02 +0000 (02:01 +0300)]
ci/doxygen: install missing libmbedtls-dev

4 years agoci/coverage: add missing libmbedtls-dev
Azat Khuzhin [Wed, 22 Jul 2020 22:08:22 +0000 (01:08 +0300)]
ci/coverage: add missing libmbedtls-dev

4 years agole-proxy: ignore SIGPIPE
Azat Khuzhin [Wed, 22 Jul 2020 21:28:09 +0000 (00:28 +0300)]
le-proxy: ignore SIGPIPE

Fixes: #1057
4 years agotest/regress_buffer.c: fix -Wbad-function-cast (in some specific env)
Azat Khuzhin [Wed, 22 Jul 2020 21:22:45 +0000 (00:22 +0300)]
test/regress_buffer.c: fix -Wbad-function-cast (in some specific env)

Fixes: #1054
4 years agoMerge branch 'mbedtls'
Azat Khuzhin [Wed, 22 Jul 2020 21:14:34 +0000 (00:14 +0300)]
Merge branch 'mbedtls'

This patch set provides mbed TLS support.

The interface part (include/event2/bufferevent_ssl.h) LGTM, so this can
be safely merged (although there are some bits left).

Includes:
- bufferevent_mbedtls_*
- regress_mbedtls tests

Left:
- regress_http https_mbedtls support
- ChangeLog entry

* mbedtls:
  test: rename ssl/* -> openssl/*
  Join le_ssl_ops.post_init with le_ssl_ops.init
  Update LICENSE for ssl-client-mbedtls.c
  Merge ssl implementations (openssl and mbedtls)
  add mbedtls to CI
  fix build system and add test and cleanup code
  mbed TLS cmake support
  simple https client example using mbedtls
  mbedtls based SSL implementation

4 years agotest: rename ssl/* -> openssl/*
Azat Khuzhin [Wed, 22 Jul 2020 20:10:17 +0000 (23:10 +0300)]
test: rename ssl/* -> openssl/*

4 years agoJoin le_ssl_ops.post_init with le_ssl_ops.init
Azat Khuzhin [Wed, 22 Jul 2020 20:08:50 +0000 (23:08 +0300)]
Join le_ssl_ops.post_init with le_ssl_ops.init

4 years agoUpdate LICENSE for ssl-client-mbedtls.c
Azat Khuzhin [Wed, 22 Jul 2020 20:02:31 +0000 (23:02 +0300)]
Update LICENSE for ssl-client-mbedtls.c

4 years agoMerge ssl implementations (openssl and mbedtls)
okhowang(王沛文) [Tue, 7 Jul 2020 09:26:46 +0000 (17:26 +0800)]
Merge ssl implementations (openssl and mbedtls)

This patch splits common part out to avoid copy-paste from the
- bufferevent_openssl.c
- bufferevent_mbedtls.c

It uses VFS/bufferevent-like approach, i.e. structure of callbacks.

4 years agoadd mbedtls to CI
okhowang(王沛文) [Wed, 27 May 2020 07:29:42 +0000 (15:29 +0800)]
add mbedtls to CI

4 years agofix build system and add test and cleanup code
okhowang(王沛文) [Thu, 28 May 2020 09:14:46 +0000 (17:14 +0800)]
fix build system and add test and cleanup code

4 years agombed TLS cmake support
Jesse Fang [Tue, 14 Jan 2020 04:18:27 +0000 (12:18 +0800)]
mbed TLS cmake support

FindMbedTLS.cmake is come from https://github.com/AVSystem/avs_commons/blob/master/cmake/FindMbedTLS.cmake, which is licensed under Apache 2.0

alternatives:
  https://github.com/curl/curl/blob/master/CMake/FindMbedTLS.cmake   without variable MBEDTLS_ROOT_DIR
  https://github.com/libgit2/libgit2/blob/master/cmake/Modules/FindmbedTLS.cmake  GPLv2 with a special Linking Exception

4 years agosimple https client example using mbedtls
Jesse Fang [Mon, 13 Jan 2020 15:08:26 +0000 (23:08 +0800)]
simple https client example using mbedtls

Based on mbedtls's source code programs/ssl/ssl_client1.c

4 years agombedtls based SSL implementation
Jesse Fang [Mon, 13 Jan 2020 15:04:29 +0000 (23:04 +0800)]
mbedtls based SSL implementation

prototype is libevent-2.1.11-stable libevent_openssl.c

4 years agodoc: fix typo in thread.h
fanquake [Mon, 20 Jul 2020 13:59:10 +0000 (21:59 +0800)]
doc: fix typo in thread.h

s/evthred_use_pthreads_with_flags/evthread_use_pthreads_with_flags/

4 years agoMerge #1048 -- append warning flags only if they are available (autotools)
Azat Khuzhin [Fri, 10 Jul 2020 19:18:59 +0000 (22:18 +0300)]
Merge #1048 -- append warning flags only if they are available (autotools)

* upstream/pr/1048:
  build: remove -Wstrict-aliasing as strict-aliasing is disabled
  build: move automake options into AM_INIT_AUTOMAKE call
  build: remove commented code from configure.ac
  build: use feature detection when adding compile flags
  build: add ax_check_compile_flag macro

4 years agobuild: remove -Wstrict-aliasing as strict-aliasing is disabled
fanquake [Tue, 7 Jul 2020 05:58:47 +0000 (13:58 +0800)]
build: remove -Wstrict-aliasing as strict-aliasing is disabled

Note that -Wstrict-aliasing is also include in -Wall.

4 years agobuild: move automake options into AM_INIT_AUTOMAKE call
fanquake [Fri, 3 Jul 2020 08:02:09 +0000 (16:02 +0800)]
build: move automake options into AM_INIT_AUTOMAKE call

4 years agobuild: remove commented code from configure.ac
fanquake [Fri, 3 Jul 2020 07:47:10 +0000 (15:47 +0800)]
build: remove commented code from configure.ac

4 years agobuild: use feature detection when adding compile flags
fanquake [Fri, 26 Jun 2020 06:33:43 +0000 (14:33 +0800)]
build: use feature detection when adding compile flags

Rather than trying to detect (potentially very old) GCC versions, just
test whether the flag works with the compiler, and add it to CLFAGS if
so.

-Werror is used to convert unknown flag warnings into errors, and
prevent their addition to CLFAGS.

4 years agobuild: add ax_check_compile_flag macro
fanquake [Fri, 26 Jun 2020 06:04:26 +0000 (14:04 +0800)]
build: add ax_check_compile_flag macro

4 years agoci/linux: create dist artifact only if dist archive was built
Azat Khuzhin [Sun, 5 Jul 2020 10:55:53 +0000 (13:55 +0300)]
ci/linux: create dist artifact only if dist archive was built

Fixes: 512c88ce ("ci/linux: add dist check")
4 years agoMerge branch 'fix-signal-leak'
Azat Khuzhin [Sun, 5 Jul 2020 10:16:52 +0000 (13:16 +0300)]
Merge branch 'fix-signal-leak'

Fixes main/fork under ASAN (LSAN if to be precise)

* fix-signal-leak:
  select: requires reinit (otherwise it leaks signal handlers)
  poll: requires reinit (otherwise it leaks signal handlers)

4 years agoselect: requires reinit (otherwise it leaks signal handlers)
Azat Khuzhin [Sun, 5 Jul 2020 10:16:03 +0000 (13:16 +0300)]
select: requires reinit (otherwise it leaks signal handlers)

Fixes: main/fork under SELECT with ASAN
4 years agopoll: requires reinit (otherwise it leaks signal handlers)
Azat Khuzhin [Sun, 5 Jul 2020 10:14:36 +0000 (13:14 +0300)]
poll: requires reinit (otherwise it leaks signal handlers)

Fixes: main/fork under POLL with ASAN
4 years agotest: fix leak in dns/getaddrinfo_cancel_stress
Azat Khuzhin [Sun, 5 Jul 2020 08:59:32 +0000 (11:59 +0300)]
test: fix leak in dns/getaddrinfo_cancel_stress

Some requests may get response (evutil_addrinfo) from gaic_server_cb,
in case of cancel_event (10000ms) will not be fast enough.

4 years agotest: fix UB in evbuffer/empty_reference_prepend_buffer
Azat Khuzhin [Sun, 5 Jul 2020 08:45:56 +0000 (11:45 +0300)]
test: fix UB in evbuffer/empty_reference_prepend_buffer

UBSAN reports:
  test/regress_buffer.c:2360:2: runtime error: null pointer passed as argument 1, which is declared to never be null
  /usr/include/string.h:140:33: note: nonnull attribute specified here

4 years agoci: set build type to debug with sanitizers
Azat Khuzhin [Sun, 5 Jul 2020 08:21:04 +0000 (11:21 +0300)]
ci: set build type to debug with sanitizers

4 years agotest: really disable bufferevent_pair_release_lock under ASAN (and fix gcc)
Azat Khuzhin [Sun, 5 Jul 2020 08:14:18 +0000 (11:14 +0300)]
test: really disable bufferevent_pair_release_lock under ASAN (and fix gcc)

4 years agotest-closed: fix leak
Azat Khuzhin [Sun, 5 Jul 2020 08:08:05 +0000 (11:08 +0300)]
test-closed: fix leak

4 years agobuild: do not disable deprecation warnings on macOS
Pierce Lopez [Sat, 4 Jul 2020 19:55:22 +0000 (15:55 -0400)]
build: do not disable deprecation warnings on macOS

this was for using openssl-0.9.8 included in macOS 10.7 - 10.12,
but it is long since time you really should not use that openssl

4 years agoMerge #1046 -- build: misc configure changes
Azat Khuzhin [Fri, 3 Jul 2020 06:27:20 +0000 (09:27 +0300)]
Merge #1046 -- build: misc configure changes

* upstream/pr/1046:
  build: consolidate darwin compile flag additions in configure
  build: consistently use dnl for comments in configure.ac

4 years agoAdd abi-check report into artifacts
Azat Khuzhin [Sun, 28 Jun 2020 14:10:03 +0000 (17:10 +0300)]
Add abi-check report into artifacts

4 years agobuild: consolidate darwin compile flag additions in configure
fanquake [Sun, 28 Jun 2020 10:40:26 +0000 (18:40 +0800)]
build: consolidate darwin compile flag additions in configure

This is mostly move-only, apart from some changes to comments.

4 years agobuild: consistently use dnl for comments in configure.ac
fanquake [Sun, 28 Jun 2020 10:30:54 +0000 (18:30 +0800)]
build: consistently use dnl for comments in configure.ac

4 years agotest: add getaddrinfo(AI_ADDRCONFIG) test (off by default)
Azat Khuzhin [Fri, 26 Jun 2020 07:35:44 +0000 (10:35 +0300)]
test: add getaddrinfo(AI_ADDRCONFIG) test (off by default)