util-internal.h


Log

Author Commit Date CI Message
Nick Mathewson 94866c27 2012-11-01T17:38:34 Compile without warnings on mingw64 This is mostly a matter of catching cases where we were still assuming that evutil_socket_t could be used as an int.
Nick Mathewson 03dce42d 2012-02-11T21:17:18 Tweak the evutil_open_closeonexec patch to work on windows, old unixes. Windows doesn't have a mode_t as far as I can tell. Some unixes, iirc, don't like three-argument open without O_CREAT.
Ross Lagerwall d2b5f722 2012-02-11T17:23:17 Make uses of open() close-on-exec safe by introducing evutil_open_closeonexec. In a multi-process/threaded environment, opening fds internally without the close-on-exec flag could leak fds to child processes.
Nick Mathewson e49e2891 2012-02-10T17:29:53 Update copyright notices to 2012
Nick Mathewson 3c824bd3 2011-10-24T13:18:09 Update copyright dates to 2011.
Nick Mathewson 3203f88c 2011-06-08T17:18:03 Use the correct printf args when formatting size_t Based on a patch from Mansour Moufid
Dave Hart 09d39a12 2011-05-20T14:18:08 Fix compilation with GCC 2, which had no __builtin_expect
Nick Mathewson 713c254d 2011-01-24T18:55:10 Try to build correctly on platforms with no IPv6 support
Nick Mathewson 9184563e 2011-01-24T18:29:20 Build correctly on platforms without sockaddr_storage
Nick Mathewson cb8059d2 2011-01-01T21:37:21 Fix compilation on Windows with NDEBUG Dongsheng Song reports that when building on windows with NDEBUG, you run into an attempt to do EVUTIL_ASSERT(x) where x is a bitfield, which turns into _EVUTIL_NIL_CONDITION(x), which takes sizeof(x), which is illegal. This patch fixes _EVUTIL_NIL_CONDITION to work on bitfields too.
Evan Jones b63ab177 2010-12-06T14:17:44 EVUTIL_ASSERT: Use sizeof() to avoid "unused variable" warnings.
Nick Mathewson 145f221e 2010-10-05T13:06:32 Define symbolic constants to use in place of SHUT_RD etc
Nick Mathewson d49b5e33 2010-09-27T15:12:55 Do not search outside of the system directory for windows DLLs Hardens against some attacks.
Nick Mathewson 1fdec20f 2010-09-01T15:01:39 Stop using global arrays to implement the EVUTIL_ctype functions These apparently made libtool sad on win32, and the function call overhead here should be negligable anyway.
Nick Mathewson 743f8665 2010-08-23T11:48:46 Honor NDEBUG; build without warnings with NDEBUG; make NDEBUG always-off in unit test code
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 57b30cd7 2010-08-06T13:01:32 Turn our socketpair() replacement into its own function This patch splits the formerly windows-only case of evutil_socketpair() into an (internal-use-only) function named evutil_ersatz_socketpair(), and makes it build and work right on non-Windows hosts. We need this for convenience to test sendfile on solaris, where socketpair can't give you an AF_INET pair, and sendfile() won't work on AF_UNIX.
Nick Mathewson 20fda296 2010-05-03T13:00:00 Try /proc on Linux as entropy fallback; use sysctl as last resort It turns out that the happy fun Linux kernel is deprecating sysctl, and using sysctl to fetch entropy will spew messages in the kernel logs. Let's not do that. Instead, let's call sysctl for our entropy only when all other means fail. Additionally, let's add another means, and try /proc/sys/kernel/random/uuid if /dev/urandom fails.
Nick Mathewson b1c79500 2010-04-23T14:42:25 Make evdns logging threadsafe The old logging code was littered with places where we stored messages in static char[] fields. This is fine in a single-threaded program, but if you ever tried to log evdns messages from two threads at once, you'd hit a race. This patch also refactors evdns's debug_ntop function into a more useful evutil_sockaddr_port_format() function, with unit tests.
Christopher Davis 850c3ff2 2010-03-31T20:30:55 Add evutil_tv_to_msec for safe conversion of timevals to milliseconds. This is useful for backends that require their timeout values be in milliseconds.
Nick Mathewson 2c2618d8 2010-03-05T13:00:15 more whitespace normalization
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Niels Provos 7bc48bfd 2010-02-27T18:59:06 deal with connect() failing immediately
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.
Nick Mathewson aba1fff3 2010-02-03T14:37:42 Add EV_*_MAX macros to event2/util.h to expose limits for ev_* types.
Nick Mathewson 918e9c5e 2010-01-23T16:38:36 Fix a number of warnings from gcc -pedantic
Nick Mathewson 8d4aaf90 2010-01-20T12:56:54 Don't use a bind address for nameservers on loopback If the user sets a bind address to use for nameservers, and a nameserver happens to be on 127.0.0.1, the nameserver will generally fail. This patch alters this behavior so that the bind address is only applied when the nameserver is on a non-loopback address.
Nick Mathewson 0f7144fd 2009-12-07T17:21:13 Refactor code from evdns into a new internal "read a file" function.
Nick Mathewson eaaf27f1 2010-01-06T18:41:46 Enable branch-prediction hints with EVUTIL_UNLIKELY. This had been accidentally disabled. Since it seems to work with GCC, I'm turning it back on when GCC is present.
Nick Mathewson 165d30e3 2009-12-30T14:29:56 Fix compilation of rate-limiting code on win32.
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 629a6133 2009-11-15T18:59:59 When running set[ug]id, don't check the environment. Idea from OpenBSD, but made a bit more generic to handle uncivilized lands that do not define issetugid. svn:r1530
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 0b9eb1bf 2009-11-03T20:40:48 Add a bufferevent function to resolve a name then connect to it. This function, bufferevent_socket_connect_hostname() can either use evdns to do the resolve, or use a new function (evutil_resolve) that uses getaddrinfo or gethostbyname, like http.c does now. This function is meant to eventually replace the hostname resolution mess in http.c. svn:r1496
Nick Mathewson 8283b2f0 2009-11-02T19:30:25 Fix a major parenthesis bug in EVUTIL_UPCAST. Fortunately, this didn't hurt anything previously, since we had no actual users of the macro where the offset of the base type wasn't 0. svn:r1488
Nick Mathewson 37c3456d 2009-10-26T20:00:08 Add an EVUTIL_ASSERT() to replace our calls to assert(). The big difference here is that EVUTIL_ASSERT() passes its message on via event_errx() before aborting, so that the application has a prayer of noticing and recording it. svn:r1463
Nick Mathewson 25af6954 2009-10-14T00:46:47 When a bufferevent_connect() call fails, give the client an error callback. Patch from Christopher Davis. svn:r1444
Nick Mathewson 72ea534f 2009-07-28T19:41:57 Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp. svn:r1387
Nick Mathewson 709c21c4 2009-07-28T04:03:57 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
Nick Mathewson 0b22ca19 2009-05-22T19:11:48 Use ev_ssize_t in place of ssize_t *everywhere*. svn:r1309
Nick Mathewson f11dff2c 2009-05-07T03:45:51 Add and use locale-independent strcasecmp functions. svn:r1280
Nick Mathewson b2e8fd0e 2009-04-30T23:56:53 Apparently MSVC lacks a ssize_t. Define an ev_ssize_t for headers, and make ssize_t work elsewhere. svn:r1261
Nick Mathewson ebf29455 2009-04-30T23:49:15 Compilation fixes for vc++ 2008 express. Not the end of them. svn:r1260
Nick Mathewson 838d0a81 2009-04-17T06:55:08 Document many internal functions and pieces of code. svn:r1181
Nick Mathewson 0b47b125 2009-04-12T22:02:54 Add a new EVUTIL_UPCAST macro so that I do not need to keep figuring out the right offsetof magic over and over. svn:r1160
Nick Mathewson bbd6a332 2009-04-12T22:02:12 reindent macros in util-internal.h svn:r1159
Nick Mathewson 661b5eea 2009-04-05T04:10:05 Actually, move EVUTIL_NIL_STMT to util-internal.h svn:r1135
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 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 9935d5b0 2009-01-13T21:39:32 Fix win32 compilation. Surprisingly, unit tests pass too. svn:r1002
Nick Mathewson 574d3202 2009-01-13T20:50:34 There is no WSAEAGAIN. There is only Zuul^WSAEWOULDBLOCK. svn:r1001
Nick Mathewson 5ebd23ad 2009-01-13T19:19:50 New EVUTIL_ERR_*_RETRIABLE macros to tell if an errno blocked or failed. svn:r994