3128 Commits

Author SHA1 Message Date
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
Balint Reczey
b0bd7fe1db Allow registering callback for parsing HTTP headers
Slightly changed version of Espen Jürgensen's
commit 548141e72312126fa6121f6a5f436đ251c7fb1251 for forked-daapd.
2013-11-18 18:24:15 +01:00
Julien BLACHE
8d8decf114 Add a variant of evhttp_send_reply_chunk() with a callback on evhttp_write_buffer()
evhttp_write_buffer() used by evhttp_send_reply_chunk() can take callback
executed when (part of) the buffer has been written. Using this callback to
schedule the next chunk avoids buffering large amounts of data in memory.
2013-11-18 15:39:47 +01: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
Nick Mathewson
82b6956c1b Finalize tests: add a missing check 2013-08-06 19:39:35 -04:00
Nick Mathewson
f314900dfd DNS tests: add a missing check 2013-08-06 19:38:48 -04:00
Nick Mathewson
87cd6f0186 Fix some crash-on-fail cases in DNS regression tests
Found by coverity.
2013-08-06 19:35:56 -04:00
Nick Mathewson
eba4506abf Add missing check to test_evbuffer_file_segment_add_cleanup_cb 2013-08-06 19:33:45 -04:00
Nick Mathewson
776588468b Fix a logic error in test_evbuffer_freeze 2013-08-06 19:32:21 -04:00
Nick Mathewson
1104d0bee9 Fix a (failure-only) null dereference in the unit tests 2013-08-06 19:31:26 -04:00
Nick Mathewson
7080d55c49 Use void casts to suppress some "unchecked return value" warns 2013-08-06 19:28:53 -04:00
Nick Mathewson
44b2491bcd sample/le-proxy: Fail more gracefully if opening listener fails 2013-08-06 19:23:36 -04:00
Nick Mathewson
f22049e359 Fix an unlikely but possible error case for http connections
Found by coverity
2013-08-06 19:17:08 -04:00
Nick Mathewson
69b5c64704 Move event_debug_note_teardown_ before mm_free.
This isn't a bug, since only the pointer value of ev was used, but
it's probably best not to tempt fate.  Found by coverity.
2013-08-06 19:10:13 -04:00
Nick Mathewson
1b065d07df Add some assertions to please coverity.
In event_process_active_single_queue, EVLIST_INIT must be set on any
event that uses one of the event-only closures, and so "ev" will be
set in those cases.  But coverity's worried here (CIDs numerous).  So
instead, just add the assertions that should make it happy.
2013-08-06 19:10:13 -04:00
Nick Mathewson
197abd8bf3 Fix compilation 2013-08-06 17:51:21 -04:00
Nick Mathewson
f391b0030c Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	arc4random.c
2013-08-06 17:29:34 -04:00
Nick Mathewson
2bbb5d7612 Add evutil_secure_rng_set_urandom_device_file
This experimental function is needed for some seccomp2 hackery to
work, and should have no effect for systems that don't use it.
2013-08-06 17:06:23 -04:00
Nick Mathewson
e639a9e10f Remove an unreachable return statement in minheap-internal.h
Found by Brian Utterback; see http://bugs.ntp.org/show_bug.cgi?id=2446
2013-08-01 10:47:48 -04:00
Nick Mathewson
d4095146af Avoid leaking segment mappings when offset is not a page multiple
Found by Bob / Black Hole on the mailing list.
2013-07-31 22:25:28 -04:00