4614 Commits

Author SHA1 Message Date
yuangongji
02dc7a1b17 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."
2019-11-17 02:42:42 +03:00
Azat Khuzhin
28ba0a4797 appveyor: disable parallel tests execution
Refs: https://github.com/libevent/libevent/pull/917#issuecomment-553784701
2019-11-17 02:42:41 +03:00
yuangongji
63f73ee2ad CI: integrate testing for components export 2019-11-15 22:00:41 +08:00
yuangongji
cd15112b62 cmake: test for find_package() 2019-11-14 18:28:31 +08:00
yuangongji
dc4be869d5 cmake: improve package config file 2019-11-14 18:09:31 +08:00
Azat Khuzhin
1495f8b67a Link with iphlpapi only on windows
Fixes: 9fecb59a ("Parse IPv6 scope IDs.")
Refs: #923
2019-11-06 21:44:30 +03:00
Philip Homburg
9fecb59a94 Parse IPv6 scope IDs. 2019-11-06 21:07:16 +03:00
Azat Khuzhin
4436287d12 Relax bufferevent_connect_hostname_emfile
Do not do any assumptions on the error for the EMFILE from
getaddrinfo(), expect just any error.

Fixes: #924
2019-10-31 09:20:49 +03:00
yuangongji
53b3be4ee9 autotools: fails build when need but can not find openssl 2019-10-26 22:43:26 +08:00
yuangongji
5fe83d7433 cmake: eliminate duplicate installation of public headers 2019-10-25 21:54:13 +08:00
Azat Khuzhin
1ba94bdf08 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
2019-10-21 22:21:19 +03:00
Michael Davidsaver
84affc1837 append to CMAKE_MODULE_PATH
Don't override any -DCMAKE_MODULE_PATH= passed from CLI
to eg. test custom Platform/ support.
2019-10-21 10:41:27 -07:00
yuangongji
38eb4846e2 appveyor: add vs2019 os to test some new features brought by Win10 2019-10-19 13:16:25 +08:00
yuangongji
55d60c9258 test: add testcase for evutil_socketpair() 2019-10-19 13:07:04 +08:00
yuangongji
879d249619 evutil: make evutil_socketpair() have the same behavior on Windows with build number lower and higher than 17063 2019-10-18 21:03:40 +08:00
Azat Khuzhin
b9b9f19058 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
2019-10-16 01:11:51 +03:00
yuangongji
dda8968c71 evutil: implement socketpair with unix domain socket on Win10 2019-10-14 23:23:56 +03:00
Azat Khuzhin
11bdd41c56 travis-ci: add OPENSSL_1_1=yes for the openssl 1.1 to distinguish it in list 2019-10-14 23:22:55 +03:00
Azat Khuzhin
fb95772ac7 travis-ci: use matrix.include over env.matrix/matrix.exclude for coveralls 2019-10-14 23:20:44 +03:00
Azat Khuzhin
f2bdd6eea1 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).
2019-10-14 23:20:20 +03:00
Azat Khuzhin
c1c8ae714b 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")
2019-10-14 22:24:37 +03:00
Azat Khuzhin
aeb014cc05 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
2019-10-14 03:05:41 +03:00
Azat Khuzhin
b32a644302 Fix all all yamllint warnings in travis/appveyor rules 2019-10-09 00:19:17 +03:00
Azat Khuzhin
c88c578ac3 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)
2019-10-09 00:13:33 +03:00
yuangongji
72d140c2e1 appveyor: fix build script for compiling using mingw-w64 2019-10-08 22:01:01 +08:00
yuangongji
78b5bca6d8 sample/https-client: link crypt32 explicitly when build with mingw-w64 2019-10-08 21:38:58 +08:00
Azat Khuzhin
c328999e5d Merge remote-tracking branch 'upstream/pr/908'
* upstream/pr/908:
  Avoid transforming base C_FLAGS set deliberately
2019-10-07 22:10:14 +03:00
Kamil Rytarowski
72e6eff025 Fix compat with NetBSD >= 10
kevent::udata was switched from intptr_t to void*.

