o Correct the documentation on buffer printf functions.
o Don't warn on unimplemented epoll_create(): this isn't a problem, just a reason to fall back to poll or select.
o Correctly handle timeouts larger than 35 minutes on Linux with epoll.c. This is probably a kernel defect, but we'll have to support old kernels anyway even if it gets fixed.
-
+ o Make name_from_addr() threadsafe in http.c
Changes in 1.4.0:
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
evutil_socket_t fd, struct sockaddr *sa, socklen_t salen)
{
struct evhttp_connection *evcon;
- char *hostname, *portname;
+ char *hostname = NULL, *portname = NULL;
name_from_addr(sa, salen, &hostname, &portname);
event_debug(("%s: new request from %s:%s on %d\n",
__func__, hostname, portname, fd));
/* we need a connection object to put the http request on */
- if ((evcon = evhttp_connection_new(hostname, atoi(portname))) == NULL)
+ evcon = evhttp_connection_new(hostname, atoi(portname));
+ event_free(hostname);
+ event_free(portname);
+ if (evcon == NULL)
return (NULL);
/* associate the base if we have one*/
char **phost, char **pport)
{
#ifdef HAVE_GETNAMEINFO
- /* XXXX not threadsafe. */
- static char ntop[NI_MAXHOST];
- static char strport[NI_MAXSERV];
+ char ntop[NI_MAXHOST];
+ char strport[NI_MAXSERV];
int ni_result;
if ((ni_result = getnameinfo(sa, salen,
event_err(1, "getnameinfo failed");
else
event_errx(1, "getnameinfo failed: %s", gai_strerror(ni_result));
+ return;
}
-
- *phost = ntop;
- *pport = strport;
+
+ *phost = event_strdup(ntop);
+ *pport = event_strdup(strport);
#else
/* XXXX */
#endif