18 Commits

Author SHA1 Message Date
Dan Rosen
2f184f8bbf evwatch: Add "prepare" and "check" watchers.
Adds two new callbacks: "prepare" watchers, which fire immediately
before we poll for I/O, and "check" watchers, which fire immediately
after we finish polling and before we process events. This allows other
event loops to be embedded into libevent's, and enables certain
performance monitoring.

Closes: #710
2019-04-03 12:44:50 -04:00
Azat Khuzhin
2ae875ed12
Link test/regress with event_core/event_extra over event
Due to regress linked with event and event_core (both of them includes
evthread.c) there will be two different evthread_id_fn_ variables under
mingw64:
  evthread_id_fn_: &0x5294f20a8
  evthread_id_fn_: &0x4ba0030a8

And because of this evthread_use_pthreads() can/will set one copy of
variables while evthread*() functions will access another, which will
break a lot of things (for example main/del_notify test).

Fixes: #792
2019-03-25 09:54:32 +03:00
Ondřej Kuzník
cf7f5b0dc4 Fix tests with detached builds
Closes: #524
2017-07-16 21:35:05 +03:00
Azat Khuzhin
8d89c21258 Add missing print-winsock-errors.c into dist archive
Refs: #497
2017-05-01 21:55:00 +03:00
Azat Khuzhin
ea1d30cac4 test: register different tests in automake
Before this patch we have one test.sh (well test-script.sh), and tooks
very long to run it sequentially, but they are pretty lightweight, so we
should run then in parallel.
2017-01-22 03:22:07 +03:00
Azat Khuzhin
bb09535bda autoconf: fix --disable-thread-support build under win32
Fixes: https://ci.appveyor.com/project/azat/libevent/build/job/gvud4tcqsd5bnarl
Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.6.80/job/5frnb1c3n4quxxqy
Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.6.80/job/3wdahbrew7setmoa
2016-08-09 15:47:58 +03:00
Nick Mathewson
239d8345be Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES
Patch from Harlan Stenn.
2014-03-06 10:18:09 -05:00
Diego Giagio
b1b69ac7c1 Implemented EV_CLOSED event for epoll backend (EPOLLRDHUP).
- Added new EV_CLOSED event - detects premature connection close
  by clients without the necessity of reading all the pending
  data. Does not depend on EV_READ and/or EV_WRITE.

- Added new EV_FEATURE_EARLY_CLOSED feature for epoll.
  Must be supported for listening to EV_CLOSED event.

- Added new regression test: test-closed.c

- All regression tests passed (test/regress and test/test.sh)

- strace output of test-closed using EV_CLOSED:
    socketpair(PF_LOCAL, SOCK_STREAM, 0, [6, 7]) = 0
    sendto(6, "test string\0", 12, 0, NULL, 0) = 12
    shutdown(6, SHUT_WR)                    = 0
    epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
    epoll_wait(3, {{EPOLLRDHUP, {u32=7, u64=7}}}, 32, 3000) = 1
    epoll_ctl(3, EPOLL_CTL_MOD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
    fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...})
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYM...
    write(1, "closed_cb: detected connection close "..., 45) = 45
2014-01-17 23:20:42 -02:00
Ross Lagerwall
243386ccc2 rpcgen: Generate regress.gen.[c,h] in build rather than src dir
Currently an out-of-tree build will either write to the src dir or reuse
the existing regress.gen.[c,h].  But if building from a read-only git
tree (or if the git dir is cleaned), these files will not exist and the
build fails.  So write the files to the build dir.  If the system does
not have python, the regress.gen.[c,h] will be used from the src dir if
they exist.
2013-09-15 21:48:15 +02:00
Nick Mathewson
8eedeabe50 Implement event_finalize() and related functions to avoid certain deadlocks 2013-04-26 12:18:07 -04:00
Nick Mathewson
f935e2159a build test/test-script.sh on systems with a less-featureful $< 2013-03-15 09:33:28 -04:00
Nick Mathewson
787fd7489f Make --disable-libevent-regress work again 2013-03-15 09:33:13 -04:00
Nick Mathewson
2863c83700 Avoid using $(top_srcdir) in TESTS.
Newer automakes don't like this.
2013-02-08 22:10:05 -05:00
Nick Mathewson
1d9d5110a4 Use the same CFLAGS for openssl when building unit tests as with libevent 2012-11-15 11:41:36 -05:00
Nick Mathewson
1e3123dae1 Fix handling of no-python case for nonrecursive make 2012-08-28 16:15:14 -04:00
Nick Mathewson
607a8ff9df Be quiet when making regress.gen.[ch] 2012-08-28 16:14:38 -04:00
Nick Mathewson
371a1237d0 Make quiet build even quieter 2012-08-28 16:07:56 -04:00
Nick Mathewson
6cdfeebebc Rename subordinate Makefile.ams to include.am 2012-08-28 16:01:14 -04:00