69 Commits

Author SHA1 Message Date
Niels Provos
98f9616bf4 support setting local address on an evhttp_connection
svn:r416
2007-09-07 02:49:46 +00:00
Nick Mathewson
23866b7657 Another tweak on the date patch: win32 has no gmtime_r, but its gmtime() function uses thread-local storage for safety. Backportable.
svn:r414
2007-09-07 01:18:53 +00:00
Nick Mathewson
003698c0df r14975@catbus: nickm | 2007-09-06 21:00:38 -0400
Oops; we were already including sys/time.h.  Remove the redundant include.


svn:r413
2007-09-07 01:03:01 +00:00
Nick Mathewson
8d5ef326ba r14974@catbus: nickm | 2007-09-06 20:59:14 -0400
Changes to http.c: Add a Date header on replies if there is none already set.  Also, include time.h unconditionally to be sure that struct tm is declared: every platform has time.h; the conditional should have been for sys/time.h.


svn:r412
2007-09-07 01:02:56 +00:00
Niels Provos
ff9e1af68f demote most warnings to debug messages;
execute callback later to allow freeing of connection object


svn:r407
2007-09-02 01:33:38 +00:00
Niels Provos
11a0a9e42f allow \r or \n individually to separate HTTP headers instead of
the standard "\r\n"; from Charles Kerr.


svn:r406
2007-08-25 18:47:22 +00:00
Niels Provos
67947ce381 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
2007-08-19 02:41:23 +00:00
Niels Provos
cd6dd9516d add a proper test for filtering new lines in headers
svn:r384
2007-08-06 21:00:49 +00:00
Niels Provos
073d359061 fix an embarassing bug where strchr was used with a cstring instead of a char
svn:r383
2007-08-06 20:53:33 +00:00
Niels Provos
8ea5ffefc3 request dispatching fix from Elliot Foster
svn:r382
2007-08-05 02:15:10 +00:00
Niels Provos
b7ff0248c7 fix memory leak; found by Elliot F
svn:r378
2007-07-31 00:32:00 +00:00
Niels Provos
3ad6b47e03 make clock_monotonic work; do not use default timeout;
from Scott Lamb, plus some fixes from me.


svn:r371
2007-07-30 22:41:00 +00:00
Niels Provos
d7918e7963 drop illegal header values
svn:r370
2007-07-30 21:27:33 +00:00
Niels Provos
f0ff792afa 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
2007-06-30 18:58:34 +00:00
Niels Provos
aa5c806888 make it compile on solaris; from Andrei Nigmatulin
svn:r366
2007-06-16 03:23:15 +00:00
Niels Provos
cf5c1fcebb made the wrong fd non-blocking in accept_socket; from szjwwu
svn:r364
2007-06-08 16:06:23 +00:00
Niels Provos
0c2808246a support removing of http callbacks and removing of registered RPCs
svn:r355
2007-05-23 05:20:59 +00:00
Niels Provos
5b5400f66b permit connection free from callback; from Ben Rigas
svn:r354
2007-05-12 06:23:52 +00:00
Niels Provos
a968da7425 split finding of callbacks out of code
svn:r350
2007-03-06 06:26:10 +00:00
Niels Provos
b5d2f9a255 rolling back r339: evconfig.h does not work
svn:r341
2007-03-01 06:25:18 +00:00
Niels Provos
127c260bb7 make evconfig.h available as installed header file; not
really ideal but good enough for me; from Nick Mathewson


svn:r339
2007-02-28 04:02:29 +00:00
Niels Provos
995a58a374 missing return (-1) for failures on make_socket
svn:r338
2007-02-27 08:16:50 +00:00
Niels Provos
4356b68133 remove redundant \n from event_warn
svn:r336
2007-02-20 03:35:31 +00:00
Niels Provos
06d0f8c082 O(n^2) is bad
svn:r332
2007-02-16 08:48:55 +00:00
Niels Provos
fe2662384d try to make it work with proxy-connections
svn:r329
2007-02-15 02:16:07 +00:00
Niels Provos
58f42c79e7 fix handling of chunked requests
svn:r328
2007-02-14 16:59:47 +00:00
Niels Provos
8901c141c9 make chunked requests work correctly; this is done by providing
a separate callback for invidiual chunks.  if this callback is
not set, all the data is going to be delivered at the end.


