http.c


Log

Author Commit Date CI Message
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
Nick Mathewson 677a9586 2008-02-16T16:56:34 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
Niels Provos 2fde2217 2008-02-09T16:03:01 address some compiler warnings in debug mode svn:r630
Niels Provos 955c6abf 2007-12-28T00:36:47 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
Niels Provos fdafb66b 2007-12-19T06:33:05 removed linger from http server socket; reported by Ilya Martynov svn:r604
Nick Mathewson 77861fa7 2007-12-06T19:20:24 r16931@catbus: nickm | 2007-12-06 14:19:58 -0500 Fix warnings in debug messages svn:r577
Nick Mathewson 3206bbca 2007-12-06T18:12:56 r15171@tombo: nickm | 2007-12-06 12:47:47 -0500 Use GCC attributes (where available) to verify printf type-correctness. Fix some bugs this turned up. svn:r573
Nick Mathewson 5482192b 2007-12-06T04:36:18 r15166@tombo: nickm | 2007-12-05 23:35:10 -0500 Apply patch from bug 1841036: set the base of the correct event in evhttp_connection_start_detectclose() svn:r571
Niels Provos 74b3db50 2007-11-29T06:08:24 always generate Date and Content-Length headers for HTTP/1.1 svn:r564
Nick Mathewson a7a7a190 2007-11-26T19:25:09 r16735@catbus: nickm | 2007-11-26 14:24:58 -0500 Fix test for EVBUFFER_LENGTH in evhttp_make_header(). Since appending an empty buffer to another is a no-op, this is not really a bug-fix. svn:r554
Nick Mathewson ce4ee418 2007-11-26T19:18:49 r16733@catbus: nickm | 2007-11-26 14:18:25 -0500 Add an --enable-gcc-warnings option (lifted from Tor) to the configure script. When provided, and when we are using GCC, we enable a bunch of extra GCC warnings in the compiler. Also, make the code all build happily with these warnings. svn:r553
Nick Mathewson 1120f04f 2007-11-25T21:53:06 r16731@catbus: nickm | 2007-11-25 16:52:53 -0500 Replace all fds on non-unix-specific APIs with evutil_socket_t, which is int on unix and intptr_t on win32. svn:r552
Nick Mathewson 6773a597 2007-11-25T21:32:26 r14953@tombo: nickm | 2007-11-25 15:56:40 -0500 Replace evbuffer_readline with a more powerful evbuffer_readln that can handle more EOL styles, and that can give useful results when there are NUL characters inside the returned values. Includes regression tests. svn:r550
Nick Mathewson 7eb250e9 2007-11-25T17:14:19 r14939@tombo: nickm | 2007-11-25 11:59:26 -0500 New function event_set_mem_functions to replace internal calls to malloc, free, etc with a user-supplied functions. svn:r541
Nick Mathewson 4e1ec3e0 2007-11-07T21:01:26 Make all the C files in the libraries compile under MSVC 2005 Express. There are still a few warnings, and probably some subtle issues, but it's better than nothing. svn:r499
Nick Mathewson e72661d2 2007-11-07T07:33:31 r16509@catbus: nickm | 2007-11-07 02:08:32 -0500 Stop using C++ style comments. svn:r497
Nick Mathewson 1f50f412 2007-11-07T07:33:26 r16508@catbus: nickm | 2007-11-07 02:01:03 -0500 Note a dubious point in http.c svn:r496
Nick Mathewson 7feba570 2007-11-07T07:33:21 r16507@catbus: nickm | 2007-11-07 01:34:55 -0500 Never assign a string constant to a non-const char *. svn:r495
Nick Mathewson a3f122d6 2007-11-07T07:33:16 r16506@catbus: nickm | 2007-11-07 01:29:59 -0500 Make all rpc and http functions not prototyped in evrpc.h and evhttp.h into static functions. I believe that these functions were meant to be private, yes? svn:r494