357 Commits

Author SHA1 Message Date
Nick Mathewson
37bc34662b Catch attempts to event_base_once a persistent event.
svn:r1250
2009-04-29 20:48:28 +00:00
Nick Mathewson
9ad45eef75 Patch from Eric Hopper: the test for EVENT_BASE_FLAG_IGNORE_ENV was inverted.
svn:r1248
2009-04-28 19:08:36 +00:00
Nick Mathewson
2ebfd3bafd Oops. We never actually defined event_config_set_flag().
svn:r1246
2009-04-28 19:08:17 +00:00
Nick Mathewson
faa756c7c1 Oops. event_config.flags was never initialized. Bugfix on 2.0.1-alpha. Found by Victor Goya.
svn:r1236
2009-04-23 21:34:37 +00:00
Nick Mathewson
253151c54c Detect and reject n_priorities less than 1.
svn:r1222
2009-04-22 20:28:30 +00:00
Nick Mathewson
11ff74cf64 Add a flag to disable checking the EVENT_* environment variables.
svn:r1220
2009-04-22 19:41:23 +00:00
Nick Mathewson
d047b323bd Increment version to 2.0.1-alpha, and add a numeric version facility
svn:r1193
2009-04-17 17:22:32 +00:00
Nick Mathewson
7fa8451d7e Add a configure flag to hardcode all of our mm functions.
svn:r1186
2009-04-17 06:56:57 +00:00
Nick Mathewson
fe95df15d3 Fix typo in mm_free
svn:r1173
2009-04-13 18:32:24 +00:00
Nick Mathewson
8161662007 A couple of tweaks for deferred callbacks.
svn:r1151
2009-04-10 14:58:15 +00:00
Nick Mathewson
4868f4d217 Initial support for a lightweight 'deferred callbacks'.
A 'deferred callback' is just a function that we've queued in the
event base.  This ability is needed for some mt stuff, and for complex
callback chains.  For internal use only.

svn:r1150
2009-04-10 14:22:33 +00:00
Nick Mathewson
e3d82497c9 Don't allow internal events to starve lower-priority events.
This is exceptionally important with multithreaded stuff, where we use
an event to notify the base that other events have been made active.
If the activated events have a prioirty number greater than that of the
notification event, it will starve them, and that's no good.

svn:r1149
2009-04-10 14:21:53 +00:00
Nick Mathewson
f98385a407 add a missing "static" to timeout_process.
svn:r1145
2009-04-08 16:57:38 +00:00
Nick Mathewson
ec35eb5520 Make threading functions global, like the mm_ functions. Use the libevent_pthread.la library in regress_pthread.
svn:r1121
2009-02-12 22:19:54 +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
1c927b7d2f fix memory leak whens etting up priorities; reported by Alexander Drozdov
svn:r1061
2009-01-27 16:29:48 +00:00
Nick Mathewson
f20902a290 Remove evperiodic_assign and its related parts: its functionality is subsumed by EV_PERSIST timeouts.
svn:r1040
2009-01-22 17:56:15 +00:00
Nick Mathewson
5e6f6dcd1b Use EV_PERSIST on notify event for efficiency and simplicity.
svn:r1039
2009-01-22 17:48:55 +00:00
Niels Provos
56ea4687a5 Change the semantics of timeouts in conjunction with EV_PERSIST; timeouts in that case will now repeat until deleted.
svn:r1032
2009-01-22 02:33:38 +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
a5901991c7 Use eventfd for main-thread notification where available (i.e., linux).
svn:r1023
2009-01-19 20:37:24 +00:00
Nick Mathewson
c3e9fcf672 Change the semantics of notify so we can implement it with eventfd or (given a different backend for win32) a windows Event.
svn:r1022
2009-01-19 20:22:47 +00:00
Nick Mathewson
34d2fd0634 Debug and enable pipe notification
svn:r1021
2009-01-19 19:46:03 +00:00
Nick Mathewson
ec4cfa33c9 Make event_break threadsafe; make notify-thread mechanism a little more generic; let it use pipes where they work.
svn:r1019
2009-01-19 01:34:14 +00:00
Nick Mathewson
6bb2f84216 Add initializer functions for evmap types.
svn:r1005
2009-01-14 18:38:03 +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
Nick Mathewson
55bcd7d2f0 On win32, use a hashtable to map sockets to events rather than using an array.
svn:r988
2009-01-09 13:42:21 +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
Niels Provos
77867244a9 memory leak: forgot to free the configuration object
svn:r961
2008-12-19 21:02:36 +00:00
Niels Provos
808f00e1a1 constify structs; from Andrei Nigmatulin
svn:r959
2008-12-13 06:11:12 +00:00
Niels Provos
4fa4a56253 fix a typo in setting the global event base; reported by lance
svn:r953
2008-11-27 19:57:48 +00:00
Niels Provos
4fe25cefb5 Clear the timer cache when leaving the event loop; reported by Robin Haberkorn
svn:r950
2008-11-27 19:27:33 +00:00
Niels Provos
31cfe52662 clear the timer cache on entering event loop; reported by Victor Chang
svn:r944
2008-10-30 19:38:31 +00:00
Nick Mathewson
c97ee898dc Fix: do not crash when asked to configure an impossible event_base
svn:r942
2008-09-26 13:36:15 +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
cca2f8fa0e make event_add not change any state if it fails; repoted by Ian Bell
svn:r923
2008-07-25 01:29:54 +00:00
Niels Provos
3b24f4eedc another fix; we also need to remove the signal event from the queue
svn:r918
2008-07-25 00:48:30 +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
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
Niels Provos
60e4c0674a add an event_debug statement for executing active events.
svn:r865
2008-06-24 22:41:43 +00:00
Niels Provos
35b1236c84 change write to send for windows.
svn:r859
2008-06-24 15:29:41 +00:00
Nick Mathewson
05965921ab Add new functions to access backends by their features and to query the features of a backend.
svn:r842
2008-05-31 14:37:31 +00:00
Niels Provos
2deb3ce061 simplify handling of environment variables for disabling backends;
make event_get_supported_methods obey environment variables; this
fixes make verify; problem reported by Scott Lamb.


svn:r838
2008-05-29 01:39:43 +00:00
Niels Provos
8b66f1bd4d constify struct timeval *
svn:r836
2008-05-17 02:14:17 +00:00
Niels Provos
134344b79e Fix use of freed memory in event_reinit; pointed out by Peter Postma
svn:r834
2008-05-16 01:55:40 +00:00
Nick Mathewson
a68de2525d r19749@catbus: nickm | 2008-05-14 23:48:44 -0400
New function to dump inserted and active events.  Also do not recv() on an int array.


svn:r829
2008-05-15 03:49:03 +00:00
Niels Provos
f9b4ee0aa4 replace write/read/close with send/recv/EVUTIL_CLOSESOCKET
svn:r828
2008-05-15 03:19:05 +00:00