4494 Commits

Author SHA1 Message Date
Azat Khuzhin
8209a623ad checkpatch.sh: fix usage
Refs: #1029
2020-05-27 20:36:28 +03:00
Wataru Ashihara
866fbb5457
Fix clang-format-diff usage
"--style" is invalid:

$ ./checkpatch.sh -r HEAD
usage: clang-format-diff [-h] [-i] [-p NUM] [-regex PATTERN] [-iregex PATTERN]
                         [-sort-includes] [-v] [-style STYLE] [-binary BINARY]
clang-format-diff: error: unrecognized arguments: --style={ Language:... }
2020-05-28 00:06:20 +09:00
Azat Khuzhin
7426a568d0 http: Merge branch 'http-max_connections-pr-592'
@jcoffland:

  "When the max connection limit is enabled and the limit is reached, the
   server will respond immediately with 503 Service Unavailable. This can
   be used to prevent servers from running out of file descriptors. This is
   better than request limiting because clients may make more than one
   request over a single connection. Blocking a request does not
   necessarily close the connection and free up a socket."

* http-max_connections-pr-592:
  test: cover evhttp max connections
  Added evhttp max simultaneous connection limiting
2020-05-25 11:25:18 +03:00
Azat Khuzhin
95c1c200c1 test: cover evhttp max connections 2020-05-25 11:24:29 +03:00
mohuang
f10aaea374
variable redefinition in win32_dispatch 2020-05-25 10:33:24 +08:00
Azat Khuzhin
028842aacb Merge branch 'evdns-tcp-pr-1004'
@seleznevae:

  "Added support for DNS requests via TCP. By default, requests are done
   via UDP. In case truncated response is received new attempt is done
   via TCP connection. Added 2 new macros DNS_QUERY_USEVC and
   DNS_QUERY_IGNTC to force all requests to be done via TCP and to disable
   switch to TCP in case of truncated responses.

   Also added possibility for DNS server to listen and receive requests on
   TCP port. Current implementation of TCP support in DNS server seems
   rather preliminary and maybe changes after discussion and code review.

   Fallback to TCP in case of truncated DNS requests is done automatically.
   To imitate the old behaviour macros DNS_QUERY_IGNTC should be used. To
   force all DNS requests to be done via TCP one should use the flag
   DNS_QUERY_USEVC. Names DNS_QUERY_IGNTC, DNS_QUERY_USEVC were chosen to
   imitate similar flags in c-ares and glibc."

Ok, interfaces looks good, merging to avoid stalling it for too long.

* evdns-tcp-pr-1004:
  evdns: fix coding style issues
  evdns: fix trailing whitespaces
  evdns: bufferevent_setcb before bufferevent_free is redundant
  evdns: Implement dns requests via tcp
2020-05-25 03:14:26 +03:00
Azat Khuzhin
2c2248eaee evdns: fix coding style issues 2020-05-25 03:12:20 +03:00
Azat Khuzhin
1cab3c0570 evdns: fix trailing whitespaces 2020-05-25 03:12:20 +03:00
Azat Khuzhin
1cf24f04ff evdns: bufferevent_setcb before bufferevent_free is redundant 2020-05-25 03:12:20 +03:00
Azat Khuzhin
e8c8951029 test: http/autofree_connection cleanup 2020-05-25 02:07:44 +03:00
ayuseleznev
0f6ee89a39 evdns: Implement dns requests via tcp 2020-05-21 12:46:20 +03:00
Azat Khuzhin
eee26deed3 http: fix EVHTTP_CON_AUTOFREE in case of timeout (and some else)
Refs: #182
2020-05-19 11:46:21 +03:00
Azat Khuzhin
083c6d54d5 http: fix EVHTTP_CON_AUTOFREE in case of connection error
Refs: #182
2020-05-19 01:06:12 +03:00
Azat Khuzhin
70f69194eb test: cleanup http/autofree_connection 2020-05-19 01:06:12 +03:00
Azat Khuzhin
1cc94feab8 test: fix http/autofree_connection
Refs: #182
2020-05-19 01:06:02 +03:00
ayuseleznev
8fe35c7614 evdns: Add additional validation for values of dns options 2020-05-18 14:31:49 +03:00
Nick Grifka
83ef3216e4 Add wepoll support to light up the epoll backend on Windows
libevent is lacking a scalable backend on Windows. Let's leverage the wepoll
library until Windows comes up with an epoll/kqueue compete user mode API.

- All regress tests pass for standard wepoll
- These 2 tests fail intermittently for changelist wepoll, so disabling
  changelist wepoll for now
     http/cancel_inactive_server
     http/stream_in
