57 Commits

Author SHA1 Message Date
Nick Mathewson
e5bbd40ad7 Clean up formatting: use tabs, not 8-spaces, to indent. 2010-02-18 17:44:09 -05:00
Nick Mathewson
a19b4a05e6 Call event_debug_unassign on internal events
I don't expect that many users will be so religious about calling
unassign, but we need to be so that it's at least possible to use
debug mode without eating memory.
2010-01-25 13:53:17 -05:00
Jardel Weyrich
d0939d2b97 Introduced evutil_make_socket_closeonexec() to preserve fd flags for F_SETFD.
Use this to eliminate the various macros that called F_SETFD throughout
the code.
2009-12-29 15:12:56 -05:00
Nick Mathewson
e1ffbb82e3 Fix memory-leak of signal handler array with kqueue.
It turns out that kqueue_dealloc wasn't calling evsig_dealloc()
(because it doesn't use the main signal handler logic) so the sh_old
array was leaking.

This patch also introduces a fix in evsig_dealloc() where we set
the sh_old array to NULL when we free it, so that main/fork can pass.
2009-11-21 23:57:44 -05:00
Nick Mathewson
784b8773a4 We do not work any more without an event-config.h; stop pretending that it is meaningful to check for HAVE_CONFIG_H
svn:r1516
2009-11-06 21:46:57 +00:00
Nick Mathewson
2e36dbe1a6 Use EVUTIL_ASSERT() consistently instead of assert.
svn:r1464
2009-10-26 20:00:43 +00:00
Nick Mathewson
0b22ca1929 Use ev_ssize_t in place of ssize_t *everywhere*.
svn:r1309
2009-05-22 19:11:48 +00:00
Nick Mathewson
7a844735d5 Fix some small win32 build issues on trunk.
svn:r1306
2009-05-22 17:20:05 +00:00
Nick Mathewson
8c66eb2e9b Try to contain the failure when we are running without socketpair().
Some win32 systems (mostly those using Kaspersky, it would seem)
prevent us from faking socketpair().  This makes our signal
notification code just not work.  Our response since 1.4 has been to
assert.  For users who would rather work without signals than not work
at all, this has been a regression from 1.3e.

This patch makes adding signal events fail in this case; there's no
reason to kill the whole process.

svn:r1303
2009-05-22 14:48:40 +00:00
Nick Mathewson
d3fbe7fa05 Do not free the signal index unless it was at some point allocated
svn:r1217
2009-04-21 18:47:53 +00:00
Nick Mathewson
b85b710cf5 Update copyright statements to reflect the facts that:
a) this is 2009
b) niels and nick have been comaintainers for a while
c) saying "all rights reserved" when you then go on to explicitly
   disclaim some rights is sheer cargo-cultism.

svn:r1065
2009-01-27 22:34:36 +00:00
Nick Mathewson
8889a77039 Replace all use of config.h with event-config.h.
svn:r1064
2009-01-27 22:30:46 +00:00
Nick Mathewson
9993137cbb Remove all trailing whitespace in all the source files.
svn:r1063
2009-01-27 21:10:31 +00:00
Niels Provos
fe72c885d9 fix signal processing for non-kqueue backends; when a signal callback delivers a signal; from Alexander Drozdov
svn:r1035
2009-01-22 06:23:14 +00:00
Niels Provos
ed7e0e77ed bug fix and potentital race condition from Alexander Drozdov
svn:r1025
2009-01-19 23:40:11 +00:00
Nick Mathewson
554e14934e Move per-fd info from eventops into evmap. Not done for win32.c yet.
svn:r1008
2009-01-14 20:52:32 +00:00
Nick Mathewson
169321c9e6 Rename four internal headers to follow the -internal.h convention.
svn:r1000
2009-01-13 20:26:37 +00:00
Niels Provos
8a72441077 make it compile with USE_DEBUG again; reported by Alexander Drozdov
svn:r990
2009-01-12 05:22:29 +00:00
Niels Provos
d776f8462b deprecate the usage of signal_{add,del,set} and name it evsignal_{add,del,set} instead; move the old definitions to compat
svn:r973
2008-12-23 22:23:37 +00:00
Niels Provos
02b2b4d1be Restructure the event backends so that they do not need to keep track of events themselves, as a side effect multiple events can use the same fd or signal.
svn:r972
2008-12-23 16:37:01 +00:00
Nick Mathewson
fded0a8783 Fix compilation of recent error code with win32.
svn:r937
2008-09-05 16:47:04 +00:00
Nick Mathewson
de069b9977 On win32, errno is not the last socket error. Worse, WSAGetLastError() is not the last socket error sometimes (i.e., EWOULDBLOCK). Also, strerror() does not handle winsock errors. Therefore, event_err() and event_warn() are completely wrong for windows socket errors. Fix that.
svn:r936
2008-09-05 16:29:56 +00:00
Niels Provos
e67a5ea9bb fix a problem with epoll and event_reinit; reported by Alexander Drozdov
svn:r917
2008-07-25 00:19:15 +00:00
Niels Provos
1c164cebb8 restore signal handlers correctly when we deallocate the signal base
svn:r913
2008-07-19 23:35:29 +00:00
Niels Provos
4bf44654a6 assert(a & b) -> assert(a && b)
svn:r903
2008-07-11 16:04:07 +00:00
Niels Provos
f7e61870e9 support multiple events listening on the same signal; make signals regular events that go on the same event queue
svn:r901
2008-07-11 15:49:04 +00:00
Nick Mathewson
7868ab5a43 r19667@catbus: nickm | 2008-05-08 23:49:26 -0400
fwd-port: Always include winsock2.h before windows.h.  Apparently some SDKs need this.


