Nick Mathewson
e3d82497c9
Don't allow internal events to starve lower-priority events.
...
This is exceptionally important with multithreaded stuff, where we use
an event to notify the base that other events have been made active.
If the activated events have a prioirty number greater than that of the
notification event, it will starve them, and that's no good.
svn:r1149
2009-04-10 14:21:53 +00:00
Niels Provos
ce146eb1cb
Fix parsing of queries where the encoded queries contained \r, \n or +
...
svn:r1148
2009-04-10 05:43:45 +00:00
Nick Mathewson
72b6ffe869
Prevent unsupported modifications to bufferevent_sock buffers.
...
In particular, we don't allow adding any data to end front of inbuf
(we do that when we read), or removing it from the front of outbuf (we
drain data only when we write).
svn:r1144
2009-04-08 03:05:42 +00:00
Nick Mathewson
747331d164
Add freeze support to evbuffers.
...
From the documentation:
Prevent calls that modify an evbuffer from succeeding. A buffer may
frozen at the front, at the back, or at both the front and the back.
If the front of a buffer is frozen, operations that drain data from
the front of the buffer, or that prepend data to the buffer, will
fail until it is unfrozen. If the back a buffer is frozen, operations
that append data from the buffer will fail until it is unfrozen.
We'll use this to ensure correctness on an evbuffer when we're waiting
for an overlapped IO call to finish.
svn:r1143
2009-04-08 03:04:39 +00:00
Nick Mathewson
77c80b8dcf
New bind-to option to allow DNS clients to bind to arbitrary ports for their outgoing addresses.
...
svn:r1119
2009-02-11 17:24:11 +00:00
Nick Mathewson
c7b2f8fdc9
New function to abstract SO_REUSEADDR.
...
svn:r1102
2009-02-10 19:38:05 +00:00
Niels Provos
fdf694933c
sendfile/mmap and memory reference implementation for evbuffers
...
svn:r1057
2009-01-27 06:05:38 +00:00
Niels Provos
56ea4687a5
Change the semantics of timeouts in conjunction with EV_PERSIST; timeouts in that case will now repeat until deleted.
...
svn:r1032
2009-01-22 02:33:38 +00:00
Nick Mathewson
309fc7c4ad
New functions to provide sane threading callbacks with pthreads and win32 threading implementations.
...
svn:r1031
2009-01-21 07:51:25 +00:00
Nick Mathewson
f6eb1f816c
Change evbuffer_read implementation to split data across chunks, and use readv when available. This should make us use less space.
...
svn:r1024
2009-01-19 21:53:03 +00:00
Nick Mathewson
a5901991c7
Use eventfd for main-thread notification where available (i.e., linux).
...
svn:r1023
2009-01-19 20:37:24 +00:00
Nick Mathewson
99db0e7f72
Add a new evbuffer_write_atmost() functino to write no more than a given number of bytes to an fd.
...
svn:r993
2009-01-12 20:42:19 +00:00
Nick Mathewson
135591aeab
Change the type of nameserver.address from u32 to sockaddr_storage, so that we can handle nameservers at IPv6 addresses.
...
svn:r985
2009-01-02 20:46:35 +00:00
Nick Mathewson
0d9d5cfe22
New functions in evutil to clone inet_pton and inet_ntop, with tests.
...
Adapted from Tor code.
svn:r983
2009-01-02 20:46:12 +00:00
Niels Provos
02b2b4d1be
Restructure the event backends so that they do not need to keep track of events themselves, as a side effect multiple events can use the same fd or signal.
...
svn:r972
2008-12-23 16:37:01 +00:00
Niels Provos
f700566cb9
Make the http connection close detection work properly with bufferevents and fix a potential memory leak associated with it
...
svn:r963
2008-12-19 21:31:43 +00:00
Nick Mathewson
dd73168556
Implement increased DSN-poisoning resistance via the 0x20 hack.
...
svn:r958
2008-12-03 20:09:13 +00:00
Niels Provos
4fa4a56253
fix a typo in setting the global event base; reported by lance
...
svn:r953
2008-11-27 19:57:48 +00:00
Niels Provos
4fe25cefb5
Clear the timer cache when leaving the event loop; reported by Robin Haberkorn
...
svn:r950
2008-11-27 19:27:33 +00:00
Niels Provos
5792d42f0f
Allow setting of local port for evhttp connections to support millions of connections from a single system; from Richard Jones
...
svn:r948
2008-11-16 23:22:14 +00:00
Niels Provos
50202d757d
only bind the socket on connect when a local address has been provided; reported by Ajejo Sanchez
...
svn:r946
2008-11-15 05:27:23 +00:00
Niels Provos
31cfe52662
clear the timer cache on entering event loop; reported by Victor Chang
...
svn:r944
2008-10-30 19:38:31 +00:00
Niels Provos
b3d6a569e7
do not remove accept-encoding header in make request
...
svn:r938
2008-09-07 23:24:54 +00:00
Nick Mathewson
de069b9977
On win32, errno is not the last socket error. Worse, WSAGetLastError() is not the last socket error sometimes (i.e., EWOULDBLOCK). Also, strerror() does not handle winsock errors. Therefore, event_err() and event_warn() are completely wrong for windows socket errors. Fix that.
...
svn:r936
2008-09-05 16:29:56 +00:00
Niels Provos
a710d817ad
Match the query in DNS replies to the query in the request; from Vsevolod Stakhov
...
svn:r930
2008-08-30 23:19:49 +00:00
Niels Provos
c968eb3e01
Fix a bug where headers arriving in multiple packets were not parsed; fix from Jiang Hong; test by me.
...
svn:r928
2008-08-19 11:26:47 +00:00
Niels Provos
cca2f8fa0e
make event_add not change any state if it fails; repoted by Ian Bell
...
svn:r923
2008-07-25 01:29:54 +00:00
Niels Provos
1aa6826f62
fix off by one errors in devpoll; from Ian Bell
...
svn:r921
2008-07-25 01:18:40 +00:00
Niels Provos
e67a5ea9bb
fix a problem with epoll and event_reinit; reported by Alexander Drozdov
...
svn:r917
2008-07-25 00:19:15 +00:00
Niels Provos
c4af6211bd
forgot to add Alexander Drozdov as bug reporter in ChangeLog
...
svn:r905
2008-07-11 16:11:16 +00:00
Niels Provos
f7e61870e9
support multiple events listening on the same signal; make signals regular events that go on the same event queue
...
svn:r901
2008-07-11 15:49:04 +00:00
Niels Provos
5512be0176
fix a bug where deleting signals with kqueue would delete subsequent adds
...
svn:r899
2008-07-11 15:15:04 +00:00
Niels Provos
df97fca9ca
From Scott Lamb:
...
* Allow the user to set the Content-Length: then stream a reply.
This is useful for large requests of a known size. Added unit test.
* Don't send a response body on HEAD requests, 1xx status codes, 204
status codes, or 304 status codes, as described in RFC 2616 section
4.3. (Doing otherwise causes problems - in particular, if a 304 has a
chunked body (even an empty one), Safari 3.1.1 issues and then fails
the next request on the connection with the non-sequitur error message
"Too many HTTP redirects"!)
* Specify a default Content-Type: when a response body is required, not
when we have data in the response buffer by the time we make the
header. (I.e., do this on evhttp_send_reply_start() for consistency.)
* Don't expect a body in response to HEAD requests.
svn:r898
2008-07-02 06:08:16 +00:00
Niels Provos
409236a77d
detect CLOCK_MONOTONIC at runtime for evdns
...
svn:r896
2008-07-02 04:39:09 +00:00
Niels Provos
707f67849a
reject negative content-length headers
...
svn:r894
2008-07-02 04:22:48 +00:00
Niels Provos
cb7c3bd671
support multi-line http headers; based on a patch from Moshe Litvin
...
svn:r890
2008-06-29 01:30:06 +00:00
Niels Provos
9998c0cbc8
correct handling of trailing headers in chunked replies; from Scott Lamb.
...
svn:r887
2008-06-26 00:40:57 +00:00
Niels Provos
99a1063e73
support 64-bit integers in rpc structs
...
svn:r856
2008-06-21 02:21:25 +00:00
Niels Provos
4c56ba1ced
do not use SO_REUSEADDR when connecting
...
svn:r854
2008-06-20 06:52:13 +00:00
Nick Mathewson
2baaac7fdb
Forward-port: Rename INPUT and OUTPUT to EVRPC_INPUT and EVRPC_OUTPUT, but keep the INPUT/OUTPUT aliases on non-win32 platforms to maintain backwards compatibility.
...
svn:r852
2008-06-14 17:50:36 +00:00
Niels Provos
a6ce520cfb
allow min_heap_erase to be called on removed members; from liusifan
...
svn:r849
2008-06-12 14:43:35 +00:00
Niels Provos
344c2b56f1
deliver partial data to request callbacks when chunked callback is set even if there is no chunking on the http level; allows cancelation of requests from within the chunked callback; from Scott Lamb.
...
svn:r846
2008-06-02 05:45:26 +00:00
Nick Mathewson
05965921ab
Add new functions to access backends by their features and to query the features of a backend.
...
svn:r842
2008-05-31 14:37:31 +00:00
Nick Mathewson
39400e68b6
Patch from Valery Kholodkov: support for edge-triggered events with epoll and kqueue. Changed from original patch: made test into a regression test, with explicit success/failure for edge-triggered and non-edge-triggered cases. Closes SF request 1968284.
...
svn:r840
2008-05-30 16:56:34 +00:00
Nick Mathewson
9ca7a3a3d6
Resolve two conflicts.
...
svn:r839
2008-05-30 16:19:01 +00:00
Niels Provos
2deb3ce061
simplify handling of environment variables for disabling backends;
...
make event_get_supported_methods obey environment variables; this
fixes make verify; problem reported by Scott Lamb.
svn:r838
2008-05-29 01:39:43 +00:00
Niels Provos
8b66f1bd4d
constify struct timeval *
...
svn:r836
2008-05-17 02:14:17 +00:00
Niels Provos
134344b79e
Fix use of freed memory in event_reinit; pointed out by Peter Postma
...
svn:r834
2008-05-16 01:55:40 +00:00
Niels Provos
ec3956ba48
fix connection keep-alive behavior for HTTP/1.0
...
svn:r822
2008-05-15 01:53:48 +00:00
Nick Mathewson
c6da86ffcb
r19709@catbus: nickm | 2008-05-12 12:42:48 -0400
...
Possible fix for [1960723] snprintf and vsnprintf return values are wrong on win32
svn:r813
2008-05-12 16:44:24 +00:00