Nick Mathewson
a8f6d961eb
Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h
...
svn:r1183
2009-04-17 06:56:09 +00:00
Niels Provos
30648529e8
have evhttp_set_cb return an int; -1 on failure, 0 on success; this is better than returning a pointer
...
svn:r1179
2009-04-17 01:03:07 +00:00
Niels Provos
d2794e65e0
document evhttp_parse_query better
...
svn:r1157
2009-04-11 15:26:29 +00:00
Niels Provos
382a1587a0
previous commit changed the semantics of evhttp_decode_uri; need a test for that
...
svn:r1156
2009-04-11 04:18:49 +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
Niels Provos
6dece3e980
revert last commit; git user error
...
svn:r1147
2009-04-10 05:22:15 +00:00
Niels Provos
f43f1d14c5
initial version of query decoding patch
...
svn:r1146
2009-04-10 05:18:18 +00:00
Nick Mathewson
cd731b77d7
Do not use ctypes functions in cases when we need the "net" locale.
...
This patch adds a new set of EVUTIL_IS* functions to replace use of
the ctypes is* functions in all cases where we care about characters'
interpretations in net ascii rather than in the locale. For example,
when we're working with DNS hostnames, we don't want to do the 0x20
hack on non-ascii characters, even if the host thinks they should be
isalpha.
svn:r1114
2009-02-10 21:40:12 +00:00
Nick Mathewson
deb2a1210b
use new evutil_make_listen_socket_reuseable() in http.c
...
svn:r1103
2009-02-10 19:38:14 +00:00
Nick Mathewson
ea4b8724c0
checkpoint work on big bufferevent refactoring
...
svn:r1095
2009-02-02 19:22:13 +00:00
Nick Mathewson
7dd362b158
Have util-internal.h define socklen_t if we need it, and include it appropriately. This fixes win32 compilation.
...
svn:r1070
2009-01-29 15:09:24 +00:00
Nick Mathewson
b85b710cf5
Update copyright statements to reflect the facts that:
...
a) this is 2009
b) niels and nick have been comaintainers for a while
c) saying "all rights reserved" when you then go on to explicitly
disclaim some rights is sheer cargo-cultism.
svn:r1065
2009-01-27 22:34:36 +00:00
Nick Mathewson
8889a77039
Replace all use of config.h with event-config.h.
...
svn:r1064
2009-01-27 22:30:46 +00:00
Nick Mathewson
9993137cbb
Remove all trailing whitespace in all the source files.
...
svn:r1063
2009-01-27 21:10:31 +00:00
Niels Provos
5e796901c1
clean up buffered data on reset; reported by Brian O'Kelley
...
svn:r1015
2009-01-16 00:25:54 +00:00
Nick Mathewson
9935d5b01e
Fix win32 compilation. Surprisingly, unit tests pass too.
...
svn:r1002
2009-01-13 21:39:32 +00:00
Nick Mathewson
169321c9e6
Rename four internal headers to follow the -internal.h convention.
...
svn:r1000
2009-01-13 20:26:37 +00:00
Nick Mathewson
81ab45add5
Use new EVUTIL_ERR_*_RETRIABLE macros when we're testing an errno for blocking.
...
Previously, we used inconsistent and incompletely ported ifdefs.
(We don't use these macros in platform-specific files like evpoll.c, since
they don't need to work on win32.)
svn:r995
2009-01-13 19:20:04 +00:00
Nick Mathewson
f37d1685df
Include http_compat.h in http.c so we do not get warnings about functions with no prototypes.
...
svn:r981
2009-01-02 04:56:56 +00:00
Niels Provos
17bfc07e94
remove http_compat include
...
svn:r976
2008-12-23 22:38:01 +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
97cebce8fd
the switch of bufferevents for http connections did not handle the EVBUFFER_ERROR case correctly
...
svn:r971
2008-12-23 14:53:55 +00:00
Niels Provos
f1728d94eb
fix the close detection problem correctly by not running close detection on the server
...
svn:r968
2008-12-19 22:41:07 +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
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
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
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
b89a3de044
do not warn on accept when errno is egain|eintr
...
svn:r925
2008-07-25 05:22:28 +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
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
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
c3dc717a38
close fd if evhttp_get_requestion_connection fails
...
svn:r867
2008-06-24 23:37:37 +00:00
Niels Provos
24580e2b58
fix build on unix side
...
svn:r866
2008-06-24 22:43:19 +00:00
Niels Provos
30abfd99a2
provide fake_getnameinfo so that the http layer works under windows.
...
svn:r864
2008-06-24 22:38:37 +00:00
Niels Provos
4c56ba1ced
do not use SO_REUSEADDR when connecting
...
svn:r854
2008-06-20 06:52:13 +00:00
Niels Provos
774d056c46
warn on connection failures
...
svn:r853
2008-06-17 01:14:58 +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
Niels Provos
ec3956ba48
fix connection keep-alive behavior for HTTP/1.0
...
svn:r822
2008-05-15 01:53:48 +00:00
Niels Provos
1bce6f7434
use evhttp_connection_base_new()
...
svn:r816
2008-05-13 03:51:10 +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
Niels Provos
1080852e91
allow cancelation of user initiated http requests; this will allow cancelation of rpc requests eventually
...
svn:r812
2008-05-12 03:12:09 +00:00
Nick Mathewson
054159f59c
r19679@catbus: nickm | 2008-05-11 20:56:12 -0400
...
Windows does not have alloca().
svn:r810
2008-05-12 00:56:19 +00:00
Nick Mathewson
6bf1ca780c
r19675@catbus: nickm | 2008-05-11 20:39:39 -0400
...
Stop pretending that u_char and u_short are standard types that win32 is dumb not to have. In fact, u_char can really just be spelled out, and u_short was usually just a bad way of saying ev_uint16_t.
svn:r808
2008-05-12 00:40:04 +00:00
Niels Provos
a57767faf8
more accessors for evhttp_request
...
svn:r807
2008-05-11 16:22:35 +00:00
Niels Provos
687be1241b
dispatch the callbacks against the decoded uri to be more http compliant
...
svn:r806
2008-05-10 07:32:05 +00:00
Niels Provos
7bbe185b0e
evhttp_request_uri -> evhttp_request_get_uri
...
svn:r805
2008-05-10 06:32:53 +00:00