- verify target on Windows runs tests for both wepoll and win32 backends
- wepoll backend preferred over win32 backend
- wepoll version 1.5.6

v2: cleaner backend abstraction. Disallow wepoll on MinGW/Cygwin.
v3: Add wepoll.h to dist
v4: Make sure wepoll source files are excluded from cygwin/mingw builds
v5: Keep win32 as default backend on windows.
v6: Include wepoll in mingw builds. Verified that regress tests pass w/ WEPOLL backend.
v7: Enable wepoll on mingw when building with cmake
v8: Add wepoll testrunner for autotools test target
2020-05-08 23:27:04 +03:00
Nick Grifka
06a1192951 test: Fix test_simpleclose for Windows platform
Replace close with evutil_closesocket
Caught with PR #1006
2020-05-07 21:14:13 -07:00
Azat Khuzhin
15917b420d Include details of the ABI compatibility report 2020-05-06 03:03:27 +03:00
Azat Khuzhin
889ad6d698 Add ABI compatibility report deploy
Closes: #887
2020-05-06 02:46:28 +03:00
Azat Khuzhin
448a478a98 abi-check: abi-monitor 1.10 does not support -make -j8 (1.12 supports though)
An error for 1.10 on ci:
  https://github.com/azat/libevent/runs/647860649?check_suite_focus=true#step:4:219
2020-05-06 02:45:26 +03:00
Azat Khuzhin
f3e911ed9e Do not ignore anything in .github
Fixes: 28eb0d91 ("github actions looks good - drop travis/appveyor (#951)")
2020-05-06 02:09:51 +03:00
yuangongji
735c891e71 Add API/ABI checker (using LVC)
v2 (by azat):
- drop package installations
- use local .abi-check over $HOME/abi-check for build dir
- drop regex check, simply use default values (too complex otherwise)
- use sub-shell to avoid cd back
- add missing quotes
- make the style uniq across the whole file (no tabs for indent, copy-paste?)
- drop `set -x`, use `bash -x abi-check.sh` over
- drop EVENT_ABI_CHECK
- use /usr/bin/env bash as shebang
- use `find | xargs` over `cp $(grep -v)`
- adjust markdown syntax in abi-check/README.md
- adjust link to the publicly available documentation

v3 (by azat):
- docker image
- git check-ignore
- make -j8
- allow to change defaults

Refs: #887
2020-05-05 21:04:18 +03:00
Azat Khuzhin
512c88ceb4 ci/linux: add dist check 2020-05-05 16:25:44 +03:00
Azat Khuzhin
f3bc532735 Update list of cmake files for autotools dist archive
Fixes: #976
2020-05-05 16:25:44 +03:00
Azat Khuzhin
c19ebffb21 ci: change cache key for windows/mingw
Should fix the following current failures:
- 2020-05-04T22:32:02.9490248Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): error MSB6006: "cmd.exe" exited with code 3. [D:\a\libevent\libevent\build\regress.vcxproj]
- cmake : /usr/bin/sh: /C/hostedtoolcache/windows/Python/3.7.6/x64/python.exe: No such file or directory

P.S. I guess python has another path, but on my fork it is the same and
it passes.
2020-05-05 15:01:25 +03:00
Azat Khuzhin
7a465268b2 Pass --quiet to the event_rcpgen.py (autotools already does this) 2020-05-05 14:21:21 +03:00
Azat Khuzhin
072dfacfeb Do not run CI if message contains "ci skip"
https://github.com/marketplace/actions/skip-based-on-commit-message
2020-05-05 13:57:15 +03:00
Aleksandr-Melnikov
61fc2bf2e9
There is typo in GetAdaptersAddresses windows library. It should be iphlpapi.dll 2020-05-05 10:31:09 +01:00
Azat Khuzhin
4c13afaeec Support EV_CLOSED on linux for poll(2)
Refs: #984
2020-05-05 01:21:12 +03:00
Azat Khuzhin
972b456bf6 Fix EV_CLOSED detection/reporting (epoll only)
- EV_CLOSED is EPOLLRDHUP in epoll
- EPOLLRDHUP reported w/o EPOLLHUP if the socket closed with shutdown(SHUT_WR)
- EPOLLRDHUP reported w/  EPOLLHUP if the socket closed with close()
  so in this case epoll backend will detect this event as error
  (EV_READ|EV_WRITE), since the epoll_ctl() will return EPOLLRDHUP with
  EPOLLHUP set, but this is not correct, let's fix this.

Fixes: #984
2020-05-05 00:25:23 +03:00
Azat Khuzhin
c10cde4c61 Merge branch 'EV_CLOSED-and-EV_ET-fixes'
* EV_CLOSED-and-EV_ET-fixes:
  Avoid triggering wrong events with EV_ET set
  epoll: handle EV_ET for EV_CLOSED too
  test: cover EV_CLOSED with lots of possible scenarious
  test: rename simpleclose to simpleclose_rw (since it works via write/read)
