summaryrefslogtreecommitdiffstats
path: root/lib/libevent (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-2/+2
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Fixed integer overflow with an excessively large amount of events.tobias2019-05-081-10/+15
| | | | | | While at it: KNF and switch from reallocarray to recallocarray. ok tedu
* Fixed endless loop/ OOB write on 64 bit systems with large buffers.tobias2019-05-031-3/+3
| | | | | | | | | | | If a buffer exceeds UINT_MAX (which is only possible on 64 bit systems) an endless loop or OOB write can occur in buffer-specific readline functions. Switching variables in function scope to size_t solves these issue because relevant fields in struct buffer are already size_t. ok cheloha, deraadt, nicm, tedu
* Tweaks previous: gettime() can be void, use TIMESPEC_TO_TIMEVALjca2019-05-011-9/+5
| | | | ok nicm@ tobias@ cheloha@
* Require clock_gettime(CLOCK_MONOTONIC) and remove fallback codejca2019-05-011-66/+8
| | | | | | | | | If clock_gettime(CLOCK_MONOTONIC) fails here, something is really wrong. Lots of userland already require it anyway. Removing the fallback code means less code, less global state and less fiddling with the timeheap internals. ok nicm@ tedu@ tobias@ cheloha@
* Switched min_heap to size_t to prevent integer overflows.tobias2019-04-293-27/+28
| | | | | | | | | | Also, as deraadt suggested, switched realloc to recallocarray to at least prevent uninitialized memory to be used as pointers in case of other programming errors. A proper solution (not using an array) needs more work. This change occured in sync with upstream libevent 2.2. with input by and ok bluhm, jca, tedu
* knf, ok bluhmtedu2019-04-201-98/+125
|
* unfold some compound operations to make this easier to followtedu2019-04-181-6/+11
|
* Document bufferevent_setwatermark(). Initial diff from Geoff Hill on tech@ withanton2018-09-231-2/+30
| | | | | | some tweaks. With feedback and ok jmc@
* Mention some missing libevent macros.rob2018-07-262-6/+31
| | | | ok jmc@, benno@, "yes" deraadt@
* add missing and correct misspelled names, most in NAME sections;schwarze2017-08-011-3/+4
| | | | | found with regress/usr.bin/mandoc/db/dbm_dump; OK jmc@
* if there are no changes for kevent, pass in NULL instead.tedu2017-07-101-2/+2
| | | | | this has no effect except to make ktrace output prettier. ok bluhm mpi
* take const off the timeval argument in the pending functions.dlg2017-06-291-5/+5
| | | | | | | | event_pending, evtimer_pending, and signal_pending all write to the timeval because that's how they tell the caller when the event is meant to fire. ok deraadt@ millert@ jmc@ schwarze@
* Use recallocarray() to avoid leaving detritus in memory when resizingderaadt2017-03-181-2/+3
| | | | | the string buffer. ok jsing millert
* Remove NULL pointer checks before calls to free().nayden2016-09-034-30/+17
| | | | OK bluhm@ nicm@
* Talk about event API instead of libeventstefan2016-07-171-6/+8
| | | | | Avoids inconsistent capitalization of libevent at start of sentence suggested by and ok jmc@, ok bluhm@
* for some time now mandoc has not required MLINKS to functionjmc2016-03-301-56/+1
| | | | | | | | | | | | correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
* Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])krw2016-03-201-2/+2
| | | | | | | | | | idioms. Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0) where it is obvious further investigation will not yield and even better way. Obviousness evaluation and ok guenther@
* revert change to call kevent immediately.tedu2015-12-251-6/+65
| | | | | | | | | tcpbench (at a minimum) relies on the old behavior of changes all happening after all event handlers run. in particular, it resets the event for the listening socket *before* calling accept(), when it is still readable. kevent then (correctly) says it is readable on the next go through the loop. silly, subtle, and stupid. problem reported by kettenis
* change the kqueue backend to call kevent() as events are added insteadtedu2015-12-161-65/+6
| | | | | | | | | | | | of deferring until the dispatch loop. kqueue support for various types of files and filesystems has been historically incomplete, and kevent handles this condition by returning an error. the libevent dispatch loop has no way to recover from this error and fails catastrophically, bringing down the entire process because one file went bad. now, instead of all that happending, event_add will return an error. the application can choose to handle or ignore this error, but at least the band will play on. ok nicm
* Libraries should not print to stderr, ok tedu beck deraadtnicm2015-12-111-22/+1
|
* update NAME section to include all documented functions,jmc2015-11-101-3/+3
| | | | | | or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
* Another couple of commas in the wrong place, ok jmcnicm2015-04-141-2/+2
|
* Remove an extra comma pointed out by jmc@.nicm2015-04-141-2/+2
|
* Reorder prototypes to better match manpage layout and add some missingnicm2015-04-142-74/+74
| | | | argument names, from Fabian Raetz. ok deraadt
* Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@millert2015-02-051-2/+2
|
* Backout revision 1.37. Setting ev->ev_pncalls to NULL results inbluhm2015-01-061-5/+2
| | | | | | | a use after free if the callback has freed the ev. With F in malloc.conf both tmux and the regression tests triggered a segmentation fault. OK nicm@
* Apply commit e0e6958aa074a7714cd7c4aa779a1dfede3a03b1 from upstream.bluhm2015-01-061-14/+8
| | | | | | | | | | - Avoid deadlock when activating signals. Fixes bug 3048812. Based on patch by Nicholas Marriott. The deadlock was ultimately fixed in a different way (by disabling reinit - see event.c r1.25). Add it now for consistency but without the Windows compatibility code. Convert the fnctl() calls to SOCK_CLOEXEC | SOCK_NONBLOCK to simplify the code. OK nicm@
* Apply commit 2d8cf0b720cdd5f9f292f174a10ff74e62a380ec from upstream.bluhm2015-01-061-2/+5
| | | | | - Defensive programming to prevent (hopefully impossible) stack-stomping OK nicm@
* Fix CVE-2014-6272 in Libevent 1.4 from upstream:bluhm2015-01-052-11/+25
| | | | | | | | | | | - https://github.com/libevent/libevent/commit/7b21c4eabf1f3946d3f63cce1319c490caab8ecf - For this fix, we need to make sure that passing too-large inputs to the evbuffer functions can't make us do bad things with the heap. On top of that do: - Update libevent version to 1.4.15-stable. - Use SIZE_MAX from limits.h instead of a private define. - Do not declare 'size_t need' twice to avoid a compiler warning. OK sthen
* libraries shouldnt print to stderr when things dont go their way.dlg2014-11-211-3/+3
| | | | | | | | | switch fprintf(stderr) over to event_warn() on malloc failure. fix up an errant newline in an existing event_warn while there. originally i just wanted to delete the fprintf diff from nicm@ who is away from a keyboard right now so cant commit guenther@ agrees with the idea
* evbuffer_read will return 0 one an end of file condition.dlg2014-11-211-2/+3
|
* zap some stray commas;jmc2014-11-201-3/+3
|
* add evbuffer_expand to NAME;jmc2014-11-201-1/+2
|
* put MLINKS in the order they appear in the man page, so i don;t go blindjmc2014-11-201-32/+32
| | | | trying to check what's missing;
* document the only macro i find useful when working with evbuffers.dlg2014-11-201-1/+10
|
* might help to Xr evbuffer_new 3dlg2014-11-201-2/+3
|
* im not good at grammar things.dlg2014-11-201-2/+2
| | | | from schwarze@
* use .Va to say errno is a variable.dlg2014-11-201-6/+14
| | | | from schwarze@
* fix erroneous capitalisation of a word in the middle of a sentence.dlg2014-11-191-2/+2
| | | | from schwarze again
* less worse escapes for \ from ingo. im sure there's a much nicer way todlg2014-11-191-2/+2
| | | | represent newlines still.
* use .In to specify includes.dlg2014-11-192-5/+5
|
* ingo also points out we're documenting things that work withdlg2014-11-191-2/+2
| | | | evbuffers, not evbufbuffers.
* ingo points outdlg2014-11-191-3/+11
| | | | | | | | | | | | .Fo evbuffer_readln .Fa "struct evbuffer *buf" .Fa "size_t *read_out" .Fa "enum evbuffer_eol_style eol_style" .Fc is more readable mdoc for very long prototypes than lines like .Fn "evbuffer_readln" "struct evbuffer *buf" "size_t *read_out" "enum evbuffer_eol_style eol_style"
* i got sick of having to read the source code to know what thedlg2014-11-193-48/+261
| | | | | | | | | | | | | | | evbuffer_foo functions do. reyk, nicm, jmc, and schwarze seem to support a manpage as a reasonable solution to this problem. im putting this in a separate manpage because i find they get too cumbersome when they get too big. ingo agrees (and suggests even this might be too big). the file is evbuffer_new.3 rather than evbuffer.3 because we document functions. ok reyk@ nicm@ jmc@ schwarze@ this is rough, everyone has tweaks coming.
* BUGS is no longer relevant, according to nicm;jmc2014-11-191-8/+2
|
* Libevent has compatibilty wrappers in evutil. OpenBSD does not usebluhm2014-10-311-3/+6
| | | | | | | | | them anymore, but evutil is still part of libevent's interface. Separate the API of evutil from libevent and do not include evutil.h from event.h automatically. A version bump is not necessary as the library itself does not change. Bulk ports build done by landry@ had no fallout. OK nicm@ deraadt@
* Use CDIAGFLAGS from bsd.own.mk and append additional warning flags.bluhm2014-10-311-11/+10
| | | | | All warnings have been fixed in libevent. OK nicm@
* Fix whitespace errors in libevent.bluhm2014-10-309-63/+63
| | | | OK nicm@
* The fdsz and n_events variables contain unsigned values that arebluhm2014-10-301-6/+6
| | | | | | derived from size_t and passed to functions as size_t parameters. Change them from int to size_t to avoid compiler warnings. OK doug@ nicm@