11 Commits

Author SHA1 Message Date
Nick Mathewson
5e0563ba9a Fix dangling pointer in epoll after epoll_recalc().
This is based on patch 2790759 from Kevin Springborn.  His comments on
sourceforge:

  Problem:
  The failure case is as follows: Event is added using epoll_add (a
  direct pointer is stored in the user_data section), epoll_recalc is
  called and the fds array is moved (invalidating the user_data
  pointer stored in epoll).  epoll_dispatch is called for the added
  event and accesses evepoll based on the invalid pointer (set before
  the fds array was relocated).

  Solution:
  Dispatch has access to the epollop structure, so given the fd we can
  find the corresponding evepoll struct. Use data.fd instead of
  data.ptr and store the fd corresponding to the event. This way when
  epoll_recalc moves the fds array (and updates the fds array pointer
  in epollop), the evepoll calculation in dispatch still finds the
  valid evepoll struct.

svn:r1282
2009-05-12 18:27:45 +00:00
Niels Provos
f06b29b9e2 off-by-one error in epoll_recalc; reported by Victor Goya
svn:r1124
2009-03-12 17:03:21 +00:00
Niels Provos
dfa9cb5d9b from trunk: constify structs; from Andrei Nigmatulin
svn:r960
2008-12-13 06:12:05 +00:00
Nick Mathewson
212523d196 r19310@catbus: nickm | 2008-04-11 16:02:23 -0400
Backport fix for epoll-on-linux bug (#1908866).


svn:r708
2008-04-11 20:02:32 +00:00
Nick Mathewson
bb1dd9e750 r19306@catbus: nickm | 2008-04-10 15:34:27 -0400
Backport fix for bug 1938754: do not warn when epoll_create() fails with ENOSYS.


svn:r707
2008-04-10 19:35:57 +00:00
Niels Provos
9e92909cf0 from trunk: make event methods static so that they are not exported; from Andrei Nigmatulin
svn:r693
2008-03-29 01:47:04 +00:00
Nick Mathewson
bd6fae1de3 r18373@catbus: nickm | 2008-02-23 14:13:06 -0500
add missing "static" to epoll.c


svn:r656
2008-02-23 19:18:39 +00:00
Niels Provos
b23f1dbe96 from trunk: move EV_PERSIST handling out of the event backends
svn:r592
2007-12-14 07:18:02 +00:00
Niels Provos
9a70838936 from trunk: remove obsolete recalc code
svn:r586
2007-12-13 05:58:05 +00:00
Niels Provos
7717cec719 from trunk: provide event_reinit() to reinitialized an event_base after fork - necessary for epoll/kqueue
svn:r557
2007-11-27 06:15:36 +00:00
Niels Provos
6b4342db67 copy trunk to 1.4
svn:r512
2007-11-12 02:37:25 +00:00