114 Commits

Author SHA1 Message Date
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
Niels Provos
fdafb66bb5 removed linger from http server socket; reported by Ilya Martynov
svn:r604
2007-12-19 06:33:05 +00:00
Nick Mathewson
77861fa7f1 r16931@catbus: nickm | 2007-12-06 14:19:58 -0500
Fix warnings in debug messages


svn:r577
2007-12-06 19:20:24 +00:00
Nick Mathewson
3206bbca46 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
2007-12-06 18:12:56 +00:00
Nick Mathewson
5482192bb3 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
2007-12-06 04:36:18 +00:00
Niels Provos
74b3db50ae always generate Date and Content-Length headers for HTTP/1.1
svn:r564
2007-11-29 06:08:24 +00:00
Nick Mathewson
a7a7a19045 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
2007-11-26 19:25:09 +00:00
Nick Mathewson
ce4ee418d2 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
2007-11-26 19:18:49 +00:00
Nick Mathewson
1120f04f3e 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
2007-11-25 21:53:06 +00:00
Nick Mathewson
6773a59721 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
2007-11-25 21:32:26 +00:00
Nick Mathewson
7eb250e9c5 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
2007-11-25 17:14:19 +00:00
Nick Mathewson
4e1ec3e05e 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
2007-11-07 21:01:26 +00:00
Nick Mathewson
e72661d2ff r16509@catbus: nickm | 2007-11-07 02:08:32 -0500
Stop using C++ style comments.


svn:r497
2007-11-07 07:33:31 +00:00
Nick Mathewson
1f50f41283 r16508@catbus: nickm | 2007-11-07 02:01:03 -0500
Note a dubious point in http.c


svn:r496
2007-11-07 07:33:26 +00:00
Nick Mathewson
7feba57010 r16507@catbus: nickm | 2007-11-07 01:34:55 -0500
Never assign a string constant to a non-const char *.


svn:r495
2007-11-07 07:33:21 +00:00
Nick Mathewson
a3f122d667 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
2007-11-07 07:33:16 +00:00
Nick Mathewson
f74e7258fd r16501@catbus: nickm | 2007-11-07 01:00:31 -0500
This is one of those patches which will either make matters far
 simpler after the bugs shake out, or will get reverted pretty quick
 once we realize that it is a stupid idea.
 
 We now post-process the config.h file into a new event-config.h file,
 whose macros are prefixed with _EVENT_ and which is thus safe for
 headers to include.  Using this, we can define replacement timeval
 manipulation functions in evutil.h, and use them uniformly through our
 code.  We can also detect which headers are needful in event.h, and
 include them as required.
 
 This is also the perfect time to remove the long-deprecated acconfig.h
 file, so that autoheader no longer warns.
 
 Should resolve the following issues:
 
 [ 1826530 ] Header files should have access to autoconf output.
 [ 1826545 ] acconfig.h is deprecated.
 [ 1826564 ] On some platforms, event.h can't be included alone.
 


svn:r492
2007-11-07 06:01:57 +00:00
Niels Provos
2026b21598 remove last vestiges of RBTREE
svn:r470
2007-11-03 23:53:49 +00:00
Nick Mathewson
49ede3be00 r15517@catbus: nickm | 2007-10-03 13:14:05 -0400
Correct the pointer manipulation in fake_getaddrinfo(), and do the right thing for fake_getaddrinfo(NULL,&ai).  Based on a patch by Lubmir Marinov, hacked until the unit tests passed on Linux with #undef HAVE_GETADDRINFO.


svn:r459
2007-10-03 17:19:22 +00:00
Nick Mathewson
bc7b7c249c Fix implementation of strsep.
svn:r457
2007-10-03 04:14:54 +00:00
Nick Mathewson
fe4829776b r15324@catbus: nickm | 2007-09-24 12:22:21 -0400
New evutil.h macros to manipulate winsock errors.  Use them in http.c and in evutil_socketpair().


svn:r451
2007-09-24 16:26:11 +00:00
Nick Mathewson
d85bce4e96 Remove gratuitous tor-isms in evutil_socketpair(); fix a windows warning in http.c.
svn:r446
2007-09-20 18:38:31 +00:00
Nick Mathewson
8b256b8e86 r15218@catbus: nickm | 2007-09-20 14:14:05 -0400
More win32 fixes: Use evutil_make_socket_nonblocking and EVUTIL_CLOSESOCKET consistently throughout the code.


svn:r443
2007-09-20 18:26:51 +00:00
Niels Provos
b835ee085f fix http.c to compile properly with USE_DEBUG; from Christopher Layne
svn:r430
2007-09-15 15:50:11 +00:00
Niels Provos
e2f564116e Fix a memory leak in which failed HTTP connections whould not free the request object
svn:r419
2007-09-09 02:33:10 +00:00
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