163 Commits

Author SHA1 Message Date
Nick Mathewson
d41347722a Refactor evbuffer_readln() into a search-for-eol function and an extract-line function.
svn:r1404
2009-07-31 17:35:42 +00:00
Nick Mathewson
7c688dd9a2 New function to expose bufferevent.enabled
svn:r1401
2009-07-31 14:41:45 +00:00
Nick Mathewson
621aafd27a Export sockaddr comparison functionality.
svn:r1400
2009-07-30 22:11:23 +00:00
Nick Mathewson
eecefc50e7 Add a function to extract the SSL object from a bufferevent_openssl.
svn:r1395
2009-07-30 20:41:00 +00:00
Nick Mathewson
7c20a6ae52 Export an ev_socklen_t.
svn:r1391
2009-07-30 17:01:21 +00:00
Nick Mathewson
75fe762e03 Accessor function to get a listener's associated fd
svn:r1390
2009-07-30 17:00:56 +00:00
Nick Mathewson
72ea534f8e Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp.
svn:r1387
2009-07-28 19:41:57 +00:00
Nick Mathewson
5b5b880be7 Various MSVC cleanups from Brodie Thiesfield.
svn:r1385
2009-07-28 19:41:39 +00:00
Nick Mathewson
709c21c48c Bufferevent support for openssl.
This code adds a new Bufferevent type that is only compiled when the
openssl library is present.  It supports using an SSL object and an
event alert mechanism, which can either be an fd or an underlying
bufferevent.

There is still more work to do: the unit tests are incomplete, and we
need to support flush and shutdown much better.  Sometimes events are
generated needlessly: this will hose performance.

There's a new encrypting proxy in sample/le-proxy.c.

This code has only been tested on OSX, and nowhere else.

svn:r1382
2009-07-28 04:03:57 +00:00
Nick Mathewson
670658ebd7 Correct the signatures for evdns_configure_windows_nameservers(), now that it is exposed.
svn:r1369
2009-07-21 18:32:57 +00:00
Nick Mathewson
e8400a43ca Rename encode_int(64) to avoid polluting the global namespace.
They're now called evtag_encode_int(64).  The old names are available
as macros in event2/tag_compat.h.

Also, add unit tests for encode/decode_int64.

svn:r1365
2009-07-20 14:55:35 +00:00
Nick Mathewson
1fb2e818a6 Use a uniform strategy when a function is not working: do not expose
it.

Rather than failing at runtime, it is better to fail at compile or
link time.

svn:r1363
2009-07-17 21:47:45 +00:00
Nick Mathewson
d3bef1a1e3 Finish implementing new convention that whenever an optional function is declared, a corresponding macro is defined.
svn:r1361
2009-07-17 20:32:25 +00:00
Nick Mathewson
a386fde321 Checking for MS_WINDOWS rather than WIN32 is a Tor-ism. Fix that!
svn:r1360
2009-07-17 20:28:03 +00:00
Nick Mathewson
ed038295cd Define a macro to indicate that we have defined one of the optional evthread_use macros
svn:r1355
2009-07-17 20:22:48 +00:00
Nick Mathewson
5d71b25b51 Remove all trailing whitespace from end-of-line.
svn:r1350
2009-07-17 18:38:38 +00:00
Nick Mathewson
eb97bb76e1 Make the headers compile happily with pedantic C compilers.
Original message from SF patch 2797966:

    While commas at the end of enumerator lists are valid in c99, they
    are not valid +in c89 nor in c++. When using gcc/g++ with the
    -pedantic flag, users will +receive a warning (gcc) or an
    error(g++) when including the event2/event.h and
    +event2/bufferevent.h. The errors look something like

    event2/event.h:159: error: comma at end of enumerator list

Patch from Akita Noek on Sourceforge.

svn:r1321
2009-05-28 15:58:28 +00:00
Nick Mathewson
0b4ab12251 Spell-check the the headers
svn:r1320
2009-05-28 15:47:15 +00:00
Nick Mathewson
3f0e49283b small doc fix.
svn:r1319
2009-05-27 23:48:59 +00:00
Nick Mathewson
5232cfa357 Consistently say "eventcb" instead of "errorcb"
svn:r1316
2009-05-25 23:11:20 +00:00
Nick Mathewson
0b22ca1929 Use ev_ssize_t in place of ssize_t *everywhere*.
svn:r1309
2009-05-22 19:11:48 +00:00
Nick Mathewson
8997f234f2 Use the native "struct iovec" as our "struct evbuffer_iovec" when available, so we do not need to copy more pointers than necessary.
svn:r1299
2009-05-21 20:59:00 +00:00
Nick Mathewson
23243b8a98 Replace reserve/commit with new iovec-based interface. Add a new evbuffer_peek.
svn:r1296
2009-05-19 21:39:35 +00:00
Nick Mathewson
ed1bbc7a9f Tweak the evconnlistener interface a little.
svn:r1295
2009-05-18 16:15:56 +00:00
Nick Mathewson
dc4c7b9570 Change the interface of evbuffer_add_reference: give the cleanup function more info.
svn:r1294
2009-05-15 22:44:18 +00:00
Nick Mathewson
bba69e03f8 New semantics for evbuffer_cb_set_flags().
Previously, set_flags() would replace all previous user-visible flags.
Now it just sets the flags, and there is a clear_flags() function to
clear other flags.

