include

Branch


Log

Author Commit Date CI Message
Kirill Rd 98b7ca30 2024-11-02T21:39:57 http: allow passing in pre-existing connection bev (#1722) This patch adds functionality to pass a pre-existing connection as a bufferevent to `evhttp_connection_base_bufferevent_reuse_new`. When the bufferevent has an existing fd, the evcon starts in state `EVCON_IDLE` so that requests can be made immediately. Signed-off-by: Kirill Rodriguez <theoden8@tutamail.com> Signed-off-by: Kirill Rodriguez <theoden8@tutamail.com> Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com> Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Kirill Rodriguez e219dd4a 2024-11-02T00:53:31 return EAI_ADDRFAMILY instead of NULL (propagate to caller) Signed-off-by: Kirill Rodriguez <theoden8@gmail.com>
Kirill Rodriguez a92ce7e1 2024-10-29T11:26:35 moved EVHTTP_ flags to http.c
Kirill Rd e30b215f 2024-10-24T06:28:53 Add caching for evdns (#1717) No evdns will do caching by default (with respect to TTL), to disable this set EVDNS_BASE_NO_CACHE There are also helpers for manually manage the cache: - evdns_cache_write() - evdns_cache_lookup() Initial PR: #571 Fixes: #1715 Co-authored-by: Greg Hazel <ghazel@gmail.com> Co-authored-by: Keith Moore <kmoore@clostra.com>
James 267e808e 2024-10-23T21:54:31 Updated documentation for bufferevent_setcb() (#1733) Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Wu, Zhenyu 8f1e4bd9 2024-09-29T03:49:15 fix typo: bufferevent_set_callbacks should be bufferevent_setcb
Orian bb0d473b 2024-09-10T21:53:27 Add small note to event_active() documentation
icy17 0499c517 2024-08-05T05:23:43 Document non-NULL parameters in public API (#1705)
Andy Pan 96c259f1 2024-06-26T12:10:00 tcpkeepalive: distinguish OS versions and use proper time units (#1669) DragonFly BSD changed the time unit for TCP keep-alive from milliseconds to seconds since v5.8 and Solaris 11.4 added `TCP_KEEPIDLE`, `TCP_KEEPINTVL`, and `TCP_KEEPCNT` with time units in second while Solaris <11.4 still use `TCP_KEEPALIVE_THRESHOLD` and `TCP_KEEPALIVE_ABORT_THRESHOLD` with time units in millisecond. Currently, we don't differentiate among DragonFly BSD versions but set the keepalive options with seconds, which will result in unexpected behaviors on DragonFlyBSD <5.8. This PR intends to fix the wrong usage of time units of TCP keepalive options on DragonFly BSD <5.8 and consolidate the logic of time units conversion for TCP keepalive across platforms. In addition, this PR introduces a new custom macro for determining Solaris 11.4. This macro is expected to help us implement some new features for `libuv` using some abilities that only exist on Solaris 11.4 and other mainstream platforms in the future, considering that Oracle developed and released Solaris 11.4 to replenish plenty of features on Solaris that have already been implemented on other UNIX-like OSs but missing from Solaris <11.4, also bring a good deal of new features. ### References - [Change tcp keepalive options from ms to seconds (DISRUPTIVE)](https://lists.dragonflybsd.org/pipermail/commits/2019-July/719125.html) - [DragonFly BSD 5.8 release notes](https://www.dragonflybsd.org/release58/) - [DragonFly TCP](https://man.dragonflybsd.org/?command=tcp&section=4) - [Solaris 11.3 TCP](https://docs.oracle.com/cd/E86824_01/html/E54777/tcp-7p.html) - [Solaris 11.4 TCP](https://docs.oracle.com/cd/E88353_01/html/E37851/tcp-4p.html) - [Solaris 11.4 release notes](https://docs.oracle.com/cd/E37838_01/html/E60973/) Signed-off-by: Andy Pan <i@andypan.me>
Andy Pan 832f5269 2024-05-17T16:54:22 aix: enable SO_REUSEPORT on AIX AIX 7.2.5 added the feature that would add the capability to distribute incoming connections across all listening ports. https://www.ibm.com/support/pages/how-get-better-listening-performance-multiple-listening-sockets-using-same-port-number-soreuseport --------- Signed-off-by: Andy Pan <i@andypan.me>
Cœur eec47a67 2024-04-30T15:59:58 Fix typos (#1634)
Andy Pan cbbf209c 2024-04-29T13:31:34 Support SO_REUSEPORT on FreeBSD, DragonFly and Solaris (#1624) ## References - [The SO_REUSEPORT socket option on Linux](https://lwn.net/Articles/542629/) - [DragonFly Release 3.6](https://www.dragonflybsd.org/release36/) - [FreeBSD 12.0-RELEASE Release Notes](https://www.freebsd.org/releases/12.0R/relnotes/) - [SO_REUSEPORT on Solaris 11.4](https://docs.oracle.com/cd/E88353_01/html/E37843/setsockopt-3c.html) Co-authored-by: Azat Khuzhin <azat@libevent.org>
Cœur 73c0349e 2024-04-29T13:16:58 Fix evutil_parse_sockaddr_port documentation (#1628) In some IDE like Xcode, the list is interpreted as markdown instead of plain text
Azat Khuzhin 539f73e3 2024-02-20T09:30:22 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
tgolang 9c8860ec 2024-03-11T15:50:43 chore: remove repetitive words Signed-off-by: tgolang <seekseat@aliyun.com>
Andy Pan e66df92c 2024-03-07T16:19:11 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&section=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
Azat Khuzhin d9b5fe31 2024-02-18T18:03:38 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.
Andy Pan 9d4853b3 2024-01-13T20:51:49 Optimize preprocessor directives on Solaris for evutil_set_tcp_keepalive (#1536) Changes: - Optimize preprocessor directives on Solaris for evutil_set_tcp_keepalive - Reduce the amount of code being compiled and trim trailing whitespace in passing. - Move comments for Solaris under its macro - Refactor the control flow
Andy Pan 7658b788 2024-01-06T00:52:43 Implement full support of TCP Keep-Alives across most Unix-like OS's (#1532) Default settings of TCP keep-alive are not always feasible, take Linux for example, the duration a connection needs to be idle before sending out the first keep-alive probe is two hours, which makes detecting dead connections extremely deferred. Thus, enabling TCP keep-alive will be to little avail. This sets TCP_KEEPIDLE, TCP_KEEPINTVL, and TCP_KEEPCNT when enabling TCP keep-alive mechanism to make it practicable.
Faraz Vahedi 7f5b8f19 2023-11-18T15:55:14 Fix documentation inconsistency in evhttp callbacks This commit addresses a minor inconsistency identified in the documentation of multiple `evhttp` callback functions within the `event2/http.h` header file. It was observed that the word "additional" was presumably missing in the description of the `arg` parameter for several functions. This oversight led to an incorrect phrasing: "an context argument for the callback." The documentation for the following functions has been updated to rectify this issue: - `evhttp_set_gencb` - `evhttp_set_bevcb` - `evhttp_set_newreqcb` - `evhttp_set_errorcb` This commit solely improves the readability of the function descriptions without altering any functional aspects of the code.
Azat Khuzhin c2a935b5 2023-09-22T09:34:59 Add a comment for evbuffer_ref_cleanup_cb
MBeanwenshengming 648ec50e 2023-09-21T15:13:31 Add function evbuffer_add_reference_with_offset() This is the same as evbuffer_add_reference(), but allows to specify offset in the @data v2: rename evbuffer_add_reference_misalign() to evbuffer_add_reference_with_offset()
Dmitry Ilyin f39ad1c4 2023-08-31T22:38:41 ws: replace evws_send with evws_send_text/evws_send_binary (ABI breakage) (#1500) Replace evws_send with evws_send_text, and introduce new API - evws_send_binary, that can be used to send binary frames. But note, that this commit breaks the ABI compatibility, but it should be OK, since there was only alpha release with evws_send, and nobody should rely on this, and I hope nobody does (we decided to go this way to avoid supporting deprecated API).
Azat Khuzhin 57d9eec6 2023-07-10T10:40:49 Disable signalfd by default signalfd may behave differently to sigaction/signal, so to avoid breaking libevent users (like [1], [2]) disable it by default. [1]: https://github.com/tmux/tmux/pull/3621 [2]: https://github.com/tmux/tmux/pull/3626 Also signalfd is not that perfect: - you need to SIG_BLOCK the signal before - blocked signals are not reset on exec - blocked signals are allowed to coalesce - so in case of multiple signals sent you may get the signal only once (ok for most of the signals, but may be a problem for SIGCHLD, though you may call waitpid() in a loop or use pidfd) - and also one implementation problem - sigprocmask is unspecified in a multithreaded process Refs: - https://lwn.net/Articles/415684/ - https://ldpreload.com/blog/signalfd-is-useless Refs: https://github.com/libevent/libevent/issues/1460 Refs: #1342 (cc @dmantipov)
Q_uan 57bb630c 2023-06-20T13:49:37 Add __cplusplus in ws.h to fix compilation errors when using c++ compiler
Kurt Roeckx 4e6375e8 2023-03-05T16:56:56 Always have evutil_secure_rng_add_bytes available (#1427) When libevent doesn't provide random the arc4 function, but they come from libc, there is no need to call this function, so make it do nothing. Fixes: #1393
Edoardo Lolletti f9134df7 2023-02-04T15:00:48 Add LEV_OPT_BIND_IPV4_AND_IPV6 flag (#1400) Libevent introduced the LEV_OPT_BIND_IPV6ONLY to pass to evconnlistener_new_bind to make it automatically set the underlying socket as accepting ipv6 requests. This works fine on posix compliant platforms as by the standard every new AF_INET6 socket is created as both supporting ipv6 and ipv4 connections. But on windows the default is the opposite, with the flag IPV6_V6ONLY being always enabled by default. This makes creating a listener to supports both protocols a bit more tricky as winsock doesn't allow changing this flag after evconnlistener_new_bind does all the initial setup because as stated in the docs, you can't change it after the sonnect connected, so one would have to manually create the socket beforehand and set the flag and then call evconnlistener_new with the socket itself. It would be nice to have libevent keep a consistent behaviour across the platforms in this scenario, maybe or by making it always set IPV6_V6ONLY to false unless LEV_OPT_BIND_IPV6ONLY is passed, in which case it's set to true, or add another flag to forcefully set it to false and keep the system dependent behaviour as default. So this patch add new option for libevent listeners to bind to both - LEV_OPT_BIND_IPV4_AND_IPV6
Daniel Kempenich a7fffb5c 2023-01-17T23:02:56 Replace magic numbers with consts for evdns_base_resolv_conf_parse() errors
Dmitry Antipov 1af745d0 2022-10-25T11:30:34 signal: new signal handling backend based on signalfd Linux-specific signal handling backend based on signalfd(2) system call, and public function event_base_get_signal_method() to obtain an underlying kernel signal handling mechanism. Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Dmitry Ilyin c2ecb4ac 2022-10-12T14:13:44 Add locks for server WS, fixes #1357
Dmitry Ilyin 88317a4e 2022-10-04T17:49:22 Add helpers and all regress tests are passed
Dmitry Ilyin e8313084 2022-09-12T22:16:56 Add minimal WebSocket server implementation for evhttp (#1322) This adds few functions to use evhttp-based webserver to handle incoming WebSockets connections. We've tried to use both libevent and libwebsockets in our application, but found that we need to have different ports at the same time to handle standard HTTP and WebSockets traffic. This change can help to stick only with libevent library. Implementation was inspired by modified Libevent source code in ipush project [1]. [1]: https://github.com/sqfasd/ipush/tree/master/deps/libevent-2.0.21-stable Also, WebSocket-based chat server was added as a sample.
Leon M. George 1bdc9135 2022-08-01T10:16:18 http: allow setting bevcb per socket Co-authored-by: Azat Khuzhin <azat@libevent.org> v2: remove handling of HTTP_BIND_IPV6
Dmitry Ilyin 05a03d4a 2022-08-06T14:23:53 Add more HTTP_ response codes
Azat Khuzhin 48727342 2022-07-10T16:18:08 Add a note that IOCP is experimental feature Refs: #1228
cui fliter 1c204d55 2022-06-13T04:58:50 Fix some typos (#1284) Signed-off-by: cuishuang <imcusg@gmail.com>
zhongzedu 5cc2ff88 2022-05-09T16:33:36 fix grammar in comment
Syedh30 e339880f 2022-04-29T19:40:29 include/event.h: include <event2/util.h> over deprecatd <evutil.h> Fixes: #1263
Jay Freeman (saurik) 3da71856 2022-02-12T22:53:11 Fix build w/o OpenSSL by w/ MbedTLS In 78fa3971be892194aa168c04fc34bf5f2cd99b99 from https://github.com/libevent/libevent/pull/1241#commitcomment-63865496 a new "if MBEDTLS" block was added to include/include.am. This is not parsed by automake as it isn't on the first column, resulting in a subsequent error in the build. From [1]: > The if, else, and endif statements should not be indented, i.e., start on column one. [1]: https://www.gnu.org/software/automake/manual/html_node/Usage-of-Conditionals.html Fixes: #1251 Fixes: google/oss-fuzz#7149
Dmitry Ilyin 78fa3971 2022-01-15T08:30:26 Fix make install failed when Automake used and both OpenSSL and MbedTLS are activated Issue: https://github.com/libevent/libevent/pull/1241#commitcomment-63865496
Dmitry Ilyin 2db55e43 2021-12-15T21:27:21 Install bufferevent_ssl.h with MbedTLS support also
Yongsheng Xu cd6a41ec 2021-12-10T11:05:13 feat: add `evdns_base_get_nameserver_fd` method To get underlying udp socket fd.
Azat Khuzhin 0c217f4f 2021-11-22T00:05:27 Fix comment for evdns_base_new()
Yong Wu 68675d5f 2021-09-12T18:03:03 doc: adjust flags notice on event_base_loop()
Sean Young f446229b 2016-01-31T11:31:00 http: support unix domain sockets There are no standard for encoding a unix socket in an url. nginx uses: http://unix:/path/to/unix/socket:/httppath The second colon is needed to delimit where the unix path ends and where the rest of the url continues. Signed-off-by: Sean Young <sean@mess.org>
Sergey Matveychuk 19b3fd0b 2021-04-07T20:39:18 evdns: add ability to get CNAME Add new flag (DNS_CNAME_CALLBACK) for evdns_base_resolve_ipv4()/evdns_base_resolve_ipv6(). If set, you will get one more callback with type == DNS_CNAME and CNAME in addrs argument.
Azat Khuzhin 8e03f495 2021-04-03T12:50:53 Merge #1152 -- remove no op evdns functions * upstream/pr/1152: dns: remove evdns_set_transaction_id_fn dns: remove evdns_set_random_bytes_fn
fanquake 01beec2f 2021-04-03T12:55:32 dns: remove evdns_set_transaction_id_fn
fanquake 39d68053 2021-04-03T12:55:11 dns: remove evdns_set_random_bytes_fn
Emil Engler 0ef0d947 2021-04-02T20:59:55 doc: adjust edge-trigger notice on event_new() This makes it easier to read and to understand it in my opinon. It also fixes a missing "-" character.
fanquake 4c29b01c 2021-03-28T10:57:11 build: remove splice implementation fragments Looks like a `splice` implementation was planned, but has clearly never eventuated (the TODO comment is from ~12 years ago, in 8b5bd77415fb6634fadf08357676926fecf5f032). For now, it's probably better to remove the unused code/correct the docs.
Azat Khuzhin aea752b6 2021-03-23T09:00:24 bufferevent: introduce bufferevent_replacefd() (like setfd() but also close fd)
lilei bc25889f 2021-02-03T14:19:57 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
chux0519 617ba838 2021-01-09T17:19:27 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.
Azat Khuzhin 8d21ddcf 2020-11-01T00:59:16 Fix bufferevent_ssl_*flags() w/ disabled OpenSSL but enabled mbedTLS
Azat Khuzhin a490172d 2020-10-31T22:53:31 Introduce new BUFFEREVENT_SSL_BATCH_WRITE flag to avoid Nagle effect in SSL
Azat Khuzhin 7e0fc878 2020-10-31T21:45:22 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()
Azat Khuzhin afa66ea4 2019-09-04T00:56:20 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
Azat Khuzhin e91c4363 2020-10-27T01:40:34 http: add EVHTTP_URI_HOST_STRIP_BRACKETS Refs: #1115
Leon M. George a18301a2 2020-09-08T15:38:16 http: const out address param to evcon_get_peer
Azat Khuzhin 972289f3 2020-08-29T01:15:20 Detect existence of pthread_mutexattr_setprotocol() Fixes: #1084
Gerry Garvey eb7bed03 2020-08-01T16:10:48 Convert from WinCrypt to Windows BCrypt Fixes: #1069
okhowang(王沛文) 028385f6 2020-05-28T17:14:46 fix build system and add test and cleanup code
Jesse Fang b28effa9 2020-01-13T23:04:29 mbedtls based SSL implementation prototype is libevent-2.1.11-stable libevent_openssl.c
fanquake 79dc8789 2020-07-20T21:59:10 doc: fix typo in thread.h s/evthred_use_pthreads_with_flags/evthread_use_pthreads_with_flags/
seleznevae 83c58d49 2020-05-31T19:59:49 evdns: Add support for setting maximum UDP DNS message size. Added new option `edns-udp-size` for evdns_base which allows to control maximum allowed size of UDP DNS messages. This maximum size is passed to the DNS server via edns mechanism.
Azat Khuzhin 7426a568 2020-05-25T11:25:18 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
ayuseleznev 0f6ee89a 2020-05-21T12:46:20 evdns: Implement dns requests via tcp
Azat Khuzhin 9a9b92ed 2020-03-01T16:01:12 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).
Azat Khuzhin 5a5fe67e 2020-03-01T13:52:32 Fix typo in thread.h (s/event/evthread)
yangyongsheng 08e7d513 2020-01-28T14:31:39 misspelling of output in bufferevent_struct.h
nntrab 02905413 2016-02-09T18:01:00 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)
Andre Pereira Azevedo Pinto f76456b0 2019-12-04T17:56:54 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>
Philip Homburg 9fecb59a 2019-10-29T15:48:53 Parse IPv6 scope IDs.
yuangongji 5aae74d7 2019-09-21T23:37:38 improve the description of parameter to evbuffer_read()
yuangongji 620a3fa1 2019-08-29T19:40:10 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
Azat Khuzhin bdcade47 2019-07-31T10:34:38 buffer: fix possible NULL dereference in evbuffer_setcb() on ENOMEM [ @azat: - add return heredoc for evbuffer_setcb() - add unit test with event_set_mem_functions() - look through the report from abi-compliance-checker/abi-dumper ] Closes: #855
Azat Khuzhin 5388a002 2019-06-26T09:36:49 autotools: do not install bufferevent_ssl.h under --disable-openssl Refs: https://github.com/libevent/libevent/issues/760#issuecomment-502345788
Azat Khuzhin 538141eb 2019-06-15T23:18:05 evdns: add new options -- so-rcvbuf/so-sndbuf This will allow to customize SO_RCVBUF/SO_SNDBUF for nameservers in this evdns_base, you may want to adjust them if the kernel starts dropping udp packages.
yuangongji c03dabd7 2019-05-31T02:12:55 typo error in header file
Joseph Spadavecchia 5e137f37 2014-12-08T17:32:07 Implement bufferevent_socket_connect_hostname_hints() So that ai_flags (such as AI_ADDRCONFIG) can be specified. Closes: #193 (cherry-picked with conflicts resolved)
Tobias Stoeckmann 176fd566 2019-04-16T21:12:21 Protect min_heap_push_ against integer overflow. Converting unsigned to size_t for size of memory objects allows proper handling of very large heaps on 64 bit systems. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Closes: #799 (cherry-picked)
Thomas Bernard 8dcb94a4 2016-01-08T13:36:20 Added http method extending User can define his own response method by calling evhttp_set_ext_method_cmp() on the struct http, or evhttp_connection_set_ext_method_cmp() on the connection. We expose a new stucture `evhttp_ext_method` which is passed to the callback if it's set. So any field can be modified, with some exceptions (in evhttp_method_): If the cmp function is set, it has the ability to modify method, and flags. Other fields will be ignored. Flags returned are OR'd with the current flags. Based on changes to the #282 from: Mark Ellzey <socket@gmail.com>
Thomas Bernard 96e56beb 2019-04-02T15:43:35 http: Update allowed_methods field from 16 to 32bits.
Azat Khuzhin 55f9863b 2019-04-04T09:09:09 Remove experimental note for finalizers API
Dan Rosen 2f184f8b 2019-03-26T13:33:57 evwatch: Add "prepare" and "check" watchers. Adds two new callbacks: "prepare" watchers, which fire immediately before we poll for I/O, and "check" watchers, which fire immediately after we finish polling and before we process events. This allows other event loops to be embedded into libevent's, and enables certain performance monitoring. Closes: #710
Azat Khuzhin e5b8f4c1 2019-04-01T01:47:00 evdns: add DNS_OPTION_NAMESERVERS_NO_DEFAULT/EVDNS_BASE_NAMESERVERS_NO_DEFAULT - DNS_OPTION_NAMESERVERS_NO_DEFAULT Do not "default" nameserver (i.e. "127.0.0.1:53") if there is no nameservers in resolv.conf, (iff DNS_OPTION_NAMESERVERS is set) - EVDNS_BASE_NAMESERVERS_NO_DEFAULT If EVDNS_BASE_INITIALIZE_NAMESERVERS isset, do not add default nameserver if there are no nameservers in resolv.conf (just set DNS_OPTION_NAMESERVERS_NO_DEFAULT internally) Fixes: #569
Azat Khuzhin 3e0dc1a6 2019-04-01T01:40:18 evdns: add descriptions for DNS_OPTION_*/DNS_OPTIONS_ALL
Azat Khuzhin 5357c3d6 2019-03-16T17:32:17 Adjust evbuffer max read for bufferevents
Azat Khuzhin 8c2001e9 2019-03-16T17:09:51 Maximum evbuffer read configuration Before this patch evbuffer always reads 4K at a time, while this is fine most of time you can find an example when this will decrease throughput. So add an API to change default limit: - evbuffer_set_max_read() - evbuffer_get_max_read() And a notice that most of time default is sane.
Alexander Drozdov 68eb526d 2019-03-13T10:51:55 http: add WebDAV methods support WebDAV introduced new HTTP methods (RFC4918): PROPFIND, PROPPATCH, MKCOL, LOCK, UNLOCK, COPY, MOVE. Add support of the methods.
Azat Khuzhin 5ee507c8 2019-03-04T06:53:42 http: implement separate timeouts for read/write/connect phase This patch allows to change timeout for next events read/write/connect separatelly, using new API: - client: evhttp_connection_set_connect_timeout_tv() -- for connect evhttp_connection_set_read_timeout_tv() -- for read evhttp_connection_set_write_timeout_tv() -- for write - server: evhttp_set_read_timeout_tv() -- for read evhttp_set_write_timeout_tv() -- for write It also changes a logic a little, before there was next fallbacks which does not handled in new API: - HTTP_CONNECT_TIMEOUT - HTTP_WRITE_TIMEOUT - HTTP_READ_TIMEOUT And introduce another internal flag (EVHTTP_CON_TIMEOUT_ADJUSTED) that will be used in evrpc, which adjust evhttp_connection timeout only if it is not default. Fixes: #692 Fixes: #715
John Ohl 62df1301 2014-12-09T21:43:18 Add support for EV_TIMEOUT to event_base_active_by_fd Closes: #194 (cherry-pick)
Enji Cooper 5f87be42 2019-02-25T11:59:15 Define `_GNU_SOURCE` properly/consistently per autoconf Although `_GNU_SOURCE` can be defined as an arbitrary #define per the glibc docs [1], it's best to define it in a manner consistent with the way that autoconf defines it, i.e., `1`. While this shouldn't matter in most cases, it does when the headers from other projects follow the poorly defined GNU convention implemented by autoconf and are included after the libevent's util.h header. An example failure with clang, similar to the failure I encountered, is as follows: ``` $ printf "#define _GNU_SOURCE\n#define _GNU_SOURCE 1" | clang -c -x c - <stdin>:2:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined] ^ <stdin>:1:9: note: previous definition is here ^ 1 warning generated. ``` This happened when compiling python [2] with a stale homebrew util.h file from libevent (which admittedly would not happen in a correct libevent install, as the header should be installed under /usr/local/include/event2/util.h). However, if both headers had been combined (which is more likely), it would have failed as shown above. Removing the ad hoc definition unbreaks compiling python's pyconfig.h.in header when included after util.h from libevent. 1. http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html 2. https://github.com/python/cpython/blob/master/configure.ac#L126 Closes: #773 (cherry-picked) Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Azat Khuzhin b29207dc 2019-01-29T21:12:33 Eliminate fd conversion warnings and introduce EVUTIL_INVALID_SOCKET (windows) windows has intptr_t instead of regular int. Also tt_fd_op() had been introduced, since we cannot use tt_int_op() for comparing fd, since it is not always int.
Azat Khuzhin 99b231b0 2019-01-11T21:52:11 rpc: use *_new_with_arg() to match function prototype In 755fbf16c ("Add void* arguments to request_new and reply_new evrpc hooks") this new functions had been introduced, but newer used, what for? So let's use them.
Azat Khuzhin 9cba915e 2018-10-28T19:30:34 Introduce EVENT_VISIBILITY_WANT_DLLIMPORT And use it in places where event_debug() should be called (since it requires access to "event_debug_logging_mask_" and in win32 it is tricky). One of this places that is covered by this patch is the test for event_debug().
Azat Khuzhin 23e79fd7 2018-10-28T18:11:22 Check existence of IPV6_V6ONLY in evutil_make_listen_socket_ipv6only() (mingw32) MinGW 32-bit 5.3.0 does not defines it and our appveyour [1] build reports this instantly: evutil.c: In function 'evutil_make_listen_socket_ipv6only': evutil.c:392:40: error: 'IPV6_V6ONLY' undeclared (first use in this function) return setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (void*) &one, [1]: https://www.appveyor.com/docs/windows-images-software/#mingw-msys-cygwin Another solution will be to use mingw64 which has it, but I guess we do want that #ifdef anyway.
Azat Khuzhin 26ef859a 2018-10-27T17:21:35 Add evhttp_parse_query_str_flags() And a set of flags: - EVHTTP_URI_QUERY_LAST - EVHTTP_URI_QUERY_NONCONFORMANT Fixes: #15
Murat Demirten 387d91f9 2018-06-04T16:43:34 listener: ipv6only socket bind support According to RFC3493 and most Linux distributions, default value is to work in IPv4-mapped mode. If there is a requirement to bind same port on same ip addresses but different handlers for both IPv4 and IPv6, it is required to set IPV6_V6ONLY socket option to be sure that the code works as expected without affected by bindv6only sysctl setting in system. See an example working with this patch: https://gist.github.com/demirten/023008a63cd966e48b0ebcf9af7fc113 Closes: #640 (cherry-pick)