svn:r327
2007-02-14 06:10:32 +00:00
Niels Provos
36950cef58 close connections for http/1.0 unless there is keep-alive
svn:r326
2007-02-13 06:25:16 +00:00
Niels Provos
19373b3dda when parsing query parameters, we automatically unquote them
svn:r325
2007-02-13 06:14:42 +00:00
Niels Provos
9a65d0135f set content length even if content-type is specified
svn:r324
2007-02-11 07:58:39 +00:00
Niels Provos
bfb9f44f37 make mingw happy; from Nick Mathewson
svn:r322
2007-02-09 07:49:55 +00:00
Niels Provos
22e53c7a84 make it work on freebsd; from phil oleson
svn:r314
2007-01-27 04:10:08 +00:00
Niels Provos
d5d04949e3 fix http server so it can accept on high ports;
better warning messages for getnameinfo;
from Philip Lewis


svn:r310
2007-01-18 06:28:42 +00:00
Niels Provos
ff12220703 make accept socket non-blocking; from dug song
svn:r309
2007-01-10 02:42:29 +00:00
Niels Provos
ba8289bea5 from dug song:
the original code failed in the case of a large single client
request+body write - for instance, over loopback (with a larger MTU
exceeding EVBUFFER_MAX_READ).



svn:r307
2007-01-04 18:05:17 +00:00
Niels Provos
0db257b828 rename strlcpy so that it does not conflict with other tests; from
Nick Mathewson.


svn:r306
2007-01-03 07:11:17 +00:00
Niels Provos
894b636543 fix a bug in an assert; from Weston Andros Adamson
svn:r305
2006-12-23 07:30:10 +00:00
Niels Provos
557e0f62be http chunking support from dug song;
some refactoring and extra error checking by me


svn:r304
2006-12-18 15:26:19 +00:00
Niels Provos
a91d2b2b8c do close-detection via a separate event
svn:r301
2006-12-12 03:51:30 +00:00
Niels Provos
04bdb2488c detect if a client to a streaming reply hangs up; from dug song
comments from me :-)


svn:r300
2006-12-09 05:14:37 +00:00
Niels Provos
de7db33a61 low-level interfaces for streaming; from dug song
i applied some bug fixes and slight re-arranged the logic
on when to call the close notification callback;
i also don't like the streaming interface; i'd rather
see it do the chunked response formatting explicitly.


svn:r298
2006-12-09 02:58:12 +00:00
Niels Provos
852d05a3c0 support retrying for connections; from dug song
small tweaks from me.


svn:r297
2006-12-09 01:41:57 +00:00
Niels Provos
2225eec22b decode uri when sending a request; from dug song
svn:r296
2006-12-09 01:33:03 +00:00
Niels Provos
785923704c fix a bug where event_set was called on a pending event;
don't read body for return codes that do not require a body;
from dug song.


svn:r294
2006-12-06 04:12:11 +00:00
Niels Provos
c6e285d31a allow gotsig to terminate active event loop;
free http connection on failed incoming connections;
bugs pointed out by Dug Song.


svn:r293
2006-12-06 03:38:41 +00:00
Niels Provos
ec0679199f fix cases where there is no content or transfer encoding was specified
from Dug Song


svn:r291
2006-12-02 21:28:39 +00:00
Niels Provos
942656bb5c 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
2006-11-23 06:32:20 +00:00
Niels Provos
2d028ef6c1 fix a bug where rpc would not be scheduled when they were queued; test for it.
allow a configurable timeout for connections and RPCs.


svn:r274
2006-11-22 06:54:28 +00:00
Niels Provos
ce436242ad an attempt at differentiated error handling for timeouts and eof.
really this needs to be propagated all the way to the callback.


svn:r273
2006-11-22 05:03:02 +00:00
Niels Provos
868f10e7c9 mingw fixes from Nick
svn:r271
2006-11-22 01:21:10 +00:00