From d85bce4e96eeadf3248b9298926c957e39851504 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 20 Sep 2007 18:38:31 +0000 Subject: [PATCH] Remove gratuitous tor-isms in evutil_socketpair(); fix a windows warning in http.c. svn:r446 --- evutil.c | 12 +++++++----- http.c | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/evutil.c b/evutil.c index 2af3115b..44b3a10a 100644 --- a/evutil.c +++ b/evutil.c @@ -32,6 +32,7 @@ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN +#include #include "misc.h" #endif @@ -45,15 +46,16 @@ #ifdef HAVE_FCNTL_H #include #endif +#include #include "evutil.h" #include "log.h" int -evutil_socketpair(int d, int type, int protocol, int sv[2]) +evutil_socketpair(int family, int type, int protocol, int fd[2]) { #ifndef WIN32 - return socketpair(d, type, protocol, sv); + return socketpair(family, type, protocol, fd); #else /* This code is originally from Tor. Used with permission. */ @@ -81,9 +83,9 @@ evutil_socketpair(int d, int type, int protocol, int sv[2]) return -EINVAL; } - listener = tor_open_socket(AF_INET, type, 0); + listener = socket(AF_INET, type, 0); if (listener < 0) - return -tor_socket_errno(-1); + return -errno; memset(&listen_addr, 0, sizeof(listen_addr)); listen_addr.sin_family = AF_INET; listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); @@ -94,7 +96,7 @@ evutil_socketpair(int d, int type, int protocol, int sv[2]) if (listen(listener, 1) == -1) goto tidy_up_and_fail; - connector = tor_open_socket(AF_INET, type, 0); + connector = socket(AF_INET, type, 0); if (connector < 0) goto tidy_up_and_fail; /* We want to find out the port number to connect to. */ diff --git a/http.c b/http.c index e0f8ff5f..0d952423 100644 --- a/http.c +++ b/http.c @@ -336,7 +336,10 @@ evhttp_make_header_response(struct evhttp_connection *evcon, if (evhttp_find_header(req->output_headers, "Date") == NULL) { char date[50]; - struct tm cur, *cur_p; +#ifndef WIN32 + struct tm cur; +#endif + struct tm *cur_p; time_t t = time(NULL); #ifdef WIN32 cur_p = gmtime(&t); -- 2.50.0