commit d1b40cf2e7bb55d3c421e6eff476330e08ab4750 Merge: 1772782 dea0720 Author: Nick Mathewson nickm@torproject.org Date: Wed Jan 18 15:33:04 2012 -0500
Merge remote-tracking branch 'public/bug4533_part1'
Conflicts: src/common/compat.h
changes/tor_socket_tests | 11 +++++++++++ src/common/compat.c | 19 ++++++++++++------- src/common/compat.h | 8 ++++++++ src/or/buffers.c | 4 ++-- src/or/connection.c | 16 ++++++++-------- src/or/cpuworker.c | 4 ++-- src/or/dns.c | 8 ++++---- 7 files changed, 47 insertions(+), 23 deletions(-)
diff --cc src/common/compat.h index 5bf12cd,1b79565..4329d45 --- a/src/common/compat.h +++ b/src/common/compat.h @@@ -399,11 -399,19 +399,19 @@@ typedef int socklen_t #endif
#ifdef MS_WINDOWS + /* XXX Actually, this should arguably be SOCKET; we use intptr_t here so that + * any inadvertant checks for the socket being <= 0 or > 0 will probably + * still work. */ #define tor_socket_t intptr_t -#define SOCKET_OK(s) ((unsigned)(s) != INVALID_SOCKET) +#define SOCKET_OK(s) ((SOCKET)(s) != INVALID_SOCKET) + #define TOR_INVALID_SOCKET INVALID_SOCKET #else + /** Type used for a network socket. */ #define tor_socket_t int + /** Macro: true iff 's' is a possible value for a valid initialized socket. */ #define SOCKET_OK(s) ((s) >= 0) + /** Error/uninitialized value for a tor_socket_t. */ + #define TOR_INVALID_SOCKET (-1) #endif
int tor_close_socket(tor_socket_t s);
tor-commits@lists.torproject.org