577 Commits

Author SHA1 Message Date
Nick Mathewson
350a3c400f New evhttp function to adjust initial retry timeout 2012-01-24 14:48:02 -05:00
Nick Mathewson
5683e2b1a8 Merge remote-tracking branch 'github/linked_list'
Conflicts:
	include/event2/event_struct.h
2012-01-20 16:31:20 -05:00
Arno Bakker
da70fa705b Backport evhttp_connection_get_bufferevent to Libevent 2.0
Backport by Arno Bakker; original implementation in 8d3a8500f4
2011-12-14 16:17:19 -05:00
Nick Mathewson
cac02fadc2 Merge remote-tracking branch 'origin/patches-2.0' 2011-12-08 14:38:04 -05:00
Nick Mathewson
7bbf6ca771 Slightly clarify evbuffer_peek documentation 2011-12-08 14:36:35 -05:00
Nick Mathewson
de5428e7d5 Merge remote-tracking branch 'fancycode/buffer_references'
Conflicts:
	buffer.c
2011-12-08 14:04:04 -05:00
Nick Mathewson
27e222559a Add evbuffer_copyout_from to copy data from the middle of a buffer
You could previously do this with evbuffer_peek() and some memcpys,
but it was a bit more work than most folks wanted to get into.

Closes sourceforge ticket 3108072
2011-12-07 13:04:35 -05:00
Nick Mathewson
a44cd2b020 Tweak allow_dirty_shutdown documentation 2011-11-24 12:24:38 -05:00
Catalin Patulea
099d27df2b Allow users to set allow_dirty_shutdown 2011-11-24 12:18:30 -05:00
Andrea Montefusco
d7a8b36eaf New EVBUFFER_EOL_NUL to read NUL-terminated strings from an evbuffer 2011-11-14 11:42:52 -05:00
Mark Ellzey
aaec5aca01 Added evbuffer_add_iovec and unit tests. 2011-11-11 17:39:28 -05:00
Nick Mathewson
0cb70e3333 Merge remote-tracking branch 'origin/patches-2.0' 2011-10-26 10:17:21 -04:00
Samy Al Bahra
a2c48e3be8 evhttp: Add evhttp_foreach_bound_socket.
Applies the function specified in the first argument to all
evhttp_bound_sockets associated with a struct evhttp. The user
must not attempt to free or remove any connections, sockets or
listeners in the callback function.
2011-10-25 22:17:24 -04:00
Nick Mathewson
356554c8dc Merge remote-tracking branch 'origin/patches-2.0' 2011-10-25 11:43:01 -04:00
Nick Mathewson
3c824bd334 Update copyright dates to 2011. 2011-10-24 13:18:09 -04:00
Abel Mathew
212533e4a1 New event_base_update_cache_time() to set cached_tv to current time
This function is particularly useful for selectively increasing
the accuracy of the cached time value in 'base' during callbacks
that take a long time to execute.

This function has no effect if the base is currently not in its
event loop or if timeval caching is disabled via EVENT_BASE_FLAG_NO_CACHE_TIME.
2011-10-21 18:08:08 -04:00
Nick Mathewson
724bfb56ef Add note about evhttp_send_reply_end to its doxygen 2011-10-19 22:59:47 -04:00
Alexander Drozdov
998c81389f bufferevent: Add functions to set/get max_single_read/write values. 2011-10-11 10:15:39 -04:00
Alexander Drozdov
ee3a4ee880 Add event_base_get_npriorities() function. 2011-10-11 09:43:12 -04:00
Nick Mathewson
fed8f6e484 Merge remote-tracking branch 'origin/patches-2.0' 2011-10-10 11:34:26 -04:00
Greg Hazel
ba5c27d47f refer to non-deprecated evdns functions in comments 2011-10-10 11:33:15 -04:00
Nick Mathewson
8358877768 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	buffer.c
	test/regress_buffer.c
2011-10-06 15:21:55 -04:00
Nick Mathewson
5760efb1b6 Merge branch '21_largefile_support' 2011-10-05 15:03:17 -04:00
Nick Mathewson
084e68f3f2 New EVLOOP_NO_EXIT_ON_EMPTY option to keep looping even when no events are pending
This can be useful if you want to start an event loop and then add or
remove events to it from another thread.
2011-10-05 11:11:44 -04:00
Alexander Drozdov
9593a33fd1 Allow evconnlistener to be created in disabled state. 2011-10-03 12:59:11 -04:00
Nick Mathewson
0ba0af9c6c Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL.
The sendfile() implementation for evbuffer_add_file is potentially more
efficient, but it has a problem: you can only use it to send bytes over
a socket using sendfile().  If you are writing bytes via SSL_send() or
via a filter, or if you need to be able to inspect your buffer, it
doesn't work.

As an easy fix, this patch disables the sendfile-based implementation of
evbuffer_add_file on an evbuffer unless the user sets a new
EVBUFFER_FLAG_DRAINS_TO_FD flag on that evbuffer, indicating that the
evbuffer will not be inspected, but only written out via
evbuffer_write(), evbuffer_write_atmost(), or drained with stuff like
evbuffer_drain() or evbuffer_add_buffer().  This flag is off by
default, except for evbuffers used for output on bufferevent_socket.

