3091 Commits

Author SHA1 Message Date
Nick Mathewson
87fa2b004a Unit tests for active_by_fd; unsupport active_by_fd(TIMEOUT)
[It turns out that event_base_active_by_fd(TIMEOUT) didn't actually
work right. Feel free to add it back in as a patch.]
2013-12-23 20:46:38 -05:00
Nick Mathewson
486594337a Add event_base_active_by_signal by analogy 2013-12-21 23:32:10 -05:00
Nick Mathewson
5c9da9a8a8 Sanity-check arguments to event_base_active_by_fd() 2013-12-21 23:21:33 -05:00
Nick Mathewson
93369ff4e9 Merge remote-tracking branch 'ghazel/event_base_active_by_fd' 2013-12-21 23:15:41 -05:00
Nick Mathewson
974c60e14a Refactor evmap_{io,signal}_active_() to tolerate bad inputs 2013-12-21 23:15:28 -05:00
Nick Mathewson
db7acd1310 Merge remote-tracking branch 'origin/patches-2.0' 2013-12-20 13:37:39 -05:00
Nick Mathewson
eaa79cd459 Merge remote-tracking branch 'sourceforge/patches-2.0' into patches-2.0
Conflicts:
	include/event2/event.h
2013-12-20 13:37:04 -05:00
Nick Mathewson
8cd695bf6d Typo fixes from Linus Nordberg 2013-12-20 13:35:03 -05:00
Nick Mathewson
cec62cb80a Typo fixes from Linus Nordberg 2013-12-20 13:31:29 -05:00
Nick Mathewson
031a803071 Clarify event_base_loop exit conditions 2013-12-16 12:02:21 -05:00
Joakim Soderberg
e6b2a26755 Fix non-C89 variable declaration.
Microsofts C compiler does not support the C99 standard, so variables has
to be declared at the start of a scope.
2013-12-09 16:54:57 +01:00
Nick Mathewson
45eba6ffd5 Rename flush_outdated_host_addresses to clear_host_addresses
"flush" can imply writing something out to a file or connection before
clearing it; "clear" always means "remove".  It's also potentially
misleading to say "outdated" here, since the function removes _all_
addresses regardless, not just certain outdated ones.

Also, don't free the lock in this function.  Also reindent the function.
2013-12-06 10:50:17 -05:00
Nick Mathewson
aeb8d345b4 Merge remote-tracking branch 'origin/pr/86' 2013-12-06 10:37:53 -05:00
Kuldeep Gupta
f03d3535af bug fix for issues #293 evdns_base_load_hosts doesn't remove outdated addresses
As mentioned at https://sourceforge.net/p/levent/bugs/293/
created a small function "evdns_base_flush_outdated_host_addresses" which removes all the previous host addresses, if user wants to clean up the list of hosts can call and use this function.
Defination of this function is part of another patch.
2013-12-06 17:06:20 +05:30
Kuldeep Gupta
954d2f94c0 bug fix for issues #293 evdns_base_load_hosts doesn't remove outdated adresses
As mentioned at https://sourceforge.net/p/levent/bugs/293/
 created a small function "evdns_base_flush_outdated_host_addresses" which removes all the previous requests of hosts , if user wants to clean up the list of hosts can call and use this function. 
Requires function declaration to be added in include/event2/dns.h
 Adding it in another patch for the same bug.
2013-12-06 16:53:16 +05:30
Nick Mathewson
c11e7d9191 start writing a changelog for 2.1.4-(beta?) 2013-12-05 17:25:56 -05:00
Nick Mathewson
735d838b0a Merge remote-tracking branch 'origin/patches-2.0' 2013-12-05 17:14:54 -05:00
Nick Mathewson
f9284c3e3c update the 2.0 changelog 2013-12-05 17:14:05 -05:00
Nick Mathewson
ccf432b912 Try another doxygen tweak 2013-11-21 11:47:34 -05:00
Nick Mathewson
6e67b51023 Small doxygen tweaks 2013-11-21 11:30:04 -05:00
Nick Mathewson
a60632a1ec Merge remote-tracking branch 'origin/patches-2.0' 2013-11-01 14:21:54 -04:00
Nick Mathewson
3b77d62829 Avoid redundant invocations of init_extension_functions for IOCP 2013-11-01 14:20:25 -04:00
Nick Mathewson
515ed87943 Merge branch 'pr_81' 2013-10-14 11:22:40 -04:00
Azat Khuzhin
4dd500cdf4 regress_http: add tests for evhttp_connection_get_addr() 2013-10-14 11:22:30 -04:00
Azat Khuzhin
0c7f0405e3 http: implement new evhttp_connection_get_addr() api.
Basically tcp final handshake looks like this:
    (C - client, S - server)
    ACK[C] - FIN/ACK[S] - FIN/ACK[S] - ACK [C]

