3094 Commits

Author SHA1 Message Date
Azat Khuzhin
7e876df71b Fix dns/leak_resume_send_err test.
Because we don't cancel request,
and want our callback to recieve DNS_ERR_SHUTDOWN,
we use deferred callback, and there was
- one extra malloc(),
  @see reply_schedule_callback()
- and one missing free
  @see request_finished() (req->handle->pending_cb = 1)
than we don't need to count in testleak_cleanup()

So just decrement allocated_chunks to 2,
like we already take care about it.
2013-05-13 19:56:00 +00:00
Azat Khuzhin
1cd9ff591d Add tests for evdns_base_resume().
- leak_resume
- leak_cancel_and_resume
- leak_resume_send_err
- leak_cancel_and_resume_send_err
2013-05-13 19:56:00 +00:00
Azat Khuzhin
14971a833c Fix SEGFAULT after evdns_base_resume if no nameservers installed.
If there is no nameservers installed, using
evdns_base_nameserver_ip_add(), than evdns_base_resume() will SEGFAULT,
because of NULL dereference in evdns_requests_pump_waiting_queue()
2013-05-13 19:56:00 +00:00
Nick Mathewson
8ab612e396 Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) 2013-05-11 22:21:30 -04:00
Azat Khuzhin
d3d999a116 Missed lock acquire/release in event_base_cancel_single_callback_()
Call backtrace:
...
event_queue_remove_active()
event_callback_cancel_nolock_()
event_base_cancel_single_callback_()
event_base_free_()
event_base_free()
...

Fix for e9ebef83
2013-05-10 21:40:45 -04:00
Nick Mathewson
5ba8ab76e9 Fix test compilation with nmake: add the gdi.lib dependency
ACK: efekty
2013-05-10 21:38:26 -04:00
Nick Mathewson
ef820dbfb3 Merge remote-tracking branch 'origin/patches-2.0' 2013-05-07 10:03:28 -04:00
Belobrov Andrey
5c710c0362 Checking request nameserver for NULL, before using it. 2013-05-07 10:01:36 -04:00
Nick Mathewson
f8d80a285c Bump version to 2.1.3-alpha-dev 2013-05-01 23:12:08 -04:00
Nick Mathewson
85a40040d1 Add regress_finalize to makefile.nmake release-2.1.3-alpha 2013-05-01 13:37:57 -04:00
Nick Mathewson
57cbfcd67c Set a release date 2013-05-01 10:28:42 -04:00
Nick Mathewson
5bc290e247 Make http/connection_retry off-by-default 2013-05-01 10:04:08 -04:00
Nick Mathewson
f2925d78b6 Fix a windows compilation regression
This is github issue #57; reported by "efekty". I assume the compiler
is MSVC.
2013-04-30 22:57:25 -04:00
Nick Mathewson
9e3a99cad7 Fix a bug in fixing a bug in out-of-tree test-dumpevents 2013-04-30 20:09:52 -04:00
Nick Mathewson
b48c7bf8a6 Make regress_finalize work with malloc replacement disabled 2013-04-30 14:40:50 -04:00
Nick Mathewson
cbfc35f6b9 Fix some out-of-tree build bugs 2013-04-30 14:26:47 -04:00
Nick Mathewson
dd4be76f83 Incremement version to 2.1.3-alpha 2013-04-30 12:02:49 -04:00
Nick Mathewson
c6561efbce Merge remote-tracking branch 'origin/patches-2.0' 2013-04-30 12:02:19 -04:00
Nick Mathewson
d9917c4958 Add acknowledgements to readme 2013-04-30 11:52:55 -04:00
Nick Mathewson
e6cdd17b5d Start editing the changelog for 2.1.3-alpha 2013-04-30 11:44:39 -04:00
Nick Mathewson
8415b69d42 Mark the finalize stuff as experiemental in case it needs to change 2013-04-30 11:44:25 -04:00
Nick Mathewson
959c1428cc Start a changelog for Libevent 2.0.22-stable 2013-04-30 11:42:53 -04:00
Nick Mathewson
920a5e69b0 Clarify an important point about event_base_foreach_event() 2013-04-26 19:15:50 -04:00
Nick Mathewson
702c9aa403 Fix a bug in the new main/event_foreach test
It wasn't making sure that the events weren't internal.
2013-04-26 19:14:05 -04:00
Nick Mathewson
d5967397b0 More unit tests for initializing common timeouts.
Try with: misformed usecs in inputs, and with initializing common timeouts
from other common timeouts.
2013-04-26 17:51:33 -04:00
Nick Mathewson
f09629eac5 A test for event_get_assignment() 2013-04-26 17:46:33 -04:00
Nick Mathewson
30ea2910d5 Unit tests for event_base_gettimeofday_cached() and event_base_update_cache_time() 2013-04-26 17:37:15 -04:00
Nick Mathewson
0b096efee5 New tests for event_base_foreach_event()
Our dump-events code had exercised this a bit, but only via the
nonlocking backend. Also, nothing was checking the "Search for a
specific event" code.
2013-04-26 13:52:51 -04:00
Nick Mathewson
a153874d18 New test for active_later->active transition on event_active
When event_active is called, an active_later event is supposed to become
active now.  We had lacked a test for that.
2013-04-26 13:49:45 -04:00
Nick Mathewson
3555befd1c Merge branch '21_deadlock_fix_v2' 2013-04-26 12:27:05 -04:00
Nick Mathewson
25aac69780 Remove a no-longer-true XXXX comment. 2013-04-26 12:18:38 -04:00
Nick Mathewson
5d11f4f39a Make the event_finalize* functions return an error code 2013-04-26 12:18:38 -04:00
Nick Mathewson
a800b913ac More documentation for finalization feature 2013-04-26 12:18:38 -04:00
Nick Mathewson
4ea4c6a93e Remove bufferevent_del_generic_timeout_cbs as now unused 2013-04-26 12:18:38 -04:00
Nick Mathewson
e9ebef83a0 Always run pending finalizers when event_base_free() is called
There was actually a bug in the original version of this: it tried to
run the finalizers after (potentially) setting current_base to NULL;
but those finalizers could themselves (potentially) be invoking stuff
that needed to know about the current event_base.  So the right time to
do it is _before_ clearing current_base.
2013-04-26 12:18:07 -04:00
Nick Mathewson
02fbf68770 Use finalization feature so bufferevents can avoid deadlocks
Since the bufferevents' events are now EV_FINALIZE (name pending),
they won't deadlock.  To clean up properly, though, we must use the
finalization feature.

