]> granicus.if.org Git - libevent/log
libevent
4 years agoautoconf: fix getaddrinfo checking errors on mingw
yuangongji [Sat, 14 Mar 2020 03:13:38 +0000 (11:13 +0800)]
autoconf: fix getaddrinfo checking errors on mingw

`AC_CHECK_FUNCS` can not properly check `getaddrinfo` because this
function requires some special headers on mingw.
Using `AC_CHECK_DECL` can effectively solve this issue.

Same for
- getnameinfo
- getprotobynumber
- getservbyname
- inet_ntop
- inet_pton

4 years agoAdd EVENT_BASE_FLAG_EPOLL_DISALLOW_TIMERFD flag (fixes: #958)
Azat Khuzhin [Sun, 1 Mar 2020 13:01:12 +0000 (16:01 +0300)]
Add EVENT_BASE_FLAG_EPOLL_DISALLOW_TIMERFD flag (fixes: #958)

By default we are using CLOCK_MONOTONIC_COARSE, but if
EVENT_BASE_FLAG_PRECISE_TIMER isset, then CLOCK_MONOTONIC will be used,
however this will also enable timerfd, while this is not always what
someone wants, hence add a flag to control this (by default the old
behavior is preserved, set new flag to change it).

4 years agotest-time: do not use deprecated API
Azat Khuzhin [Sun, 1 Mar 2020 12:47:40 +0000 (15:47 +0300)]
test-time: do not use deprecated API

- event_init() -> event_base_new()
- event_set() -> event_new()
- check return value of event_base_dispatch()
- use EXIT_SUCCESS/EXIT_FAILURE

4 years agotest-time: enable debug mode if EVENT_DEBUG_LOGGING_ALL env set
Azat Khuzhin [Sun, 1 Mar 2020 11:54:36 +0000 (14:54 +0300)]
test-time: enable debug mode if EVENT_DEBUG_LOGGING_ALL env set

4 years agoFix typo in thread.h (s/event/evthread)
Azat Khuzhin [Sun, 1 Mar 2020 10:52:32 +0000 (13:52 +0300)]
Fix typo in thread.h (s/event/evthread)

4 years agoincrease segment refcnt only if evbuffer_add_file_segment() succeeds
yuangongji [Sat, 29 Feb 2020 09:47:47 +0000 (17:47 +0800)]
increase segment refcnt only if evbuffer_add_file_segment() succeeds

4 years agoevdns: fix a crash when evdns_base with waiting requests is freed
ayuseleznev [Thu, 27 Feb 2020 13:59:45 +0000 (16:59 +0300)]
evdns: fix a crash when evdns_base with waiting requests is freed

Fix undefined behaviour and application crash that might take
place in some rare cases after calling evdns_base_free when
there are requests in the waiting queue.

Current cleanup procedure in evdns_base_free_and_unlock
function includes 2 steps:
1. Finish all inflight requests.
2. Finish all waiting requests.
During the first step we iterate over each list in req_heads
structure and finish all requests in these lists. With current
logic finishing an inflight request (function request_finished)
removes it from the inflight requests container and forces
a wating connection to be sent (by calling
evdns_requests_pump_waiting_queue). When these new requests are
sent it is possible that they will be inserted to the list in
req_heads that we've already cleaned.
So in some cases container of the inflight requests is not empty
after this procedure and some requests are not finished and
deleted. When timeouts for these requests expire
evdns_request_timeout_callback is called but corresponding
evdns_base has been already deleted which causes undefined
behaviour and possible applicaton crash.

It is interesting to note that in old versions of libevent such
situation was not possible. This bug was introduced by the commit
14f84bbdc77d90b1d936076661443cdbf516c593. Before this commit
nameservers were deleted before finishing the requests. Therefore
it was not possible that requests from the waiting queue be sent
while we finish the inflight requests.

4 years agoevent_base_once: fix potential null pointer threat
chenguolong [Tue, 4 Feb 2020 08:05:02 +0000 (16:05 +0800)]
event_base_once: fix potential null pointer threat

supposing if base is null, EVBASE_ACQUIRE_LOCK and EVBASE_RELEASE_LOCK
would get a coredump, so we add a guard for protection.

Signed-off-by: chenguolong <cgl.chenguolong@huawei.com>
4 years agotest-ratelim: add missing free
yuangongji [Tue, 11 Feb 2020 06:33:15 +0000 (14:33 +0800)]
test-ratelim: add missing free

5 years agomisspelling of output in bufferevent_struct.h
yangyongsheng [Tue, 28 Jan 2020 06:31:39 +0000 (14:31 +0800)]
misspelling of output in bufferevent_struct.h

5 years agoMerge branch 'github-actions-v2' (#951)
Azat Khuzhin [Sun, 26 Jan 2020 22:56:58 +0000 (01:56 +0300)]
Merge branch 'github-actions-v2' (#951)

* github-actions-v2:
  travis: disable doxygen and coveralls, in favor of github actions
  github actions: test and coverage
  github actions: doxygen
  Ignore truthy in yamllint (for github-actions)
  test: mark common_timeout as retriable
  cmake: set rpath for libraries on linux
  test-export: compatible with all versions of visual studio
  coverage: 'lcov --remove' need full path

5 years agotravis: disable doxygen and coveralls, in favor of github actions
Azat Khuzhin [Sun, 26 Jan 2020 22:53:27 +0000 (01:53 +0300)]
travis: disable doxygen and coveralls, in favor of github actions

5 years agogithub actions: test and coverage
yuangongji [Tue, 21 Jan 2020 11:51:48 +0000 (19:51 +0800)]
github actions: test and coverage

5 years agogithub actions: doxygen
yuangongji [Tue, 21 Jan 2020 02:14:11 +0000 (10:14 +0800)]
github actions: doxygen

5 years agoIgnore truthy in yamllint (for github-actions)
Azat Khuzhin [Sun, 26 Jan 2020 18:30:15 +0000 (21:30 +0300)]
Ignore truthy in yamllint (for github-actions)

5 years agotest: mark common_timeout as retriable
Azat Khuzhin [Thu, 23 Jan 2020 18:34:18 +0000 (21:34 +0300)]
test: mark common_timeout as retriable

Refs: https://github.com/libevent/libevent/pull/951#issuecomment-576711224

5 years agocmake: set rpath for libraries on linux
yuangongji [Mon, 20 Jan 2020 13:17:27 +0000 (21:17 +0800)]
cmake: set rpath for libraries on linux

5 years agotest-export: compatible with all versions of visual studio
yuangongji [Mon, 20 Jan 2020 13:15:26 +0000 (21:15 +0800)]
test-export: compatible with all versions of visual studio

5 years agocoverage: 'lcov --remove' need full path
yuangongji [Tue, 14 Jan 2020 07:54:14 +0000 (15:54 +0800)]
coverage: 'lcov --remove' need full path

5 years agoDo not use shared global structures on CYGWIN
Azat Khuzhin [Tue, 21 Jan 2020 17:10:15 +0000 (20:10 +0300)]
Do not use shared global structures on CYGWIN

Fixes: #950
5 years agoAdd vcpkg installation instructions
JackBoosY [Wed, 22 Jan 2020 06:02:34 +0000 (22:02 -0800)]
Add vcpkg installation instructions

5 years agotest: move thread into realtime class even on EVENT__DISABLE_THREAD_SUPPORT
Azat Khuzhin [Tue, 14 Jan 2020 18:45:01 +0000 (21:45 +0300)]
test: move thread into realtime class even on EVENT__DISABLE_THREAD_SUPPORT

5 years agotest: fix compilation without thread support (EVENT__DISABLE_THREAD_SUPPORT=ON)
Azat Khuzhin [Tue, 14 Jan 2020 07:20:12 +0000 (10:20 +0300)]
test: fix compilation without thread support (EVENT__DISABLE_THREAD_SUPPORT=ON)

5 years agotravis-ci: do not allow failures under osx
Azat Khuzhin [Mon, 13 Jan 2020 23:36:54 +0000 (02:36 +0300)]
travis-ci: do not allow failures under osx

5 years agotest: fix bufferevent/bufferevent_connect_fail_eventcb* under osx/freebsd
Azat Khuzhin [Mon, 13 Jan 2020 23:14:16 +0000 (02:14 +0300)]
test: fix bufferevent/bufferevent_connect_fail_eventcb* under osx/freebsd

For OSX the socket should be closed, otherwise the "connection refused"
will not be triggered.

And freebsd can return error from the connect().

5 years agotest: fix dst thread in move_pthread_to_realtime_scheduling_class (osx)
Azat Khuzhin [Mon, 13 Jan 2020 21:38:06 +0000 (00:38 +0300)]
test: fix dst thread in move_pthread_to_realtime_scheduling_class (osx)

Fixes the following tests on osx:
- del_wait
- no_events

Refs: #940

5 years agotest: fix compilation under win32 (rearrange thread_setup() code)
Azat Khuzhin [Mon, 13 Jan 2020 21:27:21 +0000 (00:27 +0300)]
test: fix compilation under win32 (rearrange thread_setup() code)

5 years agotest: use THREAD_* wrappers over pthread* in del_notify
Azat Khuzhin [Mon, 13 Jan 2020 21:41:48 +0000 (00:41 +0300)]
test: use THREAD_* wrappers over pthread* in del_notify

5 years agoMerge branch 'osx-clock'
Azat Khuzhin [Mon, 13 Jan 2020 20:36:40 +0000 (23:36 +0300)]
Merge branch 'osx-clock'

Moves the thread into real-time scheduling class, as recommended in [1], it
fixes the separate test provided by @ygj6 [2] everywhere (github actions,
travis-ci, appveyor) under osx.

  [1]: https://developer.apple.com/library/archive/technotes/tn2169/_index.html
  [2]: https://github.com/azat-archive/osx-timers/commit/dde1a6e4d04506d0e0fb193ebb9f49ae25873be6

Although even after this changes the following time-related tests failed
on travis-ci:
- no_events
- del_wait

But anyway I guess #940 can be closed, since this fixes the issue in common.

* osx-clock:
  test: Use THREAD_* wrappers in del_notify/del_wait
  test: move threads created with THREAD_START() to realtime scheduling class too
  test: put thread into real time scheduling class on osx for better latencies

Closes: #940
5 years agotest: Use THREAD_* wrappers in del_notify/del_wait
Azat Khuzhin [Mon, 13 Jan 2020 19:24:54 +0000 (22:24 +0300)]
test: Use THREAD_* wrappers in del_notify/del_wait

5 years agotest: move threads created with THREAD_START() to realtime scheduling class too
Azat Khuzhin [Mon, 13 Jan 2020 19:24:54 +0000 (22:24 +0300)]
test: move threads created with THREAD_START() to realtime scheduling class too

5 years agotest: put thread into real time scheduling class on osx for better latencies
Azat Khuzhin [Sun, 12 Jan 2020 21:33:39 +0000 (00:33 +0300)]
test: put thread into real time scheduling class on osx for better latencies

5 years agoMerge branch 'ci-improvements'
Azat Khuzhin [Mon, 13 Jan 2020 19:27:32 +0000 (22:27 +0300)]
Merge branch 'ci-improvements'

* ci-improvements:
  travis-ci: measure build/tests time
  travis-ci: drop travis_wait (does not work with sub processes)
  cmake: do not print used method (EVENT_SHOW_METHOD) while running tests
  cmake: run regress test quietly like autotools (makes CI logs cleaner)

5 years agotravis-ci: measure build/tests time
Azat Khuzhin [Mon, 13 Jan 2020 19:24:54 +0000 (22:24 +0300)]
travis-ci: measure build/tests time

5 years agotravis-ci: drop travis_wait (does not work with sub processes)
Azat Khuzhin [Mon, 13 Jan 2020 19:24:54 +0000 (22:24 +0300)]
travis-ci: drop travis_wait (does not work with sub processes)

Refs: https://github.com/travis-ci/travis-ci/issues/8526

5 years agocmake: do not print used method (EVENT_SHOW_METHOD) while running tests
Azat Khuzhin [Mon, 13 Jan 2020 19:24:54 +0000 (22:24 +0300)]
cmake: do not print used method (EVENT_SHOW_METHOD) while running tests

autotools don't, plus this will make CI logs cleaner

5 years agocmake: run regress test quietly like autotools (makes CI logs cleaner)
Azat Khuzhin [Mon, 13 Jan 2020 19:24:54 +0000 (22:24 +0300)]
cmake: run regress test quietly like autotools (makes CI logs cleaner)

5 years agoAdd callback support for error pages
nntrab [Tue, 9 Feb 2016 18:01:00 +0000 (18:01 +0000)]
Add callback support for error pages

The existing error pages are very basic and don't allow for
multi-lingual support or for conformity with other pages in a web site.
The aim of the callback functionality is to allow custom error pages to
be supported for calls to evhttp_send_error() by both calling
applications and Libevent itself.

A backward-incompatible change has been made to the title of error pages
sent by evhttp_send_error(). The original version of the function used
the reason argument as part of the title. That might have unforeseen
side-effects if it contains HTML tags. Therefore the title has been
changed to always use the standard status text.

An example of the error callback can be found in this
[version](https://github.com/libevent/libevent/files/123607/http-server.zip)
of the 'http-server' sample. It will output error pages with very bright
backgrounds, the error code using a very large font size and the reason.

Closes: #323 (cherr-picked from PR)
5 years agoMerge branch 'http-connect'
Azat Khuzhin [Sun, 12 Jan 2020 12:34:51 +0000 (15:34 +0300)]
Merge branch 'http-connect'

After this patchset http-connect works with pproxy [1]:

    $ pproxy -l http://:8000/ -vvv &
    $ http-connect //127.1:8000 http://kernel.org:80/

  [1]: https://pypi.org/project/pproxy/

* http-connect:
  http-connect: do not check connection on GET cb
  http-connect: set Host header (for CONNECT and GET) (like curl)
  http-connect: cleanup and helpers
  http: do not close connection for CONNECT
  http: do not assume body for CONNECT

Fixes: #946
5 years agohttp-connect: do not check connection on GET cb
Azat Khuzhin [Sun, 12 Jan 2020 12:31:50 +0000 (15:31 +0300)]
http-connect: do not check connection on GET cb

5 years agohttp-connect: set Host header (for CONNECT and GET) (like curl)
Azat Khuzhin [Sun, 12 Jan 2020 12:24:35 +0000 (15:24 +0300)]
http-connect: set Host header (for CONNECT and GET) (like curl)

5 years agohttp-connect: cleanup and helpers
Azat Khuzhin [Sun, 12 Jan 2020 12:14:24 +0000 (15:14 +0300)]
http-connect: cleanup and helpers

5 years agohttp: do not close connection for CONNECT
Azat Khuzhin [Sun, 12 Jan 2020 12:29:48 +0000 (15:29 +0300)]
http: do not close connection for CONNECT

5 years agohttp: do not assume body for CONNECT
Azat Khuzhin [Sun, 12 Jan 2020 10:43:18 +0000 (13:43 +0300)]
http: do not assume body for CONNECT

5 years agoAdded uninstall target check to cmakelists
Dimo Markov [Wed, 8 Jan 2020 18:37:16 +0000 (20:37 +0200)]
Added uninstall target check to cmakelists

5 years agoFix compilation without OPENSSL_API_COMPAT
Azat Khuzhin [Sun, 5 Jan 2020 16:02:22 +0000 (19:02 +0300)]
Fix compilation without OPENSSL_API_COMPAT

Use the following for openssl 1.1+:
- X509_getm_notBefore over X509_get_notBefore
- X509_getm_notAfter  over X509_get_notAfter
- use OPENSSL_VERSION_NUMBER over SSLeay()
- add missing headers

Refs: openssl/openssl@0b7347effee5

5 years agoevutil_time: Implements usleep() using wait funtion on Windows
yuangongji [Fri, 27 Dec 2019 09:53:28 +0000 (17:53 +0800)]
evutil_time: Implements usleep() using wait funtion on Windows

5 years agoInitialize variable to 0 replace use memset function in sample/hello-world.c
yangyongsheng [Sun, 29 Dec 2019 12:52:17 +0000 (20:52 +0800)]
Initialize variable to 0 replace use memset function in sample/hello-world.c

5 years agoappveyor: switch to Previous Visual Studio 2019 (VS issues after update)
Azat Khuzhin [Tue, 10 Dec 2019 06:25:39 +0000 (09:25 +0300)]
appveyor: switch to Previous Visual Studio 2019 (VS issues after update)

After update [1] of the Visual Studio 2019 image cmake unable to find
path to the c compiler [2]:

    cmake : CMake Error at CMakeLists.txt:47 (project):
    At line:1 char:1
    + cmake -G 'Visual Studio 16 2019' -A x64 ..
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (CMake Error at ...t:47 (project)::String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

      The CMAKE_C_COMPILER:
        C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
      is not a full path to an existing compiler tool.

  [1]: https://github.com/appveyor/ci/issues/3231
       https://www.appveyor.com/updates/2019/12/09/
  [2]: https://ci.appveyor.com/project/libevent/libevent/builds/29431286/job/a68h7dn9rcride9g

5 years agoAdd support for priority inheritance
Andre Pereira Azevedo Pinto [Thu, 5 Dec 2019 01:56:54 +0000 (17:56 -0800)]
Add support for priority inheritance

Add support for posix mutex priority inheritance. This is important to
avoid priority inversion in systems running with threads with different
priorities.

Signed-off-by: Andre Azevedo <andre.azevedo@gmail.com>
5 years agocmake: set CMAKE_{RUNTIME,LIBRARY,ARCHIVE}_OUTPUT_DIRECTORY they are not defined
Azat Khuzhin [Sat, 30 Nov 2019 12:48:36 +0000 (15:48 +0300)]
cmake: set CMAKE_{RUNTIME,LIBRARY,ARCHIVE}_OUTPUT_DIRECTORY they are not defined

This will allow overriding them in parent cmake rules, i.e. if libevent
is used via add_subdirectory().

Closes: #931
5 years agocmake: use CMAKE_LIBRARY_OUTPUT_DIRECTORY for the final shared library symlink
Azat Khuzhin [Sat, 30 Nov 2019 12:53:52 +0000 (15:53 +0300)]
cmake: use CMAKE_LIBRARY_OUTPUT_DIRECTORY for the final shared library symlink

Fixes: 669a53f3 ("cmake: set library names to be the same as with autotools")
5 years agoappveyor: fix EVENT_CMAKE_OPTIONS expansion (for multiple arguments)
Azat Khuzhin [Sun, 17 Nov 2019 20:22:53 +0000 (23:22 +0300)]
appveyor: fix EVENT_CMAKE_OPTIONS expansion (for multiple arguments)

Fixes: 63f73ee2 ("CI: integrate testing for components export")
5 years agotest-ratelim: calculate timers bias (for slow CPUs) to avoid false-positive
Azat Khuzhin [Sun, 17 Nov 2019 15:13:51 +0000 (18:13 +0300)]
test-ratelim: calculate timers bias (for slow CPUs) to avoid false-positive

This can be/should be done for regression tests too.

Refs: https://ci.appveyor.com/project/libevent/libevent/builds/28916689/job/kg621aa194a0qbym
Refs: https://github.com/libevent/libevent/pull/917#issuecomment-553811834
v2: EVENT_BASE_FLAG_PRECISE_TIMER

5 years agomailmap: add name/email aliases for yuangongji (name and email)
Azat Khuzhin [Sun, 17 Nov 2019 12:41:22 +0000 (15:41 +0300)]
mailmap: add name/email aliases for yuangongji (name and email)

Before:
  $ git log --format='%aE %aN' --author=yuangongji | sort | uniq -c
       30 82787816@qq.com yuangongji
        1 82787816@qq.com yuangongji (A)

After:
  $ git log --format='%aE %aN' --author=yuangongji | sort | uniq -c
       34 yuangongji@foxmail.com yuangongji

5 years agoMerge #929 -- cmake package improvements
Azat Khuzhin [Sat, 16 Nov 2019 23:45:54 +0000 (02:45 +0300)]
Merge #929 -- cmake package improvements

Example:

  find_package(Libevent 2.2.0 REQUIRED COMPONENTS core)
  add_executable(test test.c)
  target_link_libraries(test ${LIBEVENT_LIBRARIES})

* upstream/pr/929:
  CI: integrate testing for components export
  cmake: test for find_package()
  cmake: improve package config file

5 years agoappveyor: fix openssl version mismatch warning
yuangongji [Tue, 22 Oct 2019 14:29:12 +0000 (22:29 +0800)]
appveyor: fix openssl version mismatch warning

yuangongji:

  "Many warnings appear when building and running with Visual Studio 2019 in Appveyor:

   WARN C:\projects\libevent\test\regress_ssl.c:210: Version mismatch for openssl: compiled with 1000214f but running with 1000212f

   Simply add the openssl binary to the "PATH" environment variable to fix it.

   I wrote a simple demo to reproduce it: https://github.com/ygj6/verify
   I see there are dozens of openssl libraries in the system of appveyor: https://ci.appveyor.com/project/ygj6/verify/builds/28290688
   If you do not specify which openssl to use, the system cannot find the correct library."

5 years agoappveyor: disable parallel tests execution
Azat Khuzhin [Sat, 16 Nov 2019 23:37:59 +0000 (02:37 +0300)]
appveyor: disable parallel tests execution

Refs: https://github.com/libevent/libevent/pull/917#issuecomment-553784701

5 years agoCI: integrate testing for components export
yuangongji [Thu, 14 Nov 2019 10:34:56 +0000 (18:34 +0800)]
CI: integrate testing for components export

5 years agocmake: test for find_package()
yuangongji [Thu, 14 Nov 2019 10:28:31 +0000 (18:28 +0800)]
cmake: test for find_package()

5 years agocmake: improve package config file
yuangongji [Thu, 7 Nov 2019 10:26:47 +0000 (18:26 +0800)]
cmake: improve package config file

5 years agoLink with iphlpapi only on windows
Azat Khuzhin [Wed, 6 Nov 2019 18:41:38 +0000 (21:41 +0300)]
Link with iphlpapi only on windows

Fixes: 9fecb59a ("Parse IPv6 scope IDs.")
Refs: #923

5 years agoParse IPv6 scope IDs.
Philip Homburg [Tue, 29 Oct 2019 14:48:53 +0000 (15:48 +0100)]
Parse IPv6 scope IDs.

5 years agoRelax bufferevent_connect_hostname_emfile
Azat Khuzhin [Thu, 31 Oct 2019 06:18:58 +0000 (09:18 +0300)]
Relax bufferevent_connect_hostname_emfile

Do not do any assumptions on the error for the EMFILE from
getaddrinfo(), expect just any error.

Fixes: #924
5 years agoautotools: fails build when need but can not find openssl
yuangongji [Sat, 26 Oct 2019 14:31:18 +0000 (22:31 +0800)]
autotools: fails build when need but can not find openssl

5 years agocmake: eliminate duplicate installation of public headers
yuangongji [Fri, 25 Oct 2019 13:54:13 +0000 (21:54 +0800)]
cmake: eliminate duplicate installation of public headers

5 years agoMerge pull request #915 from ygj6 -- evutil_socketpair win32 fixes
Azat Khuzhin [Mon, 21 Oct 2019 19:21:19 +0000 (22:21 +0300)]
Merge pull request #915 from ygj6 -- evutil_socketpair win32 fixes

* upstream/pr/915:
  appveyor: add vs2019 os to test some new features brought by Win10
  test: add testcase for evutil_socketpair()
  evutil: make evutil_socketpair() have the same behavior on Windows with build number lower and higher than 17063

5 years agoappend to CMAKE_MODULE_PATH
Michael Davidsaver [Mon, 21 Oct 2019 17:36:49 +0000 (10:36 -0700)]
append to CMAKE_MODULE_PATH

Don't override any -DCMAKE_MODULE_PATH= passed from CLI
to eg. test custom Platform/ support.

5 years agoappveyor: add vs2019 os to test some new features brought by Win10
yuangongji [Fri, 18 Oct 2019 15:32:14 +0000 (23:32 +0800)]
appveyor: add vs2019 os to test some new features brought by Win10

5 years agotest: add testcase for evutil_socketpair()
yuangongji [Fri, 18 Oct 2019 13:11:37 +0000 (21:11 +0800)]
test: add testcase for evutil_socketpair()

5 years agoevutil: make evutil_socketpair() have the same behavior on Windows with build number...
yuangongji [Fri, 18 Oct 2019 13:03:40 +0000 (21:03 +0800)]
evutil: make evutil_socketpair() have the same behavior on Windows with build number lower and higher than 17063

5 years agoDo not use sysctl.h on linux (it had been deprecated)
Azat Khuzhin [Tue, 15 Oct 2019 22:11:51 +0000 (01:11 +0300)]
Do not use sysctl.h on linux (it had been deprecated)

It had been deprecated for a long time (AFAIK), but since
glibc-2.29.9000-309-g744e829637 it produces a #warning

5 years agoevutil: implement socketpair with unix domain socket on Win10
yuangongji [Sat, 12 Oct 2019 10:45:52 +0000 (18:45 +0800)]
evutil: implement socketpair with unix domain socket on Win10

5 years agotravis-ci: add OPENSSL_1_1=yes for the openssl 1.1 to distinguish it in list
Azat Khuzhin [Mon, 14 Oct 2019 20:22:55 +0000 (23:22 +0300)]
travis-ci: add OPENSSL_1_1=yes for the openssl 1.1 to distinguish it in list

5 years agotravis-ci: use matrix.include over env.matrix/matrix.exclude for coveralls
Azat Khuzhin [Mon, 14 Oct 2019 20:20:23 +0000 (23:20 +0300)]
travis-ci: use matrix.include over env.matrix/matrix.exclude for coveralls

5 years agotravis-ci: build with clang only basic configurations
Azat Khuzhin [Mon, 14 Oct 2019 19:32:01 +0000 (22:32 +0300)]
travis-ci: build with clang only basic configurations

I tried to exclude clang instead (for PRs), but matrix.exclude cannot
have conditions (i..e matrix.exclude.if).

5 years agoUse matrix.include.if over matrix.exclude.if for doxygen
Azat Khuzhin [Mon, 14 Oct 2019 09:20:45 +0000 (12:20 +0300)]
Use matrix.include.if over matrix.exclude.if for doxygen

And use if.repo over if.slug

Fixes: aeb014cc ("Do not try to deploy documentaion for PR")
5 years agoDo not try to deploy documentaion for PR
Azat Khuzhin [Sun, 13 Oct 2019 23:49:55 +0000 (02:49 +0300)]
Do not try to deploy documentaion for PR

Anyway access to security variables is forbidden for PRs.

v2: use travis-ci conditions, to avoid running addons

5 years agoFix all all yamllint warnings in travis/appveyor rules
Azat Khuzhin [Tue, 8 Oct 2019 21:16:50 +0000 (00:16 +0300)]
Fix all all yamllint warnings in travis/appveyor rules

5 years agoappveyor: do not allow any failures
Azat Khuzhin [Tue, 8 Oct 2019 21:13:01 +0000 (00:13 +0300)]
appveyor: do not allow any failures

Yes we still have flacky tests, but anyway two main configuration can
fail too (and they do fail from time to time) so let's not allow any
failures and see how this will go.

(Credits to @ygj6 via #910)

5 years agoappveyor: fix build script for compiling using mingw-w64
yuangongji [Tue, 8 Oct 2019 14:01:01 +0000 (22:01 +0800)]
appveyor: fix build script for compiling using mingw-w64

5 years agosample/https-client: link crypt32 explicitly when build with mingw-w64
yuangongji [Tue, 8 Oct 2019 13:38:58 +0000 (21:38 +0800)]
sample/https-client: link crypt32 explicitly when build with mingw-w64

5 years agoMerge remote-tracking branch 'upstream/pr/908'
Azat Khuzhin [Mon, 7 Oct 2019 19:10:14 +0000 (22:10 +0300)]
Merge remote-tracking branch 'upstream/pr/908'

* upstream/pr/908:
  Avoid transforming base C_FLAGS set deliberately

5 years agoFix compat with NetBSD >= 10
Kamil Rytarowski [Thu, 3 Oct 2019 23:26:47 +0000 (01:26 +0200)]
Fix compat with NetBSD >= 10

kevent::udata was switched from intptr_t to void*.

Handle both cases with the GCC extension typeof().

5 years agoAvoid transforming base C_FLAGS set deliberately
William A Rowe Jr [Thu, 3 Oct 2019 18:40:52 +0000 (11:40 -0700)]
Avoid transforming base C_FLAGS set deliberately

The CMAKE_C_FLAGS_DEBUG, CMAKE_C_FLAGS_RELEASE, CMAKE_C_FLAGS_MINSIZEREL
and CMAKE_C_FLAGS_RELWITHDEBINFO options are correctly and deliberately
toggled to use the libcmt (/MT) flag options in place of the usual
msvcrt (/MD) options, but this isn't necessarily desired by the user.
The default choice can be overriden with the EVENT__MSVC_STATIC_RUNTIME
cmake option.

However, the /MD flag that is the choice of CMake only enters into
play for the four types of builds above. If the user introduces another
CMAKE_BUILD_TYPE, the base CMAKE_C_FLAGS must not be manipulated, as
that value (and the CMAKE_C_FLAGS_{custom} value) have been explicitly
chosen by the user/developer deploying this library, and the mismatch
between these flags in different dependencies results in link errors.

The CMake build schema itself doesn't place an /MD flag in CMAKE_BUILD_TYPE
so any /M compile option in that variable needs to be retained.

Signed-off-by: William Rowe <wrowe@pivotal.io>
Signed-off-by: Yechiel Kalmenson <ykalmenson@pivotal.io>
5 years agotinytest: support timeout on Windows
yuangongji [Thu, 26 Sep 2019 13:47:51 +0000 (21:47 +0800)]
tinytest: support timeout on Windows

5 years agoMerge branch 'upstream/pr/899' (evbuffer_freeze testcase enhancements)
Azat Khuzhin [Sun, 22 Sep 2019 15:44:55 +0000 (18:44 +0300)]
Merge branch 'upstream/pr/899' (evbuffer_freeze testcase enhancements)

* upstream/pr/899:
  improve the description of parameter to evbuffer_read()
  regress_buffer: improve testcase for evbuffer_freeze()

5 years agoimprove the description of parameter to evbuffer_read()
yuangongji [Sat, 21 Sep 2019 15:37:38 +0000 (23:37 +0800)]
improve the description of parameter to evbuffer_read()

5 years agoregress_buffer: improve testcase for evbuffer_freeze()
yuangongji [Thu, 19 Sep 2019 14:19:58 +0000 (22:19 +0800)]
regress_buffer: improve testcase for evbuffer_freeze()

5 years agoevbuffer_add_file: fix freeing of segment in the error path
Azat Khuzhin [Sat, 21 Sep 2019 20:30:48 +0000 (23:30 +0300)]
evbuffer_add_file: fix freeing of segment in the error path

if evbuffer_add_file_segment() fails it returns -1, so we should call
evbuffer_file_segment_free() only on error, and this -1 not 0.

Fixes: 6a81b1f5 ("Avoid double-free on error in evbuffer_add_file. Found by coverity.")
Backport-to: 2.1
5 years agoevutil_time: detect and use _gmtime64_s()/_gmtime64()
yuangongji [Thu, 19 Sep 2019 07:24:51 +0000 (15:24 +0800)]
evutil_time: detect and use _gmtime64_s()/_gmtime64()

5 years agohttp: rename bind_socket_ai() to create_bind_socket_nonblock()
yuangongji [Wed, 18 Sep 2019 20:12:59 +0000 (23:12 +0300)]
http: rename bind_socket_ai() to create_bind_socket_nonblock()

5 years agohttp: make sure the other fields in ext_method are not changed by the callback
yuangongji [Mon, 16 Sep 2019 15:24:32 +0000 (23:24 +0800)]
http: make sure the other fields in ext_method are not changed by the callback

5 years agohttps-client: load certificates from the system cert store on Windows
yuangongji [Sun, 15 Sep 2019 13:45:26 +0000 (21:45 +0800)]
https-client: load certificates from the system cert store on Windows

5 years agoBuild doxygen documentation via cmake (to fill variables)
Azat Khuzhin [Sun, 8 Sep 2019 19:30:54 +0000 (22:30 +0300)]
Build doxygen documentation via cmake (to fill variables)

Refs: #782

5 years agoDeploy documentation to libevent-doc.github.io
Azat Khuzhin [Sun, 8 Sep 2019 08:47:04 +0000 (11:47 +0300)]
Deploy documentation to libevent-doc.github.io

Based-on: https://github.com/ygj6/libevent/commit/4a86dcb4df0f9dc69f7722a1ba7567ef3b8447c8.patch (by @ygj6)

5 years agoFix checking return value of the evdns_base_resolv_conf_parse()
Azat Khuzhin [Thu, 5 Sep 2019 20:31:19 +0000 (23:31 +0300)]
Fix checking return value of the evdns_base_resolv_conf_parse()

Reported-by: Maxim Gorbachyov <maxim.gorbachyov@gmail.com>
5 years agocmake: fix getrandom() detection
Azat Khuzhin [Tue, 3 Sep 2019 21:46:01 +0000 (00:46 +0300)]
cmake: fix getrandom() detection

Fixes: 86f55b04 ("arc4random: replace sysctl() with getrandom (on linux)")
5 years agoarc4random: replace sysctl() with getrandom (on linux)
Azat Khuzhin [Mon, 2 Sep 2019 21:34:35 +0000 (00:34 +0300)]
arc4random: replace sysctl() with getrandom (on linux)

Since sysctl() is deprecated for a long-long time, according to
sysctl(2):

    Since Linux 2.6.24, uses of this system call result in warnings in the kernel log.

Fixes: #890
Suggested-by: Pierce Lopez
5 years agoUpgrade autoconf (after upgrading minimum required to 2.67)
yuangongji [Fri, 30 Aug 2019 02:21:07 +0000 (10:21 +0800)]
Upgrade autoconf (after upgrading minimum required to 2.67)

- AC_PROG_SED
- AC_USE_SYSTEM_EXTENSIONS
- AC_TRY_COMPILE -> AC_COMPILE_IFELSE
- AC_TRY_RUN -> AC_RUN_IFELSE
...

Also use:
- AC_CONFIG_AUX_DIR

Refs: #870
Fixes: 3f09e923 ("Change the minimum version of automake to 1.13 and autoconf to 2.67")