However there are servers, that didn't close connection like this,
while it is still _considered_ as valid, and using libevent http layer
we can do requests to such servers.

Modified handshake:
    (C - client, S - server)
    ACK[C] - RST/ACK[S] - RST/ACK[S]

And in this case we can't extract IP address from socket, because it is
already closed, and getpeername() will return: "transport endpoint is not connected".
So we need to store address that we are connecting to, after we know it,
and that is what this patch do.

I have reproduced it, however it have some extra packages.
(I will try to fix it)
https://github.com/azat/nfq-examples/blob/master/nfqnl_rst_fin.c
2013-10-14 11:22:29 -04:00
Nick Mathewson
4464bd2396 Tweak indentation 2013-10-10 16:10:50 -04:00
Nick Mathewson
206124a23c Merge remote-tracking branch 'origin/pr/79' 2013-10-10 16:09:45 -04:00
Nick Mathewson
9721137775 Merge pull request #80 from azat/tests-add-event-debug-logging-all
regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset
2013-10-02 08:45:54 -07:00
Azat Khuzhin
611e28b6ee regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset 2013-10-01 20:22:27 +04:00
Nicolas Martyanoff
5a5acd9a70 add a http default content type option 2013-09-30 18:11:26 +02:00
Nick Mathewson
a093137809 Merge remote-tracking branch 'origin/patches-2.0' 2013-09-19 10:48:27 -04:00
Nick Mathewson
e64a2b0b11 Fix another arc4random_buf-related warning 2013-09-19 10:48:09 -04:00
Nick Mathewson
ee063766f6 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	evutil_rand.c
2013-09-19 10:45:58 -04:00
Nick Mathewson
5cb3865a40 Fix a compiler warning when checking for arc4random_buf linker breakage.
Patch by Ralph Castain.
2013-09-19 10:43:54 -04:00
Nick Mathewson
0a051ef93c Merge remote-tracking branch 'rosslagerwall/tree-build' 2013-09-16 12:29:48 -04: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
b04d13cd72 Merge remote-tracking branch 'origin/patches-2.0' 2013-09-09 12:06:53 -04:00
Nate Rosenblum
5eb178855a Avoid racy bufferevent activation
The evhttp_send_reply method invokes evhttp_write_buffer with a
callback that may release the underlying request object and
bufferevent upon completion. This cleanup callback is invoked by the
underlying bufferevent's write callback. Improperly enabling write
events before referencing the bufferevent could lead to use after free
and memory corruption.
2013-09-09 11:59:00 -04:00
maksqwe
ebfd8a8967 Fix reinit of fds with EV_WRITE but not EV_READ.
Bugfix on 2.1.1-alpha.
2013-09-04 12:22:18 -04:00
Nick Mathewson
911abf3dd2 Check CLOCK_MONOTONIC_* at runtime if needed.
(We need this to avoid compile errors on cygwin.  Fixes github issue
75.)
2013-08-19 10:14:43 -04:00
Nick Mathewson
3807a30b03 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	util-internal.h
2013-08-19 10:05:14 -04:00
Nick Mathewson
c83efb801f Merge remote-tracking branch 'public/20_memclear' into patches-2.0 2013-08-19 10:02:55 -04:00
Nick Mathewson
f5ced88cec Really remove RNG seeds from the stack 2013-08-19 10:02:26 -04:00
Nick Mathewson
c149a1a5e7 Merge remote-tracking branch 'origin/patches-2.0' 2013-08-13 11:14:11 -04:00
Nick Mathewson
bb524712f6 Oops; revert testing code 2013-08-13 11:12:25 -04:00
Nick Mathewson
9695e9c192 Avoid other RNG initialization FS reads when urandom file is specified 2013-08-13 10:59:27 -04:00
Nick Mathewson
d44f91ad79 Finish a sentence 2013-08-13 10:59:20 -04:00
Azat Khuzhin
6171e1c294 sample: drop uri_root from base_url in http-server.
By default there is "0.0.0.0", and this address will work only from
the same machine, and besides there is no need in uri_root in base_url,
because it will be added automatically by browser.
2013-08-13 18:19:50 +04:00
Nick Mathewson
1c06985a01 Add an assertion for another of the complaints from coverity. See 1b065d07df196 2013-08-06 20:00:53 -04:00
Nick Mathewson
e193c959de test_evutil_rtrim: add another missing check. 2013-08-06 19:42:20 -04:00