Age | Commit message (Collapse) | Author |
|
|
|
dropping the empty RETURN VALUES section
and adding the missing "#include <stdilib.h>" below EXAMPLES.
|
|
rename the "ev" argument to "event" to make some text read better,
and get rid of colons at the ends of list tags.
OK jmc@ and Ted Bullock.
|
|
While here, also correct the HISTORY section.
OK jmc@
|
|
OK jmc@
|
|
|
|
feedback and OK jmc@ and Ted Bullock
|
|
to start working on it in the tree.
|
|
More details on RETURN VALUES and ERRORS.
Document all DIAGNOSTICS messages except the various malloc(3)-related
ones and except those that cannot actually occur but would merely report
violations of internal invariants. Shorten some wordings in this section.
Using feedback from jmc@ and Ted Bullock.
OK jmc@ and nicm@ on an earlier version.
|
|
|
|
OK jmc@ and Ted Bullock
|
|
Clarify that the variables only affect the event_base structure currently
being created. They do not disable "library support" as a whole.
Sort the variables alphabetically.
OK jmc@ and Ted Bullock
|
|
1. The values of #define'd constants are part of the ABI, but not of the API.
Programmers need not worry about them and must not rely on them.
Consequently, do not list these values in the SYNOPSIS.
2. libevent can be used for any event loop, not only for the main loop
of a program.
3. No need to state numbers of arguments, they are obvious from the SYNOPSIS.
4. If a function is documented to require a pointer to a specific kind of
object as an argument, there is no need to say passing NULL is undefined.
OK jmc@ and Ted Bullock
|
|
in one place, not in two places, reducing duplication of text.
Joint work with Ted Bullock. OK jmc@.
|
|
providing more information and in a more systematic way
than the current event(3) manual page.
Not yet linked to the tree.
Using input from nicm@ and jmc@.
|
|
1. The function event_base_free(3) does reset the global variable
to the initial state when needed.
2. The CAVEATS section got the issue backwards: multiple threads
per base cause trouble, whereas multiples bases per thread do not.
While here, also avoid the plural when talking about the global
variable used by event_init(3): there is only one.
Using input from jmc@ and from Ted Bullock.
|
|
written by Ted Bullock <tbullock at comlore dot com>
in order to polish it in the tree.
Not yet linked to the build.
In particular, this documents the so far undocumented functions
event_base_new(3) and event_reinit(3) and provides lots of new
information regarding event_init(3) and event_base_free(3).
Also using input from nicm@, jmc@, and myself, OK nicm@ jmc@.
|
|
ok nicm
|
|
jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.
ok jmc@
|
|
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.
|
|
While at it: KNF and switch from reallocarray to recallocarray.
ok tedu
|
|
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
|
|
ok nicm@ tobias@ cheloha@
|
|
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@
|
|
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
|
|
|
|
|
|
some tweaks.
With feedback and ok jmc@
|
|
ok jmc@, benno@, "yes" deraadt@
|
|
found with regress/usr.bin/mandoc/db/dbm_dump;
OK jmc@
|
|
this has no effect except to make ktrace output prettier.
ok bluhm mpi
|
|
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@
|
|
the string buffer.
ok jsing millert
|
|
OK bluhm@ nicm@
|
|
Avoids inconsistent capitalization of libevent at start of sentence
suggested by and ok jmc@, ok bluhm@
|
|
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
|
|
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@
|
|
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
|
|
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
|
|
|
|
or otherwise change Dt to reflect the name of an existing function;
feedback/ok schwarze
|
|
|
|
|
|
argument names, from Fabian Raetz. ok deraadt
|
|
|
|
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@
|
|
- 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@
|
|
- Defensive programming to prevent (hopefully impossible) stack-stomping
OK nicm@
|
|
- 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
|
|
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
|