Handle both cases with the GCC extension typeof().
2019-10-04 01:30:39 +02:00
William A Rowe Jr
af4b07a55c 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>
2019-10-03 11:40:52 -07:00
yuangongji
8d5c5650d2 tinytest: support timeout on Windows 2019-09-26 21:54:33 +08:00
Azat Khuzhin
a977d69636
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()
2019-09-22 18:45:21 +03:00
yuangongji
5aae74d7a6 improve the description of parameter to evbuffer_read() 2019-09-22 22:57:47 +08:00
yuangongji
6769f692d7 regress_buffer: improve testcase for evbuffer_freeze() 2019-09-22 22:57:21 +08:00
Azat Khuzhin
4727150a54
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
2019-09-21 23:32:55 +03:00
yuangongji
148d12ad31 evutil_time: detect and use _gmtime64_s()/_gmtime64() 2019-09-19 15:52:49 +08:00
yuangongji
0cd536b0b3
http: rename bind_socket_ai() to create_bind_socket_nonblock() 2019-09-18 23:13:34 +03:00
yuangongji
1c78451f0d
http: make sure the other fields in ext_method are not changed by the callback 2019-09-18 23:12:56 +03:00
yuangongji
572a565130 https-client: load certificates from the system cert store on Windows 2019-09-17 20:57:01 +08:00
Azat Khuzhin
095c8ae111 Build doxygen documentation via cmake (to fill variables)
Refs: #782
2019-09-08 22:32:49 +03:00
Azat Khuzhin
0546744503 Deploy documentation to libevent-doc.github.io
Based-on: 4a86dcb4df.patch (by @ygj6)
2019-09-08 13:43:41 +03:00
Azat Khuzhin
c3f353450e Fix checking return value of the evdns_base_resolv_conf_parse()
Reported-by: Maxim Gorbachyov <maxim.gorbachyov@gmail.com>
2019-09-05 23:32:40 +03:00
Azat Khuzhin
194a5d8226 cmake: fix getrandom() detection
Fixes: 86f55b04 ("arc4random: replace sysctl() with getrandom (on linux)")
2019-09-04 00:46:27 +03:00
Azat Khuzhin
86f55b0420 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
2019-09-03 00:50:10 +03:00
yuangongji
13b8fc39fd 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")
2019-09-02 22:33:57 +03:00
Azat Khuzhin
ddacaef59a Revert "Warn if forked from the event loop during event_reinit()"
Thinking about this more and realizing that this was a mistake, so
should be reverted.

In a nut shell I guess most of the apps calls event_reinit() from the
loop (see [1] for example), and this should be totally fine (the bit
with the signals [2] handled in event_reinit() gracefully)

  [1]: https://archives.seul.org/libevent/users/Aug-2019/msg00009.html
  [2]: https://github.com/libevent/libevent/pull/833#issuecomment-501834453

This reverts commit 497ef904d544ac51de43934549dbeccce8e6e8f8.

Reported-by: mikulas@twibright.com
Backport-to: 2.1
2019-09-02 22:14:22 +03:00
Boris.Dergachov
b5e1d91154 Fixes spelling 2019-09-02 11:11:58 +03:00
yuangongji
620a3fa1d5 Doxygen documentation improvements
- Documentation for `bufferevent_compat.h` and `rpc.h` is not generated
  since the `@file` command is missing. It can be fixed by adding
  `@file` in file comment block.
- The briefs of buffer.h,bufferevent.h and some other files are missing.
  Adding `@brief` command can fix it.
- The parameters in the function declaration are different from the
  parameters following the `@param` command.We should change them to the
  same.
- Documentation of `watch.h` is not generated since `watch.h` has not
  been added to the Doxyfile `INPUT` tag.

- Add link to the watch.h in event.h
2019-08-29 23:08:12 +03:00
yuangongji
6f970267b6 eliminate some C4267 warnings in Windows 2019-08-28 11:41:53 +08:00
yuangongji
f9c6a14ee0 autotools: attach doxygen target into all target
v2: disable man pages by default
2019-08-28 01:23:26 +03:00
yuangongji
1d1c19091f cmake: attach doxygen target into all target
v2: Disable non-html generator for doxygen by default
v3: convert cmake option to doxygen config
2019-08-28 01:23:26 +03:00