http.c


Log

Author Commit Date CI Message
Niels Provos f1691539 2009-11-19T23:08:50 Remove most calls to event_err() in http and deal with memory errors instead svn:r1555
Niels Provos b8f222e0 2009-11-19T21:14:31 On FreeBSD and other OSes, connect can return ECONREFUSED immediately; instead of failing the function call, pretend with faileld in the callback. svn:r1553
Nick Mathewson 86f57420 2009-11-16T22:25:46 Add two implementations of getaddrinfo: one blocking and one nonblocking. The entry points are evutil_getaddrinfo and evdns_getaddrinfo respectively. There are fairly extensive unit tests. I believe this code conforms to RFC3493 pretty closely, but there are probably more issues. It should get tested on more platforms. This code means we can dump the well-intentioned but weirdly-implemented bufferevent_evdns and evutil_resolve code. svn:r1537
Nick Mathewson c79a45e0 2009-11-14T21:54:30 Fix a couple of event_debug calls. svn:r1527
Nick Mathewson 37e23f80 2009-11-09T18:50:20 Patch from Ryan Phillips: accept ipv6 addresses returned by getaddrinfo in http.c svn:r1522
Nick Mathewson 784b8773 2009-11-06T21:46:57 We do not work any more without an event-config.h; stop pretending that it is meaningful to check for HAVE_CONFIG_H svn:r1516
Nick Mathewson ac633aeb 2009-11-05T21:22:23 Fix some build warnings on MSVC, mostly related to signed/unsigned comparisons. svn:r1510
Nick Mathewson 34f28e08 2009-11-05T15:57:22 Fix a few types to use compatible versions svn:r1501
Nick Mathewson 47bad8ab 2009-11-04T20:17:32 Implement size limits on HTTP header length and body length. Patch from Constantine Verutin, simplified a little. svn:r1500
Nick Mathewson 0b9eb1bf 2009-11-03T20:40:48 Add a bufferevent function to resolve a name then connect to it. This function, bufferevent_socket_connect_hostname() can either use evdns to do the resolve, or use a new function (evutil_resolve) that uses getaddrinfo or gethostbyname, like http.c does now. This function is meant to eventually replace the hostname resolution mess in http.c. svn:r1496
Nick Mathewson 2e36dbe1 2009-10-26T20:00:43 Use EVUTIL_ASSERT() consistently instead of assert. svn:r1464
Nick Mathewson e3fd294a 2009-10-16T13:19:57 Spelling fixes in comments and strings. svn:r1445
Nick Mathewson 2c1b0e44 2009-08-16T19:22:15 Fix build warnings and add changelog entry for evhttp patches. svn:r1424
Nick Mathewson c8b0fe4a 2009-08-16T19:22:10 Define evhttp_del_accept_socket [Patch from David Reiss] svn:r1423
Nick Mathewson 6c53334c 2009-08-16T19:22:04 Define evhttp_{bind,accept}_socket_with_handle [Patch from David Reiss] svn:r1422
Nick Mathewson 4bcd5646 2009-08-16T19:21:57 Make evhttp_bound_socket visible, and provide an accessor to its fd Declare the previously private struct evhttp_bound_socket in event2/http.h as an opaque struct. Implement evhttp_bound_socket_get_fd, which returns the file descriptor of an evhttp_bound_socket. [Patch from David Reiss] svn:r1421
Nick Mathewson 7c20a6ae 2009-07-30T17:01:21 Export an ev_socklen_t. svn:r1391
Nick Mathewson 72ea534f 2009-07-28T19:41:57 Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp. svn:r1387
Nick Mathewson 83f46e51 2009-05-13T20:36:56 Do not use the "evbuffer_" prefix to denote parts of bufferevents. This is a bit of an interface doozy, but it's really needed in order to be able to document this stuff without apologizing it. This patch does the following renamings: evbuffercb -> bufferevent_data_cb everrorcb -> bufferevent_event_cb EVBUFFER_(READ,WRITE,...) -> BEV_EVENT_(...) EVBUFFER_(INPUT,OUTPUT) -> bufferevent_get_(input,output) All the old names are available in event2/bufferevent_compat.h svn:r1283
Nick Mathewson f11dff2c 2009-05-07T03:45:51 Add and use locale-independent strcasecmp functions. svn:r1280
Nick Mathewson 5a3eddf0 2009-05-02T16:24:05 Use fewer _compat.h headers in our own code. svn:r1268
Nick Mathewson e865eb93 2009-05-01T00:54:14 More msvc build tweaks. svn:r1262
Nick Mathewson c5c9589f 2009-04-23T06:27:58 Add missing case to make http.c compile with warnings enabled. svn:r1232
Nick Mathewson 9516df0e 2009-04-23T05:40:06 Fix c89 bugs reported by Cory Stup. Others may remain. I wasn't able to get gcc --std=c89 to build libevent at all, so I don't know what compiler the original reporter is using here. Note that this change requires us to disable the part of our rpc code that uses variadic macros when using a non-gcc compiler. This is a problem if we want our rpc api to be portable. svn:r1231
Nick Mathewson a8f6d961 2009-04-17T06:56:09 Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h svn:r1183
Niels Provos 30648529 2009-04-17T01:03:07 have evhttp_set_cb return an int; -1 on failure, 0 on success; this is better than returning a pointer svn:r1179
Niels Provos d2794e65 2009-04-11T15:26:29 document evhttp_parse_query better svn:r1157
Niels Provos 382a1587 2009-04-11T04:18:49 previous commit changed the semantics of evhttp_decode_uri; need a test for that svn:r1156
Niels Provos ce146eb1 2009-04-10T05:43:45 Fix parsing of queries where the encoded queries contained \r, \n or + svn:r1148
Niels Provos 6dece3e9 2009-04-10T05:22:15 revert last commit; git user error svn:r1147
Niels Provos f43f1d14 2009-04-10T05:18:18 initial version of query decoding patch svn:r1146
Nick Mathewson cd731b77 2009-02-10T21:40:12 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
Nick Mathewson deb2a121 2009-02-10T19:38:14 use new evutil_make_listen_socket_reuseable() in http.c svn:r1103
Nick Mathewson ea4b8724 2009-02-02T19:22:13 checkpoint work on big bufferevent refactoring svn:r1095
Nick Mathewson 7dd362b1 2009-01-29T15:09:24 Have util-internal.h define socklen_t if we need it, and include it appropriately. This fixes win32 compilation. svn:r1070
Nick Mathewson b85b710c 2009-01-27T22:34:36 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
Nick Mathewson 8889a770 2009-01-27T22:30:46 Replace all use of config.h with event-config.h. svn:r1064
Nick Mathewson 9993137c 2009-01-27T21:10:31 Remove all trailing whitespace in all the source files. svn:r1063
Niels Provos 5e796901 2009-01-16T00:25:54 clean up buffered data on reset; reported by Brian O'Kelley svn:r1015
Nick Mathewson 9935d5b0 2009-01-13T21:39:32 Fix win32 compilation. Surprisingly, unit tests pass too. svn:r1002
Nick Mathewson 169321c9 2009-01-13T20:26:37 Rename four internal headers to follow the -internal.h convention. svn:r1000
Nick Mathewson 81ab45ad 2009-01-13T19:20:04 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
Nick Mathewson f37d1685 2009-01-02T04:56:56 Include http_compat.h in http.c so we do not get warnings about functions with no prototypes. svn:r981
Niels Provos 17bfc07e 2008-12-23T22:38:01 remove http_compat include svn:r976
Niels Provos 02b2b4d1 2008-12-23T16:37:01 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
Niels Provos 97cebce8 2008-12-23T14:53:55 the switch of bufferevents for http connections did not handle the EVBUFFER_ERROR case correctly svn:r971
Niels Provos f1728d94 2008-12-19T22:41:07 fix the close detection problem correctly by not running close detection on the server svn:r968
Niels Provos f700566c 2008-12-19T21:31:43 Make the http connection close detection work properly with bufferevents and fix a potential memory leak associated with it svn:r963
Niels Provos 5792d42f 2008-11-16T23:22:14 Allow setting of local port for evhttp connections to support millions of connections from a single system; from Richard Jones svn:r948
Niels Provos 50202d75 2008-11-15T05:27:23 only bind the socket on connect when a local address has been provided; reported by Ajejo Sanchez svn:r946
Niels Provos b3d6a569 2008-09-07T23:24:54 do not remove accept-encoding header in make request svn:r938
Nick Mathewson de069b99 2008-09-05T16:29:56 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
Niels Provos c968eb3e 2008-08-19T11:26:47 Fix a bug where headers arriving in multiple packets were not parsed; fix from Jiang Hong; test by me. svn:r928
Niels Provos b89a3de0 2008-07-25T05:22:28 do not warn on accept when errno is egain|eintr svn:r925
Niels Provos f7e61870 2008-07-11T15:49:04 support multiple events listening on the same signal; make signals regular events that go on the same event queue svn:r901
Niels Provos df97fca9 2008-07-02T06:08:16 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
Niels Provos 707f6784 2008-07-02T04:22:48 reject negative content-length headers svn:r894
Niels Provos cb7c3bd6 2008-06-29T01:30:06 support multi-line http headers; based on a patch from Moshe Litvin svn:r890
Niels Provos 9998c0cb 2008-06-26T00:40:57 correct handling of trailing headers in chunked replies; from Scott Lamb. svn:r887
Niels Provos c3dc717a 2008-06-24T23:37:37 close fd if evhttp_get_requestion_connection fails svn:r867
Niels Provos 24580e2b 2008-06-24T22:43:19 fix build on unix side svn:r866
Niels Provos 30abfd99 2008-06-24T22:38:37 provide fake_getnameinfo so that the http layer works under windows. svn:r864
Niels Provos 4c56ba1c 2008-06-20T06:52:13 do not use SO_REUSEADDR when connecting svn:r854
Niels Provos 774d056c 2008-06-17T01:14:58 warn on connection failures svn:r853
Niels Provos 344c2b56 2008-06-02T05:45:26 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
Niels Provos ec3956ba 2008-05-15T01:53:48 fix connection keep-alive behavior for HTTP/1.0 svn:r822
Niels Provos 1bce6f74 2008-05-13T03:51:10 use evhttp_connection_base_new() svn:r816
Nick Mathewson c6da86ff 2008-05-12T16:44:24 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
Niels Provos 1080852e 2008-05-12T03:12:09 allow cancelation of user initiated http requests; this will allow cancelation of rpc requests eventually svn:r812
Nick Mathewson 054159f5 2008-05-12T00:56:19 r19679@catbus: nickm | 2008-05-11 20:56:12 -0400 Windows does not have alloca(). svn:r810
Nick Mathewson 6bf1ca78 2008-05-12T00:40:04 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
Niels Provos a57767fa 2008-05-11T16:22:35 more accessors for evhttp_request svn:r807
Niels Provos 687be124 2008-05-10T07:32:05 dispatch the callbacks against the decoded uri to be more http compliant svn:r806
Niels Provos 7bbe185b 2008-05-10T06:32:53 evhttp_request_uri -> evhttp_request_get_uri svn:r805
Niels Provos 950af186 2008-05-10T05:58:17 replace fnmatch with homegrown function svn:r804
Nick Mathewson 8acb80b4 2008-05-08T22:51:39 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
Nick Mathewson 7defe4cb 2008-05-08T15:55:09 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
Niels Provos de1c4392 2008-05-08T06:15:04 migrate evhttp to event2; accessors are still missing svn:r790
Nick Mathewson 891dba43 2008-05-05T15:00:53 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
Niels Provos f2a81fbc 2008-05-05T07:17:05 add support for virtual http hosts; no tests yet svn:r771
Niels Provos f940eb4b 2008-05-04T22:21:29 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
Nick Mathewson 5fbc7f0a 2008-05-02T16:28:25 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
Nick Mathewson 98dc98c5 2008-04-29T21:19:26 r15346@tombo: nickm | 2008-04-29 17:19:18 -0400 Remove the never-exported, never-used, never-threadsafe evhttp_hostportfile() svn:r746
Nick Mathewson 4cff82bb 2008-04-29T18:11:10 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
Niels Provos e44ef375 2008-04-29T04:52:50 convert evhttp_connection to use bufferevents svn:r742
Niels Provos 72a3902e 2008-04-29T00:24:00 test some primitives from http.c svn:r739
Nick Mathewson 49868b61 2008-04-25T01:18:08 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
Nick Mathewson a55a67d5 2008-04-18T13:46:13 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
Nick Mathewson 8863ff76 2008-04-17T19:19:36 r15224@tombo: nickm | 2008-04-17 15:19:24 -0400 Oops. We need to make sure that strdup wasn't oom. svn:r718
Nick Mathewson ae09ac4a 2008-04-17T19:18:40 r15220@tombo: nickm | 2008-04-17 15:16:02 -0400 Use new includes in more files still svn:r717
Nick Mathewson fc41ffde 2008-04-17T15:50:28 r15214@tombo: nickm | 2008-04-17 11:47:10 -0400 Make name_from_addr() threadsafe in http.c svn:r713
Niels Provos 558de9b3 2008-03-02T21:18:33 Provide OpenSSL style support for multiple threads accessing the same event_base svn:r684
Nick Mathewson 593b5f99 2008-02-29T22:33:01 r18492@catbus: nickm | 2008-02-29 17:32:55 -0500 Add another missing _REENTRANT. svn:r681
Niels Provos 5c70ea4c 2008-02-28T02:47:43 improved code for evbuffer; avoids memcpy svn:r674
Nick Mathewson e7ad5493 2008-02-26T20:24:29 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
Niels Provos 7470ce52 2008-02-26T03:49:00 increase listen queue for http sockets to 128 svn:r669
Niels Provos 960be588 2008-02-26T03:29:36 deal correctly with http/1.0 and keep-alive svn:r667
Niels Provos 0b114da2 2008-02-26T03:12:07 introduce evhttp_accept_socket() to accept from an already created socket svn:r666
Niels Provos b14cd655 2008-02-25T07:49:22 add support (without tests!) to PUT/DELETE requests; from Josh Rotenberg svn:r662
Nick Mathewson d47907a7 2008-02-16T20:50:02 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