24 Commits

Author SHA1 Message Date
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
0fd0255fa4 Remove compat/sys/_time.h
I've gone through everything that it declared to see where it was used,
and it seems that we probably don't need it anywhere.

Here's what it declared, and why I think we're okay dropping it.

o struct timeval {}
  (Used all over, and we can't really get away with declaring it ourselves;
  we need the same definition the system uses.  If we can't find struct
  timeval, we're pretty much sunk.)

o struct timespec {}
  (Used in event.c, evdns.c, kqueue.c, evport.c.  Of these,
   kqueue.c and event.c include sys/_time.h.  event.c conditions its use on
   _EVENT_HAVE_CLOCK_GETTIME, and kqueue() only works if timespec is defined.)

o TIMEVAL_TO_TIMESPEC
  (Used in kqueue.c, but every place with kqueue has sys/time.h)

o struct timezone {}
  (event2/util.h has a forward declaration; only evutil.c references it and
   doesn't look at its contents.)

o timerclear, timerisset, timercmp, timeradd, timersub
  (Everything now uses the evutil_timer* variants.)

o ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF, struct itemerval
  (These are only used in test/regress.c, which does not include _time.h)

o CLOCK_REALTIME
  (Only used in evdns.c, which does not include _time.h)

o TIMESPEC_TO_TIMEVAL
o DST_*
o timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub
o struct clockinfo {}
o CLOCK_VIRTUAL, CLOCK_PROF
o TIMER_RELTIME, TIMER_ABSTIME
  (unused)

svn:r1494
2009-11-03 19:54:56 +00:00
Nick Mathewson
a2a7d1d123 Do not call the locking variant of event_add or event_active in some cases when we know we have the lock.
svn:r1471
2009-10-27 05:16:32 +00:00
Nick Mathewson
2e36dbe1a6 Use EVUTIL_ASSERT() consistently instead of assert.
svn:r1464
2009-10-26 20:00:43 +00:00
Nick Mathewson
f3dee9e8be Correct the signatures for the evmap_io_* functions to use evutil_socket_t.
svn:r1446
2009-10-16 13:20:09 +00:00
Nick Mathewson
ba8a17714e Do not notify the main thread more than needed.
Basically, we suppress the notification when an event is added or deleted
and:
  - The event has no fd, or there is no change in whether we are
    reading/writing on the event's fd.
  - The event has no timeout, or adding the event did not make the earliest
    timeout become earlier.

This should be a big efficiency win in applications with multiple threads and
lots of timeouts.

svn:r1439
2009-10-02 03:03:58 +00:00
Nick Mathewson
c2ead9f173 Treat events with fd == -1 as addable.
This turns out to simplify a fair bit of logic, including the bufferevent
code, and should fix bug 2850656.

svn:r1431
2009-09-11 21:02:19 +00:00
Nick Mathewson
5b5b880be7 Various MSVC cleanups from Brodie Thiesfield.
svn:r1385
2009-07-28 19:41:39 +00:00
Nick Mathewson
64a37e61a1 Fix evmap indentation to be less stupid.
svn:r1185
2009-04-17 06:56:36 +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
Niels Provos
0e779906f9 fix memleak in evmap_signal_clear; from Alexander Drozdov
svn:r1049
2009-01-26 06:13:24 +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
ad7f1b4ae9 The element size for our linear evmaps is a pointer, not the whole struct.
svn:r1006
2009-01-14 18:45:42 +00:00
Nick Mathewson
6bb2f84216 Add initializer functions for evmap types.
svn:r1005
2009-01-14 18:38:03 +00:00
Nick Mathewson
9935d5b01e Fix win32 compilation. Surprisingly, unit tests pass too.
svn:r1002
2009-01-13 21:39: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
Nick Mathewson
91e3ead85e Improve the hashsocket function.
svn:r989
2009-01-10 14:37:45 +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
Nick Mathewson
8f5777e692 Document internal evmap functions, add a couple of asserts, and fix up some things that did not need to be void* any more
svn:r987
2009-01-09 05:01:48 +00:00
Niels Provos
172b657567 malloc fd only if it is needed.
svn:r982
2009-01-02 18:18:30 +00:00
Niels Provos
30cba6d0b3 we cannot realloc memory used by TAILQ; instead malloc each slot individually
svn:r977
2008-12-25 09:22:13 +00:00
Niels Provos
b55ca7de1c reduce void *age a little bit
svn:r975
2008-12-23 22:31:27 +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