summaryrefslogtreecommitdiff
path: root/lib/tevent
AgeCommit message (Collapse)AuthorFilesLines
2025-08-07tevent: version 0.17.1tevent-0.17.1Jule Anger2-1/+171
* Coverity checks: Fix 1649525 Use of 32-bit time_t Fix Coverity ID 1649524 Dereference before null check Fix Coverity ID 1649526 Dereference before null check Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2025-06-20tevent: Fix 1649525 Use of 32-bit time_tVolker Lendecke1-1/+1
Coverity ID "1649525 Use of 32-bit time_t" is correct. What Coverity does not see is that this routine is the only one assigning to ev->wait_timeout. Make Coverity happy with the MIN(). Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-20tevent: Fix Coverity ID 1649524 Dereference before null checkVolker Lendecke1-1/+1
The only caller of epoll_event_loop gives a non-NULL pointer. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-20tevent: Fix Coverity ID 1649526 Dereference before null checkVolker Lendecke1-1/+1
The only caller of poll_event_loop_poll gives a non-NULL pointer. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-18tevent: version 0.17.0tevent-0.17.0Stefan Metzmacher3-4/+171
- add tevent_context_set_wait_timeout() - add tevent_reset_immediate() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-06-18tevent: add tevent_reset_immediate()Stefan Metzmacher5-1/+29
This is a much better api than using tevent_schedule_immediate() with a NULL handler, while the tevent_context is still required as argument. Note the tevent-0.16.2.sigs changes will be reverted in the 'tevent 0.17.0' commit. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-06-18tevent: Add tevent_context_set_wait_timeout()Volker Lendecke7-16/+103
Mainly to make tevent_loop_once() return immediately with -1/errno=EAGAIN for polling behaviour. Note the tevent-0.16.2.sigs changes will be reverted in the 'tevent 0.17.0' commit. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-03-27tevent: Fix some whitespaceVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-03-27tevent: Fix some whitespaceVolker Lendecke2-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-02-06tevent: version 0.16.2tevent-0.16.2Jule Anger2-1/+168
* Documentation fixes * Add LGPLv3 LICENSE file Signed-off-by: Jule Anger <janger@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2024-12-12tevent: Add LGPLv3 LICENSE fileAndreas Schneider1-0/+165
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15729 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-06tevent docs: s/the the\b/the/Douglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-01-29tevent: release 0.16.1tevent-0.16.1Jule Anger2-1/+168
- build with Python 3.12 (bug #15513) - documentation fixes BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513 Signed-off-by: Jule Anger <janger@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2023-11-20Use python.h from libreplaceAndreas Schneider1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-25tevent: Fix code spellingJoseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13tevent: version 0.16.0tevent-0.16.0Stefan Metzmacher2-1/+168
- the epoll backend is no longer limited to 2 event handlers per low level fd. - finally add support for TEVENT_FD_ERROR Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Oct 13 10:45:51 UTC 2023 on atb-devel-224
2023-10-13tevent: add support for TEVENT_FD_ERRORStefan Metzmacher6-80/+167
After 12 years we finally got TEVENT_FD_ERROR support :-) TEVENT_FD_WRITE event handlers never get errors reported instead the event handler is silently disabled. There are likely callers relying on that behavior, so we are not able to chance it. Now TEVENT_FD_WRITE can be used together with TEVENT_FD_ERROR in order to get errors reported without waiting for TEVENT_FD_READ. TEVENT_FD_ERROR can also be used alone in order to detect errors on sockets in order to cleanup resources. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-10-13tevent: add test_event_fd3Stefan Metzmacher1-0/+615
The tests the interaction of multiple event handlers on the same low level fd. It shows that poll and epoll backends behave in the same fair way. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-10-13tevent: add test_fd_speed3Stefan Metzmacher1-0/+10
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-10-13tevent: let tevent_epoll.c use new generic mpx infrastructureStefan Metzmacher1-294/+263
This allows any number of event handlers per low level fd. It means the epoll backend behaves like the poll backend now. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-10-13tevent: add tevent_common_fd_mpx infrastructureStefan Metzmacher4-0/+390
Backends may require to map individual tevent_fd instances to a single low level kernel state (e.g. for epoll). This generic infrastructure adds helper functions using a generic (sub)part of struct tevent_fd. The new code will allow us to support more than 2 tevent_fd instances per fd, which makes sure all backends can provide a similar behavior. This will be important when we add TEVENT_FD_ERROR as a 3rd kind of fd event. The aim is to use this in order to replace the limited implementation we already have in tevent_epoll.c. As these helpers are typically called from within 'void tevent_fd_set_flags(struct tevent_fd *fde, uint16_t flags)' there's no way to report errors. So in order avoid additional error handling complexity the helpers try to avoid any allocations which may fail. It also means the logic in tevent_epoll.c doesn't have to change much. These are implemented as static line functions in order to avoid the function call overhead, which showed up in profiles of the early implementation. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-10-13tevent: split out a tevent_common_fd_disarm() helperStefan Metzmacher5-37/+25
It means tevent_trace_fd_callback(TEVENT_EVENT_TRACE_DETACH) is always called and similar future changes are only needed in one place. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-10-13tevent: introduce DLIST_DEMOTE_SHORT()Stefan Metzmacher1-0/+21
It turns out that the overhead of DLIST_DEMOTE() implemented as DLIST_REMOVE();DLIST_ADD_END(), is very high if the list contains only 1 or 2 elements. The next commits will make use of DLIST_DEMOTE_SHORT() for multiplexing multiple tevent_fd structures for a single fd and the most important and common case is a list with just one element. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-09-11tevent: Fix code spellingJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-14tevent: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-08-03lib:tevent: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-07-19tevent: version 0.15.0tevent-0.15.0Stefan Metzmacher3-11/+168
- remove py2 ifdefs - python: Safely clear structure members - the tevent_thread_call_depth API is updated in order to allow better tracing. - add tevent_set_max_debug_level() only and don't pass TEVENT_DEBUG_TRACE to tevent_debug() callbacks by default. - Spelling fixes - Make use of epoll_create1() for epoll backend - Optimize overhead in the epoll backend Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: add tevent_common_fd_str() helperStefan Metzmacher2-0/+24
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: avoid calling epoll_update_event() again if epoll_check_reopen() ↵Stefan Metzmacher1-2/+9
already did it Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: let epoll_check_reopen() clear all events before reopening themStefan Metzmacher1-0/+2
This is clearer for multiplexed fdes as it means both sides are already cleared before we call epoll_update_event() again. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: avoid epoll_check_reopen() overhead unless requiredStefan Metzmacher1-21/+29
The preparation, function call and cleanup for epoll_check_reopen() is quite some overhead and not needed most of the time! So check the pid in the caller avoids most of it. Review with: git show -w Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: make use of TEVENT_DEBUG() when using TEVENT_DEBUG_TRACEStefan Metzmacher5-10/+10
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: add TEVENT_DEBUG() avoid argument overhead when log is not active...Stefan Metzmacher1-0/+7
It can be very costly to calculate the arguments passed to tevent_debug(), just to drop the message within tevent_debug() or the callback function. So we add a way to avoid the overhead, it will be used in the next commits. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: introduce tevent_set_max_debug_level() (default TEVENT_DEBUG_WARNING)Stefan Metzmacher4-1/+55
Allow an application to decide which log levels it wants to get in the callback function passed to tevent_set_debug(). By default TEVENT_DEBUG_WARNING is the maximal reported level and TEVENT_DEBUG_TRACE message no longer reach the callback function by default. It seems Samba is the only consumer of tevent_set_debug(), so it should not be a huge problem, as Samba only reports TEVENT_DEBUG_TRACE message with log level 50 anyway. And future Samba versions will call tevent_set_max_debug_level() if needed. Note the change to tevent-0.14.1.sigs will be reverted with the release of tevent 0.15.0. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: add fd_speed testStefan Metzmacher1-0/+114
This is similar to the "context" test, but without signal handlers. It also creates a constant load instead of being time limited, which makes it useful to analyse using callgrind and other tools. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: Flow: add tevent_thread_call_depth_set_callback()Pavel Filipenský7-19/+136
Note the tevent-0.14.1.sigs changes will be reverted in the 'tevent 0.15.0' commit. Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-19tevent: Flow: store cleanup function name in tevent_reqStefan Metzmacher4-0/+16
Note the tevent-0.14.1.sigs changes will be reverted in the 'tevent 0.15.0' commit. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2023-07-19tevent: Flow: store cancel function name in tevent_reqStefan Metzmacher4-5/+24
Note the tevent-0.14.1.sigs changes will be reverted in the 'tevent 0.15.0' commit. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2023-07-19tevent: Flow: store trigger function name in tevent_queue_entryPavel Filipenský3-4/+86
Note the tevent-0.14.1.sigs changes will be reverted in the 'tevent 0.15.0' commit. Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-19tevent: Flow: store callback function name in tevent_reqPavel Filipenský4-0/+23
Note the tevent-0.14.1.sigs changes will be reverted in the 'tevent 0.15.0' commit. Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-19tevent: Flow: pass function name to tevent_req_create()Pavel Filipenský4-3/+30
Note the tevent-0.14.1.sigs changes will be reverted in the 'tevent 0.15.0' commit. Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-19tevent: Deprecate some tevent_thread_call_depth_*() functionsPavel Filipenský2-32/+6
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-19tevent: Move definition of _DEPRECATED_ to the top of tevent.hPavel Filipenský1-7/+9
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-19tevent: add tevent_dlinklist.h as copy from lib/util/dlinklist.hStefan Metzmacher2-170/+192
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-07-19tevent: rely on epoll_create1() for epoll interfaceDmitry Antipov2-21/+12
Prefer epoll_create1(2) over epoll_create(2) and always require the former to use epoll(7) interface, thus saving extra fcntl(2) call to set FD_CLOEXEC. Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-05-16python: Safely clear structure membersJoseph Sutton1-2/+2
Using Py_CLEAR() ensures that these structures are observed in a consistent state by any Python code that may run during deconstruction. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-04-14lib:tevent: Fix code spellingAndreas Schneider7-13/+13
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-02-03tevent/pytevent: remove no-op defineDouglas Bagnall1-1/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-02-03tevent/pytevent: remove py2 ifdefsDouglas Bagnall1-16/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-02-02tevent: version 0.14.1tevent-0.14.1Stefan Metzmacher2-1/+158
- Build fix for GNU/Hurd - Build fix for Solaris, after removal of ports backend (bug #15298) Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 2 18:27:08 UTC 2023 on atb-devel-224