svn:r1293
2009-05-15 20:23:59 +00:00
Nick Mathewson
b4886ec80d Trim 22 bytes from struct event on 32 bit platforms, more on 64-bit platforms.
svn:r1292
2009-05-15 18:44:44 +00:00
Nick Mathewson
27fef1ef26 Note problems with some newer evbuffer interfaces.
svn:r1286
2009-05-14 18:06:41 +00:00
Nick Mathewson
3e759a0172 Actually, do not provide a compatibility name "EVBUFFER_CONNECTED": there is no old code that uses it.
svn:r1285
2009-05-14 18:06:29 +00:00
Nick Mathewson
31d89f274b Add a "ctrl" mechanism to bufferevents for property access.
OpenSSL uses something like this to implement get/set access for
properties on its BIOs, so that it doesn't need to add a pair of
get/set functions to the vtable struct for every new abstract property
it provides an accessor for.

Doing this lets us make bufferevent_setfd abstract, and implement an
abstract bufferevent_getfd.

svn:r1284
2009-05-13 20:37:21 +00:00
Nick Mathewson
83f46e51d7 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
2009-05-13 20:36:56 +00:00
Nick Mathewson
6b21fe2be8 oops; do not forget to distribute listener.h
svn:r1273
2009-05-05 03:01:24 +00:00
Nick Mathewson
659d54d530 Add new code to make and accept connections.
This is stuff that it's easy to get wrong (as I noticed when writing
bench_http), and that takes up a fair amount of space (see http.c).
Also, it's something that we'll eventually want to abstract to use
IOCP, where available.

svn:r1272
2009-05-05 02:59:26 +00:00
Nick Mathewson
0fd70978c8 Add an event_get_base() function to remove one more reason to include event_struct.h
svn:r1271
2009-05-05 01:09:03 +00:00
Nick Mathewson
d5ca076379 Move event_set() and friends to event2/event_compat.h.
These functions are deprecated in favor of event_assign().

svn:r1267
2009-05-02 16:23:29 +00:00
Nick Mathewson
b2e8fd0e41 Apparently MSVC lacks a ssize_t. Define an ev_ssize_t for headers, and make ssize_t work elsewhere.
svn:r1261
2009-04-30 23:56:53 +00:00
Nick Mathewson
1959414120 Clarify semantics on event_pending()
svn:r1249
2009-04-29 20:48:21 +00:00
Niels Provos
a146af1db8 move more code directly into evrpc.c; provide backwards compatible vararg macros
svn:r1244
2009-04-25 00:15:55 +00:00
Niels Provos
b228ff91b8 remove vararg macros for accessing evrpc structs
svn:r1243
2009-04-25 00:15:31 +00:00
Niels Provos
bbf79707f9 refactor evrpc.h header filer
svn:r1241
2009-04-25 00:14:58 +00:00
Nick Mathewson
11ff74cf64 Add a flag to disable checking the EVENT_* environment variables.
svn:r1220
2009-04-22 19:41:23 +00:00
Nick Mathewson
ea8cc76cf8 Fix the documentation of event_pending.
svn:r1215
2009-04-21 18:47:23 +00:00
Nick Mathewson
eda27f9557 Update copyright notices, add some missing license statements
svn:r1208
2009-04-19 20:54:12 +00:00
Niels Provos
f00f0c2533 make doxygen happier
svn:r1199
2009-04-18 04:34:45 +00:00
Nick Mathewson
a98a512bc1 Add a generic way for any bufferevent to make its callback deferred
svn:r1197
2009-04-17 23:12:34 +00:00
Nick Mathewson
d047b323bd Increment version to 2.0.1-alpha, and add a numeric version facility
svn:r1193
2009-04-17 17:22:32 +00:00
Nick Mathewson
4935413842 Oh hey. There is no support for suspend/unsuspend.
svn:r1187
2009-04-17 06:57:13 +00:00
Nick Mathewson
7fa8451d7e Add a configure flag to hardcode all of our mm functions.
svn:r1186
2009-04-17 06:56:57 +00:00
Nick Mathewson
a8f6d961eb Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h
svn:r1183
2009-04-17 06:56:09 +00:00
Nick Mathewson
796ba15fc6 Stop claiming that APIs we have are missing.
svn:r1182
2009-04-17 06:55:25 +00:00