dockercui
147298a2d1
Fix some comments
...
Signed-off-by: dockercui <dockercui@aliyun.com>
2024-04-24 08:27:12 +02:00
Andy Pan
6074d55822
Avoid calling read(2) on eventfd on each event-loop wakeup
...
Register the eventfd with EPOLLET to enable edge-triggered notification
where we don't need to read the data from the eventfd for every wakeup
event.
When the eventfd counter reaches the maximum value of the unsigned 64-bit,
we rewind the counter and retry again. This optimization saves one system
call on each event-loop wakeup, which eliminates the extra latency for epoll
as the EVFILT_USER filter does for the kqueue.
2024-04-20 13:16:17 +03:00
dependabot[bot]
e0a4574ba2
Bump the github-actions group with 5 updates
...
Bumps the github-actions group with 5 updates:
| Package | From | To |
| --- | --- | --- |
| [actions/cache](https://github.com/actions/cache ) | `3` | `4` |
| [nick-fields/retry](https://github.com/nick-fields/retry ) | `2` | `3` |
| [coverallsapp/github-action](https://github.com/coverallsapp/github-action ) | `1.2.5` | `2.2.3` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action ) | `2.1.2` | `2.3.1` |
| [github/codeql-action](https://github.com/github/codeql-action ) | `2.2.4` | `3.24.10` |
Updates `actions/cache` from 3 to 4
- [Release notes](https://github.com/actions/cache/releases )
- [Commits](https://github.com/actions/cache/compare/v3...v4 )
Updates `nick-fields/retry` from 2 to 3
- [Release notes](https://github.com/nick-fields/retry/releases )
- [Changelog](https://github.com/nick-fields/retry/blob/master/.releaserc.js )
- [Commits](https://github.com/nick-fields/retry/compare/v2...v3 )
Updates `coverallsapp/github-action` from 1.2.5 to 2.2.3
- [Release notes](https://github.com/coverallsapp/github-action/releases )
- [Upgrade guide](https://github.com/coverallsapp/github-action/blob/main/UPGRADE.md )
- [Commits](09b709cf6a...3dfc556739
)
Updates `ossf/scorecard-action` from 2.1.2 to 2.3.1
- [Release notes](https://github.com/ossf/scorecard-action/releases )
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md )
- [Commits](e38b1902ae...0864cf1902
)
Updates `github/codeql-action` from 2.2.4 to 3.24.10
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](17573ee1cc...4355270be1
)
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: nick-fields/retry
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: coverallsapp/github-action
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: ossf/scorecard-action
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: github-actions
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-04-17 09:39:14 +03:00
Diogo Teles Sant'Anna
80e25c02ff
Enable dependabot for github actions
2024-04-15 10:40:35 +03:00
Diogo Teles Sant'Anna
a4ec4cbe51
Hashpin workflows that use sensitive permisisons
2024-04-15 10:40:35 +03:00
williammuji
9de85b5834
fix WSOptions enum value and extended payload length bug
2024-04-15 10:31:04 +03:00
icy17
6e390911d0
Fix potential Null pointer dereference in regress_buffer.c
2024-04-15 10:26:46 +03:00
icy17
74217832a8
Fix potential Null pointer dereference in regress.c
2024-04-15 10:26:11 +03:00
icy17
d6e8835256
Fix potential Null pointer dereference in regress_et.c
2024-04-15 10:17:08 +03:00
icy17
d45dca4373
Fix potential Null pointer dereference in regress_thread.c
2024-04-15 10:16:26 +03:00
icy17
2bdf17370c
Fix potential Null pointer dereference in regress_finalize.c
2024-04-15 10:08:00 +03:00
icy17
17796a2d8a
Fix potential Null pointer dereference in regress_http.c
2024-04-15 10:06:42 +03:00
icy17
f9526e13ce
Fix potential NULL pointer dereference in regress_bufferevent.c
2024-04-15 10:05:32 +03:00
icy17
fc48803db4
Fix potential Null pointer dereference in regress_zlib.c ( #1597 )
...
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
2024-04-15 10:02:27 +03:00
emma-coronado
c6e8f17541
Edit logo path to match new website directory
2024-04-08 07:08:49 +02:00
Liu Dongmiao
39073df831
evutil: don't call memset before memcpy
...
In `evutil_parse_sockaddr_port`, it would `memset` the `out` to zero,
however, the `memset` is unnecessary before `memcpy`, and may cause
undefined behavior if the `outlen` is invalid.
This should close #1573 .
2024-03-31 18:32:36 +02:00
neil
4fd07f0ee8
Upgrade vmactions to use linux runners ( #1570 )
...
Co-authored-by: neil <neilgit@neilpang.com>
2024-03-12 21:56:35 +01:00
Azat Khuzhin
539f73e319
Fix leak in evbuffer_add_file() on empty files
...
Found by oss-fuzz, after coverage had been improved in google/oss-fuzz#11257
v2: adjust test
v3: fix for windows (_get_osfhandle() crashes when called on closed fd)
v4: fix for EVENT__DISABLE_MM_REPLACEMENT
2024-03-12 09:29:47 +01:00
Azat Khuzhin
b9e1fe74e7
ci: disable netbsd and freebsd due to lack of runners
...
For example for openbsd-cmake-job (7.2, NONE)
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.
And maybe this will fix the macos builds.
2024-03-11 21:00:18 +01:00
Andy Pan
0054b9aadb
Enable the full TCP KeepAlive mechanism on Windows ( #1568 )
...
#1532 implemented the full support of TCP Keep-Alives on UNIX-like OS's while leaving a `TODO` for Windows. This PR intends to resolve that `TODO`.
## References
- [SIO_KEEPALIVE_VALS Control Code](https://learn.microsoft.com/en-us/windows/win32/winsock/sio-keepalive-vals )
- [IPPROTO_TCP socket options](https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options )
- [TCP_KEEPINVTL and TCP_KEEPIDLE - Socket Keep Alives not working](https://cygwin.com/pipermail/cygwin/2020-June/245436.html )
- [Cygwin: tcp: Support TCP_KEEPIDLE, TCP_KEEPCNT, TCP_KEEPINTVL](https://sourceware.org/pipermail/cygwin-cvs/2020q3/014473.html )
- [Add cross-platform support for keep-alive socket options](https://github.com/dotnet/corefx/pull/29963/files )
2024-03-11 10:12:14 +01:00
tgolang
9c8860ec6c
chore: remove repetitive words
...
Signed-off-by: tgolang <seekseat@aliyun.com>
2024-03-11 09:18:25 +01:00
Andy Pan
e66df92cfc
Accept SOCK_NONBLOCK/SOCK_CLOEXEC in type argument of socketpair ( #1567 )
...
Setting `SOCK_NONBLOCK` and `SOCK_CLOEXEC` in the `type` argument of `socketpair()` is widely supported across UNIX-like OS: Linux, *BSD, Solaris, etc., as is the `socket()`. This will conserve several extra system calls, we should use it where available.
### References
- [socketpair(2) on Linux](https://man7.org/linux/man-pages/man2/socketpair.2.html#HISTORY )
- [socketpair(2) on FreeBSD](https://man.freebsd.org/cgi/man.cgi?query=socketpair&sektion=2#DESCRIPTION )
- [socketpair(2) on DragonFly](https://man.dragonflybsd.org/?command=socketpair§ion=2 )
- [socketpair(2) on NetBSD](https://man.netbsd.org/socketpair.2#DESCRIPTION )
- [socketpair(2) on OpenBSD](https://man.openbsd.org/socketpair.2 )
- [socketpair(3C) on Solaris](https://docs.oracle.com/cd/E88353_01/html/E37843/socketpair-3c.html )
Changelog:
- Set SOCK_NONBLOCK and SOCK_CLOEXEC in the type argument of socketpair
- Avoid EPROTOTYPE on macOS and OpenBSD
- Eliminate the warnings about unused variables
- Add some comments
2024-03-07 09:19:11 +01:00
Azat Khuzhin
f2b3ce6b55
Merge pull request #1558 from azat/ratelimit-fixes
...
Fix few issues found by oss-fuzz in bufferevent ratelimits
2024-03-03 23:10:48 +01:00
Azat Khuzhin
e4b8732701
Fix integer-overflow in ev_token_bucket_cfg_new
...
Found by oss-fuzz, after coverage had been improved in https://github.com/google/oss-fuzz/pull/11257
v2: better check (found by CI for windows)
2024-03-03 16:25:08 +01:00
Azat Khuzhin
15e643d0ca
Fix pread detection for cmake builds
...
Otherwise it will use lseek()+read() - suboptimal
2024-03-03 16:04:56 +01:00
Andy Pan
921097477e
Simplify TCP_KEEPALIVE_ABORT_THRESHOLD settings on Solaris
2024-03-03 13:57:38 +01:00
Azat Khuzhin
c4fb0f7603
Fix divide-by-zero in ev_token_bucket_get_tick_
...
Found by oss-fuzz, after coverage had been improved in https://github.com/google/oss-fuzz/pull/11257
2024-02-20 08:58:04 +01:00
Azat Khuzhin
ec8d7a5a7b
ci: fix ABI check ( #1510 )
2024-02-20 08:54:14 +01:00
Pierce Lopez
7eddd5262a
Patch abi-compliance-checker to avoid endless loop
2024-02-20 08:25:09 +01:00
Pierce Lopez
798547ac20
Force abi-check to use DWARF 3
2024-02-20 08:13:04 +01:00
Azat Khuzhin
e486962561
Fix abi_check.sh by excluding .abi-check from cp
...
cp: cannot copy a directory, './.abi-check', into itself, '/le/src/.abi-check/work/abi-check/src/libevent/current/.abi-check'
2024-02-20 08:13:04 +01:00
Azat Khuzhin
5bdfab7679
Debug abi check
2024-02-20 07:53:18 +01:00
Azat Khuzhin
f37c667cba
Add ABI check without deploy for PRs
2024-02-20 07:53:18 +01:00
Azat Khuzhin
551df0b2f1
ci: try to fix ABI check by using newer version of ubuntu
...
Looks like after upgrading ubuntu from 18.04 (that has 1.9 version of
lvc abi tools) to 20.04 (that has 1.11) the abi-check started to
timeout (works longer then 6 hours, while usually few minutes, and
sometimes even faster was enough).
Unlikely upgrading ubuntu will help, since 22.04 and 20.04 has the same
version, but still, let's try.
Refs: #1463
2024-02-20 07:50:35 +01:00
Azat Khuzhin
0dbd3eb3c9
tests: add test for EV_SIGNAL with timeout
...
Refs: https://github.com/libevent/libevent-book/issues/12
2024-02-19 22:07:32 +01:00
Azat Khuzhin
5cec3417bf
Make Infer static analyzer happy ( #1554 )
2024-02-19 08:21:11 +01:00
Ramon Ortega de Voor
ed35b30feb
Fix two compiler errors for unused variable and undefined function
...
In buffer.c a variable "flags" and a label "done" are defined but
never used if "EVENT__HAVEMMAP" is not defined.
The code does not work on platforms which do not provide
the function `socketpair()`. Introduce EVENT__HAVE_SOCKETPAIR flag
which determines if `socketpair()` or `evutil_ersatz_socketpair()`
is used.
2024-02-19 08:19:24 +01:00
Azat Khuzhin
95ed33e37a
Follow up for HTTP chunk size check ( #1552 )
2024-02-18 22:08:54 +01:00
Azat Khuzhin
f9939490eb
Fix leak in evconnlistener_new_async()
...
Fixes: https://github.com/libevent/libevent/issues/414
2024-02-18 22:07:22 +01:00
Azat Khuzhin
317911a1a0
Fix util/monotonic_prc_fallback under FreeBSD
...
Looks like there was garbage, since evutil_configure_monotonic_time_()
does not reset evutil_monotonic_timer structure, while in case of
fallback it uses two fields from it:
- last_time
- adjust_monotonic_clock
Fixes: https://github.com/libevent/libevent/issues/1495
2024-02-18 20:40:53 +01:00
Azat Khuzhin
3cf996f0ed
evutil: add a comment why no NULL check in evutil_inet_pton_scope()
2024-02-18 19:53:58 +01:00
Azat Khuzhin
5412b2c30d
bufferevent_ssl: fix freeing ctx in case of error in bufferevent_ssl_new_impl
2024-02-18 19:51:21 +01:00
Azat Khuzhin
c9793baa87
bufferevent_ssl: proper NULL checks
2024-02-18 19:49:44 +01:00
Azat Khuzhin
6e4ea6c3f1
evthread: fix NULL dereference in evthread_setup_global_lock_()
2024-02-18 19:49:44 +01:00
Azat Khuzhin
2f27523e44
bufferevent_ssl: do not return NULL from upcast
...
/src/le/libevent/bufferevent_ssl.c:863: error: Null Dereference
pointer `bev_ssl` last assigned on line 855 could be null and is dereferenced at line 863, column 6.
861. r2 = start_writing(bev_ssl);
862.
863. if (bev_ssl->underlying) {
^
864. if (events & EV_READ)
865. BEV_RESET_GENERIC_READ_TIMEOUT(bev);
2024-02-18 19:49:44 +01:00
Azat Khuzhin
5303493670
bufferevent_filter: do not allow upcast() to return NULL (fixes infer warning)
...
/src/le/libevent/bufferevent_filter.c:234: error: Null Dereference
pointer `bevf` last assigned on line 231 could be null and is dereferenced at line 234, column 6.
232. EVUTIL_ASSERT(bevf);
233.
234. if (bevf->bev.options & BEV_OPT_CLOSE_ON_FREE) {
^
235. /* Yes, there is also a decref in bufferevent_decref_.
236. * That decref corresponds to the incref when we set
2024-02-18 19:49:44 +01:00
Azat Khuzhin
d9b5fe318a
evrpc: proper NULL checks (API function return value added)
...
Note, that in order to do this evrpc_hook_add_meta() should have return
value, so this is a minor ABI change, which should not affect C ABI, but
still worth to mention.
Anyway this will be done in 2.2 release and unlikely RPC subsystem is
popular.
2024-02-18 19:48:55 +01:00
Azat Khuzhin
05ed7c8c7e
bufferevent_pair: fix infer warnings due to upcast() return NULL
...
The only user that is care about this is bufferevent_pair_get_partner(),
so let's move the check there.
2024-02-18 19:48:22 +01:00
Azat Khuzhin
8feed7f165
http: forbid chunks size with 0X prefix
...
Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
2024-02-18 19:26:47 +01:00
Azat Khuzhin
87cdcc1868
http: change error for corrupted requests to 400 Bad Request
...
Previously it was 413 Request Entity Too Large, which was odd.
2024-02-18 17:02:45 +01:00