svn:r803
2008-05-09 04:00:17 +00:00
Niels Provos
8c750eaff8 separate signal events from io events
svn:r760
2008-05-03 21:37:33 +00:00
Nick Mathewson
5fbc7f0aee r15439@tombo: nickm | 2008-05-02 12:28:08 -0400
use event_assign internall; switch uses of event_set to use event_assign instead.


svn:r755
2008-05-02 16:28:25 +00:00
Nick Mathewson
49868b618a r15316@tombo: nickm | 2008-04-24 20:58:36 -0400
Rename internal memory management functions from event_malloc() etc to mm_malloc() etc.


svn:r725
2008-04-25 01:18:08 +00:00
Nick Mathewson
0ac73078ed r15193@tombo: nickm | 2008-04-16 16:00:35 -0400
Split event.h into several new headers in include/event2.  event.h is now just a wrapper that includes all the subheaders.


svn:r711
2008-04-16 20:01:51 +00:00
Nick Mathewson
3206bbca46 r15171@tombo: nickm | 2007-12-06 12:47:47 -0500
Use GCC attributes (where available) to verify printf type-correctness.  Fix some bugs this turned up.


svn:r573
2007-12-06 18:12:56 +00:00
Nick Mathewson
1120f04f3e r16731@catbus: nickm | 2007-11-25 16:52:53 -0500
Replace all fds on non-unix-specific APIs with evutil_socket_t, which is int on unix and intptr_t on win32.


svn:r552
2007-11-25 21:53:06 +00:00
Nick Mathewson
ab010e161f r14952@tombo: nickm | 2007-11-25 14:47:45 -0500
Fix an unused variable warning.


svn:r549
2007-11-25 21:32:15 +00:00
Nick Mathewson
fa95fe469a r16704@catbus: nickm | 2007-11-19 15:58:54 -0500
Check return value of event_add in signal.c


svn:r546
2007-11-25 21:28:43 +00:00
Nick Mathewson
2823cb0579 r14944@tombo: nickm | 2007-11-25 12:12:28 -0500
Make kqueue pass more unit tests.


svn:r544
2007-11-25 17:15:28 +00:00
Nick Mathewson
7eb250e9c5 r14939@tombo: nickm | 2007-11-25 11:59:26 -0500
New function event_set_mem_functions to replace internal calls to malloc, free, etc with a user-supplied functions.


svn:r541
2007-11-25 17:14:19 +00:00
Niels Provos
56934d5d97 debug cleanups in signal.c; from Christopher Layne
svn:r527
2007-11-13 17:36:58 +00:00
Nick Mathewson
321dfd55d4 r16585@catbus: nickm | 2007-11-10 00:16:11 -0500
Patch from Christopher Layne: Make event_del() restore previous signal handlers, not the default.


svn:r506
2007-11-10 05:18:17 +00:00
Nick Mathewson
4e1ec3e05e Make all the C files in the libraries compile under MSVC 2005 Express. There are still a few warnings, and probably some subtle issues, but it's better than nothing.
svn:r499
2007-11-07 21:01:26 +00:00
Niels Provos
2026b21598 remove last vestiges of RBTREE
svn:r470
2007-11-03 23:53:49 +00:00
Nick Mathewson
f0e06d75e5 r15217@catbus: nickm | 2007-09-20 14:04:32 -0400
Fix win32 signals: teach win32 that we have per-base signal queues; teach signal.c that not everybody has sigaction().


svn:r442
2007-09-20 18:26:46 +00:00
Niels Provos
41b7cbc381 more the signal base into the event base; this removes global state and makes signals
work better with threading; from Wouter Wijngaards
small fixes for kqueue and style by me


svn:r351
2007-03-10 06:37:53 +00:00
Niels Provos
b5d2f9a255 rolling back r339: evconfig.h does not work
svn:r341
2007-03-01 06:25:18 +00:00
Niels Provos
8d94bd03eb signal fixes from scott lamb
svn:r340
2007-02-28 04:29:18 +00:00
Niels Provos
127c260bb7 make evconfig.h available as installed header file; not
really ideal but good enough for me; from Nick Mathewson


svn:r339
2007-02-28 04:02:29 +00:00
Niels Provos
1d308e8813 mostly whitespace fixes from OpenBSD via Brad
svn:r192
2005-12-17 20:25:22 +00:00
Niels Provos
68292e2f45 signal handler satefy improvements from Theo DeRaadt
svn:r186
2005-12-03 17:52:47 +00:00
Niels Provos
32bed8f9b6 build fixes from nick mathewson
svn:r139
2005-04-01 04:20:39 +00:00
Niels Provos
fbdaf3ab62 debugging callbacks from Nick Mathewson <nickm@freehaven.net>
svn:r136
2005-03-29 07:03:10 +00:00