In the future, it could be interesting to make a best-effort file
segment implementation that tries to send via sendfile, but mmaps on
demand.  That's too much complexity for a stable release series, though.
2011-09-29 10:32:16 -04:00
Nick Mathewson
38674d4a5e Merge remote-tracking branch 'origin/patches-2.0' 2011-09-12 15:46:54 -04:00
Leonid Evdokimov
94fba5b9ac Add DNS_ERR_NODATA error code to handle empty replies. 2011-09-12 15:38:05 -04:00
Leonid Evdokimov
2b6eae5999 Fix docstring in dns.h 2011-09-12 15:09:30 -04:00
Nick Mathewson
8a2310408f Build with large-file support on platforms where it matters
Some hosts require you to define certain options to get a large off_t
instead of a small one, to get useful ftell and fseek calls instead of
ones that can only support 2GB files, and so on.  This patch makes
Libevent support those platforms by:

   * Defining the right options when we build, and
   * Changing our API so that it does not depend on the platform's
     definition of off_t.

Based on discusion with Michael Herf
2011-09-12 14:53:39 -04:00
Nick Mathewson
e20eabd69a Merge branch '21_enable_debugging' 2011-09-12 11:31:19 -04:00
Nick Mathewson
6207826e70 Clarify event_enable_debug_logging a little 2011-09-12 11:31:02 -04:00
Nick Mathewson
8d3a8500f4 Add evhttp callback for bufferevent creation; this lets evhttp support SSL.
Based on a patch uploaded anonymously to sourceforge; cleaned up
by Graham Leggett to work with current libevents.
2011-09-12 10:48:35 -04:00
Nick Mathewson
a37a0c0e35 Make max_dispatch_interval able to apply only to low-priority events
Suggested by Alexander Drozdov
2011-08-17 22:03:57 -04:00
Nick Mathewson
fd4de1e7fe Add event_config function to limit time/callbacks between calls to dispatch 2011-08-17 22:03:57 -04:00
Nick Mathewson
d7451b0523 Merge remote-tracking branch 'origin/patches-2.0' 2011-08-15 11:14:57 -04:00
Leonid Evdokimov
50be5a14b5 Another docstring fix. 2011-08-15 11:11:10 -04:00
Joachim Bauch
26041a8ed8 prevent nested multicast references, reworked locking 2011-08-09 23:08:54 +02:00
Joachim Bauch
9d7368ae2d support adding buffers to other buffers non-destructively 2011-08-09 23:08:46 +02:00
Nick Mathewson
e918f15a4c Merge remote-tracking branch 'origin/patches-2.0' 2011-08-01 10:30:02 -04:00
Nick Mathewson
1183f7e24e Fix typo in event_compat.h comments. 2011-08-01 10:27:56 -04:00
Nick Mathewson
7d08a28c1c Merge remote-tracking branch 'github/21_end_of_buffer'
Conflicts:
	include/event2/buffer.h
2011-07-05 15:07:07 -04:00
Nick Mathewson
21be3dff74 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	include/event2/buffer.h
	include/event2/thread.h
	include/event2/util.h
2011-07-05 14:38:21 -04:00
Nick Mathewson
2888faccd1 Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy 2011-07-05 13:01:07 -04:00
Nick Mathewson
261ba63dba Improve evbuffer_ptr documentation 2011-06-13 17:07:29 -04:00
Nick Mathewson
9f560bfa11 Use "_WIN32", not WIN32: it's standard and we don't need to fake it
This patch was automatically generated with perl.

Based on a patch by Peter Rosin.
2011-05-25 20:03:15 -04:00
Nick Mathewson
22d50db805 Merge remote-tracking branch 'origin/patches-2.0' 2011-05-02 23:22:34 -04:00
Nick Mathewson
9556a7d1f6 Add missing words to EVLOOP_NONBLOCK documentation 2011-05-02 23:22:09 -04:00
Nick Mathewson
c8baac9023 Followup for Tomash Brechko's http patch
This patch makes bufferevent_disable_hard() non-public, and
adds a comment about what it's for and why it's used.
2011-03-07 21:58:16 -05:00
Tomash Brechko
5dc566284d Workaround libevent bug
https://sourceforge.net/tracker/index.php?func=detail&aid=3078187&group_id=50884&atid=461324

The problem is that bufferevent_disable() doesn't disable EV_WRITE
when 'connecting' flag is set.  However from evhttp_connection_reset()
we want to disable EV_WRITE for sure (we are closing the socket next).
So we add bufferevent_disable_hard(), which acts like
bufferevent_disable(), but resets 'connecting' flag before the call to
the actual handler.

TODO: bufferevent_disable_hard() shouldn't be public, remove it from
event2/bufferevent.h.
2011-03-07 21:41:45 -05:00