2020-05-05 00:05:49 +03:00
Azat Khuzhin
9543f31a1a Avoid triggering wrong events with EV_ET set
For the event at least something except EV_ET should be set, so checking
ev->ev_events with "triggered" events is wrong, because EV_ET is always
passed (see epoll), since it will be filtered out if it is not set in
event.
2020-05-04 23:58:28 +03:00
Azat Khuzhin
e703c034cb epoll: handle EV_ET for EV_CLOSED too 2020-05-04 23:58:28 +03:00
Azat Khuzhin
ecb67f6189 test: cover EV_CLOSED with lots of possible scenarious
- trigger *RDHUP via close() <-- has issues
- trigger *RDHUP via shutdown()
- EV_CLOSED
- EV_CLOSED|EV_PERSIST
- EV_CLOSED|EV_ET <!-- has issues
- EV_CLOSED|EV_ET|EV_PERSIST
2020-05-04 23:58:28 +03:00
Azat Khuzhin
c81362b2ec test: rename simpleclose to simpleclose_rw (since it works via write/read) 2020-05-04 23:58:28 +03:00
Azat Khuzhin
28eb0d91a4 github actions looks good - drop travis/appveyor (#951)
Actually right now github's VMs is better then travis/appveyor.
2020-05-04 23:50:15 +03:00
Nicolas J. Bouliane
bdc5200acd bufferevent: allow setting priority on socket and openssl type 2020-05-03 00:32:10 +00:00
yuangongji
86eafc0343
cmake: set a default value for LIBEVENT_STATIC_LINK 2020-05-01 09:51:29 +08:00
Nick Grifka
f0b3160f8c evutil_time: improve evutil_gettimeofday on Windows
If present, use GetSystemTimePreciseAsFileTime instead of
GetSystemTimeAsFileTime. Available since Windows 8.
2020-04-29 00:53:03 +03:00
Nick Grifka
5caffa7a5b bench: Allow backend method selection
-l         list available methods
-m <name>  use method
2020-04-27 10:03:28 -07:00
Azat Khuzhin
5786290109 cmake: missing test-closed binary 2020-04-08 00:29:40 +03:00
Azat Khuzhin
dd02ad9544 Merge branch 'event_rpcgen.py-cleanup'
* event_rpcgen.py-cleanup:
  event_rpcgen.py: fix arguments-differ
  event_rpcgen.py: fix attribute-defined-outside-init
  event_rpcgen: suppress some warnings to make pylint clean
  Don't accumulate arguments in `Entry.GetTranslation`
  Fix improper string concatenations in lists
  Fix warnings regarding unused variables
  Don't override the `type` built-in
  Call `super` to call methods from the parent class
  Address `no-self-use` issues reported by pylint
  Run the code through the black formatter
  Reformat strings to template
  Add `argparse` support
  Precompile regular expressions
  Use bools instead of ints values where possible
  Rename all global variables to match the PEP8 spec
  Handle file pointers with context suite patterns
  Iterate over `tokens` with a for instead of while
  Fix indentation for `RpcGenError`
  Don't override `file` built-in
  Resolve variable name issues per PEP8
  Sort imports per PEP8
2020-03-28 16:02:39 +03:00
Azat Khuzhin
b57b6e4600 event_rpcgen.py: fix arguments-differ 2020-03-28 16:01:46 +03:00
Azat Khuzhin
7cdf75ca26 event_rpcgen.py: fix attribute-defined-outside-init 2020-03-28 15:58:57 +03:00
Azat Khuzhin
121fe01372 event_rpcgen: suppress some warnings to make pylint clean 2020-03-28 15:58:36 +03:00
Enji Cooper
47a2bcf6e8 Don't accumulate arguments in Entry.GetTranslation
Initialize `extradict` safely to avoid accumulating arguments in dict
objects passed in across calls.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2020-03-27 17:30:23 -07:00
Enji Cooper
6a3ca34737 Fix improper string concatenations in lists
This change adds commas between elements or explicitly concatenates the
strings, so the values are no longer concatenated by accident.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2020-03-27 17:30:02 -07:00
Enji Cooper
496fc02b2f Fix warnings regarding unused variables
Prefix all unused variables with `_` to mute unused variable warnings
with flake8/pylint.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2020-03-27 17:27:35 -07:00
Enji Cooper
80171db515 Don't override the type built-in
Name the second parameter to `Entry(..)` `ent_type` to avoid overriding
the built-in.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2020-03-27 16:45:21 -07:00