393 Commits

Author SHA1 Message Date
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
Niels Provos
950af18679 replace fnmatch with homegrown function
svn:r804
2008-05-10 05:58:17 +00:00
Nick Mathewson
8acb80b4f9 r15551@tombo: nickm | 2008-05-08 14:49:20 -0400
Use _get_ convention for new accessor functions.  (These are all new ones as of 2.0, I believe).


svn:r799
2008-05-08 22:51:39 +00:00
Nick Mathewson
7defe4cbc1 r15549@tombo: nickm | 2008-05-08 11:53:11 -0400
Make new http headers include minimal parts of event2/ tree; make old evhttp.h incldue event.h, since the old one did too.


svn:r798
2008-05-08 15:55:09 +00:00
Niels Provos
de1c43926b migrate evhttp to event2; accessors are still missing
svn:r790
2008-05-08 06:15:04 +00:00
Nick Mathewson
891dba4376 r19597@catbus: nickm | 2008-05-05 11:00:29 -0400
define _GNU_SOURCE before including fnmatch.h so that FNM_CASEFOLD gets defined and linux build gets fixed.  This whole fnmatch() business will be a bit hard to port, though: windows doesn't have one IIUC, so we'll have to reimplement our own to work there.


svn:r772
2008-05-05 15:00:53 +00:00
Niels Provos
f2a81fbc67 add support for virtual http hosts; no tests yet
svn:r771
2008-05-05 07:17:05 +00:00
Niels Provos
f940eb4b8d fix a bug where it was not possible to bind multiple sockets to the same http
server; test that binding multiple sockets works.


svn:r769
2008-05-04 22:21:29 +00:00
Nick Mathewson
5fbc7f0aee r15439@tombo: nickm | 2008-05-02 12:28:08 -0400
use event_assign internall; switch uses of event_set to use event_assign instead.


svn:r755
2008-05-02 16:28:25 +00:00
Nick Mathewson
98dc98c59f r15346@tombo: nickm | 2008-04-29 17:19:18 -0400
Remove the never-exported, never-used, never-threadsafe evhttp_hostportfile()


svn:r746
2008-04-29 21:19:26 +00:00
Nick Mathewson
4cff82bb4f r15339@tombo: nickm | 2008-04-29 14:03:48 -0400
Note that evhttp_hostportfile is not threadsafe, and so its usage will change.  Mark its first argument const. Remove a now-redundant declaration for it in http-internal.h.


svn:r743
2008-04-29 18:11:10 +00:00
Niels Provos
e44ef375ee convert evhttp_connection to use bufferevents
svn:r742
2008-04-29 04:52:50 +00:00
Niels Provos
72a3902e5c test some primitives from http.c
svn:r739
2008-04-29 00:24:00 +00:00
Nick Mathewson
49868b618a r15316@tombo: nickm | 2008-04-24 20:58:36 -0400
Rename internal memory management functions from event_malloc() etc to mm_malloc() etc.


svn:r725
2008-04-25 01:18:08 +00:00
Nick Mathewson
a55a67d56e r15249@tombo: nickm | 2008-04-18 09:46:02 -0400
Avoid leaking a string in the unlikely OOM case from name_from_addr. spotted by niels.


svn:r724
2008-04-18 13:46:13 +00:00
Nick Mathewson
8863ff7625 r15224@tombo: nickm | 2008-04-17 15:19:24 -0400
Oops. We need to make sure that strdup wasn't oom.


svn:r718
2008-04-17 19:19:36 +00:00
Nick Mathewson
ae09ac4ae0 r15220@tombo: nickm | 2008-04-17 15:16:02 -0400
Use new includes in more files still


svn:r717
2008-04-17 19:18:40 +00:00
Nick Mathewson
fc41ffde4d r15214@tombo: nickm | 2008-04-17 11:47:10 -0400
Make name_from_addr() threadsafe in http.c


svn:r713
2008-04-17 15:50:28 +00:00
Niels Provos
558de9b377 Provide OpenSSL style support for multiple threads accessing the same event_base
svn:r684
2008-03-02 21:18:33 +00:00
Nick Mathewson
593b5f99b3 r18492@catbus: nickm | 2008-02-29 17:32:55 -0500
Add another missing _REENTRANT.


svn:r681
2008-02-29 22:33:01 +00:00
Niels Provos
5c70ea4c9d improved code for evbuffer; avoids memcpy
svn:r674
2008-02-28 02:47:43 +00:00
Nick Mathewson
e7ad549390 r14507@tombo: nickm | 2008-02-26 15:23:44 -0500
Patch from Tani Hosokawa: make some functions in http.c threadsafe.  Also, note some functions in http.c that still are not threadsafe.


svn:r671
2008-02-26 20:24:29 +00:00
Niels Provos
7470ce52c5 increase listen queue for http sockets to 128
svn:r669
2008-02-26 03:49:00 +00:00
Niels Provos
960be58869 deal correctly with http/1.0 and keep-alive
svn:r667
2008-02-26 03:29:36 +00:00
Niels Provos
0b114da2b6 introduce evhttp_accept_socket() to accept from an already created socket
svn:r666
2008-02-26 03:12:07 +00:00
Niels Provos
b14cd655d1 add support (without tests!) to PUT/DELETE requests; from Josh Rotenberg
svn:r662
2008-02-25 07:49:22 +00:00
Nick Mathewson
d47907a730 r14213@tombo: nickm | 2008-02-16 15:48:07 -0500
Patch from Scott Lamb: make http content length into a 64-bit value.


svn:r641
2008-02-16 20:50:02 +00:00
Nick Mathewson
677a95864b r14205@tombo: nickm | 2008-02-16 11:55:57 -0500
Fix bug 1894184: add a CRLF after each chunk when sending chunked HTTP data.  Original patch from propanbutan.


svn:r637
2008-02-16 16:56:34 +00:00
Niels Provos
2fde221759 address some compiler warnings in debug mode
svn:r630
2008-02-09 16:03:01 +00:00
Niels Provos
955c6abf53 pausing an rpc via a hook needs to deal with the fact that http callbacks free the request after they return; provide a way for a callback to take ownership of the request structure; the user then needs to explicitly free it.
svn:r620
2007-12-28 00:36:47 +00:00