test/regress_http.c


Log

Author Commit Date CI Message
Nick Mathewson ec347b92 2010-07-07T16:45:03 Move event-config.h to include/event2 This change means that all required include files are in event2, and all files not in event2/* are optional.
Nick Mathewson 96730d31 2010-04-23T23:13:26 Make http_base_test stop leaking an event_base.
Sebastian Sjöberg 899c1dcc 2010-04-14T15:42:57 Replace EVUTIL_CLOSESOCKET macro with a function The EVUTIL_CLOSESOCKET() macro required you to include unistd.h in your source for POSIX. We might as well turn it into a function: an extra function call is going to be cheap in comparison with the system call. We retain the EVUTIL_CLOSESOCKET() macro as an alias for the new evutil_closesocket() function. (commit message from email by Nick and Sebastian)
Nick Mathewson 274a7bd9 2010-03-13T00:55:39 Fix some memory leaks in the unit tests These don't matter except inasmuch as they give real memory leaks a place to hide. Found with valgrind
Nick Mathewson 2c2618d8 2010-03-05T13:00:15 more whitespace normalization
Nick Mathewson c7cf6f00 2010-03-05T12:47:46 Replace users of "int fd" with "evutil_socket_t fd" in portable code Remeber, win32 has a socket type that's actually a handle, so if there's a chance that code is run on win32, we can't use "int" as the socket type. This isn't a blind search-and-replace: sometimes an fd is really in fact for a file, and not a socket at all.
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Nick Mathewson e5bbd40a 2010-02-18T17:41:15 Clean up formatting: use tabs, not 8-spaces, to indent.
Nick Mathewson 8fdf09c0 2010-02-18T17:08:50 Clean up formatting: Disallow space-before-tab.
Niels Provos 2f782af3 2010-02-13T17:04:17 validate close cb on server when client connection closes
Niels Provos e8a9782c 2010-02-13T16:59:37 clean up terminate_chunked test
Niels Provos 93d73691 2010-02-03T14:34:56 do not fail while sending on http connections the client closed. when sending chunked requests via multiple calls to evhttp_send_reply_chunk, the client may close the connection before the server is done sending. this used to cause a crash. we introduce a new function evhttp_request_get_connection() that allows the server to determine if the request is still associated with a connection. If it's not, evhttp_request_free() needs to be called explicitly or the user can call evhttp_send_reply_end() which just frees the request, too.
Nick Mathewson 5c7a7bca 2010-01-23T20:07:05 Fix windows and msvc build
Niels Provos 78a50fe0 2010-01-14T17:39:54 forgot to add void to test function
Niels Provos 26714ca1 2010-01-14T17:05:00 add a test for evhttp_connection_base_new with a dns_base
Pavel Plesov 6cc79c6b 2010-01-11T19:04:11 Add unit-test for bad_request bug fixed in 1.4 recently. This is a partial forward-port from 4fd2dd9d83a000b6. There's no need to forward-port the bugfix, since the test passes with http.c as-is. I believe we fixed this while we were porting evhttp to bufferevent. --nickm
Nick Mathewson 7ae94450 2009-12-04T16:37:43 Fix a snow leopard compile warning in the unit tests. Reported by Sebastian Hahn.
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 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 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 0fd0255f 2009-11-03T19:54:56 Remove compat/sys/_time.h I've gone through everything that it declared to see where it was used, and it seems that we probably don't need it anywhere. Here's what it declared, and why I think we're okay dropping it. o struct timeval {} (Used all over, and we can't really get away with declaring it ourselves; we need the same definition the system uses. If we can't find struct timeval, we're pretty much sunk.) o struct timespec {} (Used in event.c, evdns.c, kqueue.c, evport.c. Of these, kqueue.c and event.c include sys/_time.h. event.c conditions its use on _EVENT_HAVE_CLOCK_GETTIME, and kqueue() only works if timespec is defined.) o TIMEVAL_TO_TIMESPEC (Used in kqueue.c, but every place with kqueue has sys/time.h) o struct timezone {} (event2/util.h has a forward declaration; only evutil.c references it and doesn't look at its contents.) o timerclear, timerisset, timercmp, timeradd, timersub (Everything now uses the evutil_timer* variants.) o ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF, struct itemerval (These are only used in test/regress.c, which does not include _time.h) o CLOCK_REALTIME (Only used in evdns.c, which does not include _time.h) o TIMESPEC_TO_TIMEVAL o DST_* o timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub o struct clockinfo {} o CLOCK_VIRTUAL, CLOCK_PROF o TIMER_RELTIME, TIMER_ABSTIME (unused) svn:r1494
Nick Mathewson 5b5b880b 2009-07-28T19:41:39 Various MSVC cleanups from Brodie Thiesfield. svn:r1385
Nick Mathewson 5d71b25b 2009-07-17T18:38:38 Remove all trailing whitespace from end-of-line. svn:r1350
Nick Mathewson 043515bc 2009-07-14T18:50:06 Stop using C++ style comments. svn:r1343
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 ea664bf2 2009-04-21T18:46:30 Refactor test wrappers to divide legacy items from useful stuff. svn:r1212
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 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 ea11f819 2009-02-02T22:17:32 Compile http_connection_retry_test, but mark it skipped on win32. svn:r1099
Nick Mathewson eac75f91 2009-01-31T07:32:14 Port DNS tests. svn:r1081
Nick Mathewson 4ec690d3 2009-01-31T05:45:16 Rename a couple of http tests so they all end with _test. This lets us simplify the naming. svn:r1077
Nick Mathewson 153093ec 2009-01-30T17:44:13 Port the HTTP unit tests. Most are still legacy (since they use test_ok so much), but at least they no longer exit(1) on failure svn:r1076
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 a077fb8c 2009-01-22T02:47:35 rename sys/signal.h to signal.h; configure m4 macro dir; this assist with compilation on Haiku svn:r1033
Nick Mathewson 169321c9 2009-01-13T20:26:37 Rename four internal headers to follow the -internal.h convention. svn:r1000
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 ebcf5efc 2008-12-19T22:42:51 fix memory leaks in the regression tools; add another close detection test that validates that there are no dangling connections on the server svn:r969
Niels Provos ffb3966e 2008-11-27T19:34:07 minor compilation and regresson fixes; from Frank Denis svn:r952
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 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 ac0c7e2c 2008-06-25T00:58:08 skip connection-retry test on windows svn:r869
Niels Provos f80f90ed 2008-06-24T21:01:44 fix a bug in http_connect for windows; the address was not copied correctly. svn:r863
Niels Provos 994a7c50 2008-06-24T16:39:45 close -> EVUTIL_CLOSESOCKET() gettimeofday -> evutil_gettimeofday() svn:r861
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 89a1512a 2008-05-15T06:33:23 close -> EVUTIL_CLOSESOCKET svn:r832
Nick Mathewson 0cafdeb6 2008-05-12T17:16:47 Tweaks to make unit tests fail less badly on mingw on trunk. svn:r814
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
Niels Provos 950af186 2008-05-10T05:58:17 replace fnmatch with homegrown function svn:r804
Nick Mathewson f2d65f8a 2008-05-07T20:29:33 r19634@catbus: nickm | 2008-05-07 16:10:37 -0400 the C syntax is fn(void), not fn(). svn:r784
Niels Provos 300a4efb 2008-05-07T01:52:24 test virtual hosts svn:r780
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 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 0ec09b55 2008-04-29T04:35:26 also try client connection for chunked requests svn:r741
Niels Provos 9c480533 2008-04-29T02:33:27 test the server side of sending chunked replies svn:r740
Niels Provos 72a3902e 2008-04-29T00:24:00 test some primitives from http.c svn:r739
Niels Provos 22c8a404 2008-04-27T20:04:33 test connection retry logic svn:r736
Niels Provos 7b29ad57 2008-04-27T19:41:26 test server behavior when connection times out while reading the headers svn:r735
Niels Provos eb9b9580 2008-02-27T06:20:48 add some basic tests for DELETE/PUT; from Josh Rotenberg svn:r673
Niels Provos 024804cc 2007-12-28T07:58:29 the win32 changes for regress_http broke the regression test under unix. making the socket non-blocking can return -1 on connect; so now, we need to check the errno; not sure if that is supported under windows. svn:r621
Nick Mathewson 6d291da2 2007-12-28T00:34:05 Fix at least two bugs that are keeping the HTTP regression tests from running on windows. There are some more bugs somewhere, since the HTTP regression tests still fail on windows. But now they fail less. svn:r619
Niels Provos 74b3db50 2007-11-29T06:08:24 always generate Date and Content-Length headers for HTTP/1.1 svn:r564
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 1e1f77c5 2007-09-20T19:08:20 Make the test/ subdirectory buildable under Windows. Well, mingw at least. The tests still don't all pass, but at least now we know that. svn:r447
Niels Provos e678f009 2007-09-09T01:46:35 fix a couple memory leaks; time buffer marshaling svn:r417
Niels Provos 98f9616b 2007-09-07T02:49:46 support setting local address on an evhttp_connection svn:r416
Niels Provos 67947ce3 2007-08-19T02:41:23 provide evhttp_new and evhttp_bind_socket instead of evhttp_start; using evhttp_new, it is possible to associate an event_base with the http server so that multi-threaded applications can have their own http server per thread; add appropriate testing. svn:r397
Nick Mathewson 35983cd6 2007-08-16T21:12:53 r14618@catbus: nickm | 2007-08-16 17:11:47 -0400 In ANSI C, int func() is a function with unspecified arguments, whereas int func(void) is a function that takes no arguments. Using int func() to mean a function with no arguments is a C++ism, so let's not use or generate it. svn:r395
Niels Provos cd6dd951 2007-08-06T21:00:49 add a proper test for filtering new lines in headers svn:r384
Niels Provos 073d3590 2007-08-06T20:53:33 fix an embarassing bug where strchr was used with a cstring instead of a char svn:r383
Niels Provos 8ea5ffef 2007-08-05T02:15:10 request dispatching fix from Elliot Foster svn:r382
Niels Provos 72c479e7 2007-07-30T23:54:25 remove c99 variable declarations; from Jan Kneschke svn:r374
Niels Provos f0ff792a 2007-06-30T18:58:34 fixes from Joerg Sonnenberger: http.c is a violation of the ctype(3) interface and an unused function. test/regress_http.c are incorrect format strings. test/regress.c uses raise(3) from signal.h. evdns.c: evdns_error_strings is unused. The GET* macros can eat the semicolon from the expression. pos is passed in as off_t, so just pass that down. When assigning negativ values to unsigned variables, an explicit cast is considered good style. svn:r367
Niels Provos b5d2f9a2 2007-03-01T06:25:18 rolling back r339: evconfig.h does not work svn:r341
Niels Provos 127c260b 2007-02-28T04:02:29 make evconfig.h available as installed header file; not really ideal but good enough for me; from Nick Mathewson svn:r339
Niels Provos d5d04949 2007-01-18T06:28:42 fix http server so it can accept on high ports; better warning messages for getnameinfo; from Philip Lewis svn:r310
Niels Provos 0db257b8 2007-01-03T07:11:17 rename strlcpy so that it does not conflict with other tests; from Nick Mathewson. svn:r306
Niels Provos 942656bb 2006-11-23T06:32:20 persistent connections are somewhat complicated; detect on the client side if the server closes a persistent connection. previously, we would have failed the next request on that connection. provide test case. svn:r277
Niels Provos 31ba30ab 2006-11-18T08:51:12 make regression test work for poll and select svn:r265
Niels Provos 9d81ac48 2006-11-18T03:43:26 test both piplining on persistent and non-persistent connections svn:r262
Niels Provos 36212f9d 2006-11-18T03:05:26 make persistent connections work; needs more testing svn:r261
Niels Provos a67d9cb1 2006-11-17T07:45:42 add "Connection: close" to the output headers of the HTTP server reply; we don't currently support persistent connections; although that's going to be easy to add. svn:r259
Niels Provos c4836d10 2006-11-17T06:06:17 make sure that the rpc callback receives an unmarshaled payload; make sure that the rpc reply contains a good rpc structure, too. svn:r258
Niels Provos f554234f 2006-11-16T07:36:20 first stab at an rpc layer; this breaks the regression test. svn:r254
Niels Provos 3eec7f7c 2006-10-15T21:55:13 make it 1.2; fix some size issues for printf in regression code svn:r242
Niels Provos 296739e0 2006-08-13T00:03:35 fix regression test svn:r223
Niels Provos ba7262eb 2006-07-17T00:33:57 reorganization of the http functionality; we separate http handling into a connection object and a request object; also make it clear which buffers are used for input and output; unittests not complete yet. svn:r217
Niels Provos 6813af3f 2006-06-10T22:37:21 move http related prototypes to evhttp.h svn:r214
Niels Provos 147b71e3 2006-06-10T22:28:21 rename http.h to http-internal.h - i wish there were decent refactoring tools for open source programmers. svn:r213
Niels Provos 38b33048 2006-02-27T02:27:37 make a simple test for HTTP POST requests svn:r205
Niels Provos 896bf3a2 2006-02-13T02:22:48 many changes for fixing a small bug: post requests would not send the post data. I took the opportunity to reorganize a bit. svn:r201