| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This change means that all required include files are in event2, and
all files not in event2/* are optional.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Everybody but Linux documents this as taking an int, and Linux is
very tolerant of getting an int instead. If it weren't, everybody
doing fcntl(fd,F_SETFL,O_NONBLOCK) would break, since the glibc
headers define O_NONBLOCK as an int literal.
|
|
|
|
| |
evutil_read_file would close the file if there was an error, but not if things went normally.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
It turns out that _REENTRANT isn't only needed to make certain
functions visible; we also need it to make pthreads work properly
some places (like Solaris, where forgetting _REENTRANT basically
means that all threads are sharing the same errno). Fortunately,
our ACX_PTHREAD() configure macro already gives us a PTHREAD_CFLAG
variable, so all we have to do is use it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Everybody else thinks that when you getaddrinfo() on an ip address
and don't specify the protocol and the socktype, it should give you
multiple answers , one for each protocol/socktype implementation.
OpenSolaris takes a funny view of RFC3493, and leaves the results set
to 0.
This patch post-processes the getaddrinfo() results for consistency.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently when you call Solaris 9's getaddrinfo(), it likes to leave
ai_protocol unset in the result. This is no way to behave, if I'm
reading RFC3493 right.
This patch makes us check for a getaddrinfo() that's broken in this way,
and work around it by trying to infer socktype and protocol from one
another.
Partial bugfix for 2987542
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
|
|
| |
This is useful for backends that require their timeout values be in
milliseconds.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There should be no need to call be_socket_enable: that does an
event_add(). What we really want to do is event_active(), to make
sure that the writecb is executed.
Also, there was one "} if () {" that was missing an else.
I've noted that the return value for evutil_socket_connect() is
getting screwy, but since that isn't an exported function, we can fix
it whenever.
|
| |
|
|
|
|
|
|
| |
- Keywords always have a space before a paren. Functions never do.
- No more than 3 blank lines in a row.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Previously, evdns was at the mercy of the user for providing a good
entropy source; without one, it would be vulnerable to various
active attacks.
This patch adds a port of OpenBSD's arc4random() calls to Libevent
[port by Chris Davis], and wraps it up a little bit so we can use it
more safely.
|
|
|
|
|
| |
This is necessary if we have any errors that the platform gai_strerror()
doesn't know how to handle.
|
|
|
|
| |
native ones
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
bufferevent_async.c
|
| | |
|
| |
| |
| |
| |
| | |
Use this to eliminate the various macros that called F_SETFD throughout
the code.
|
|/
|
|
|
| |
Apparently, a successful return value on F_SETFL is "anything but
-1".
|
| |
|
| |
|
|
|
|
| |
Fixes bug 2922121
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From evutil.c:
Some older BSDs (like OpenBSD up to 4.6) used to believe that
giving a numeric port without giving an ai_socktype was verboten.
We test for this so we can apply an appropriate workaround. If it
turns out that the bug is present, then:
- If nodename==NULL and servname is numeric, we build an answer
ourselves using evutil_getaddrinfo_common().
- If nodename!=NULL and servname is numeric, then we set
servname=NULL when calling getaddrinfo, and post-process the
result to set the ports on it.
We test for this bug at runtime, since otherwise we can't have the
same binary run on multiple BSD versions.
svn:r1550
|
|
|
|
| |
svn:r1542
|
|
|
|
|
|
| |
are just too huge.
svn:r1541
|
|
|
|
|
|
| |
overlap between flag values.
svn:r1540
|
|
|
|
|
|
| |
TODO: figure out why autoconf is confused about this.
svn:r1538
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Idea from OpenBSD, but made a bit more generic to handle uncivilized lands
that do not define issetugid.
svn:r1530
|
|
|
|
|
|
| |
is meaningful to check for HAVE_CONFIG_H
svn:r1516
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch from Christopher Davis.
svn:r1444
|
|
|
|
| |
svn:r1400
|
|
|
|
| |
svn:r1391
|
|
|
|
| |
svn:r1387
|