This patch also split bufferevent deallocation into an "unlink" step
that happens fast, and a "destruct" step that happens after
finalization.

More work is needed: there needs to be a way to specify a finalizer
for the bufferevent's argument itself.  Also, this finalizer business
makes lots of the reference counting we were doing unnecessary.

Also, more testing is needed.
2013-04-26 12:18:07 -04:00
Nick Mathewson
9d893c97fa Add some verbose notes to bufferevent unit tests 2013-04-26 12:18:07 -04:00
Nick Mathewson
8eedeabe50 Implement event_finalize() and related functions to avoid certain deadlocks 2013-04-26 12:18:07 -04:00
Nick Mathewson
b1b054f064 Make all tests pass under EVENT_DEBUG_MODE=1
The fix was easy: the tests that were failing were those tests that
also enabled debug mode themselves. So, let them know when
EVENT_DEBUG_MODE is on, so they won't do that.
2013-04-26 12:12:08 -04:00
Nick Mathewson
b3aca5d96c Merge branch '21_http_error_cb_squashed' 2013-04-25 15:13:24 -04:00
Azat Khuzhin
54cc800536 Drop extra header http_struct.h from regress_http.c 2013-04-25 15:12:20 -04:00
Azat Khuzhin
862c217a29 Add test for EVREQ_HTTP_REQUEST_CANCEL into http_cancel_test() 2013-04-25 15:12:20 -04:00
Azat Khuzhin
7b077194cc Add new error_cb for actual reporting of HTTP request errors.
It is useful to know why you callback called with NULL (i.e. it failed),
for example if you set max_body with evhttp_connection_set_max_body_size()
you must know that it failed because of body was longer than this size.

 (Commit message tweaked by Nick)
2013-04-25 15:11:44 -04:00
Nick Mathewson
ed26561b0c Fix another warning introduced in 0c6ec5d8 2013-04-25 14:48:56 -04:00
Nick Mathewson
eeb700ce31 Fix a warning introduced in 0c6ec5d8 2013-04-25 14:47:26 -04:00
Nick Mathewson
6b94ffcec5 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	configure.ac
2013-04-25 13:54:19 -04:00
Nick Mathewson
66dacfa2a5 Merge remote-tracking branch 'origin/pr/36' into patches-2.0 2013-04-25 13:43:49 -04:00
Nick Mathewson
eb6b0c1f90 Merge branch '21_evdns_disable_when_inactive' 2013-04-25 10:47:16 -04:00
Azat Khuzhin
6b7fa620e8 evdns: New flag to make evdns not prevent the event loop from exiting
Here is the brief description of problem:
When you are use evdns to resolve domains to IP adresses (see
./sample/dns-example) you loop never returns from event_base_dispatch(),
and because of this the program will never terminated.

Because existing programs may be depending on the old behavior, we
only apply the fix when evdns_base_new() is created with a new flag -
EVDNS_BASE_DISABLE_WHEN_INACTIVE.

 (Commit message edited by Nick while squashing the branch.)
2013-04-25 10:43:12 -04:00
Nick Mathewson
5e6fa2a3ab event_base_update_cache_time should be a no-op if the loop isn't running 2013-04-24 13:23:15 -04:00