aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-23 00:17:48 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-23 00:17:48 -0400
commitcfeafe5e77c9dd5587b1ec553eb1065f0bf841fd (patch)
treef720f8ec3f8dcc065ea47b2c10c1e2885403e082 /src/or/buffers.h
parent1ba1bdee4bd8f3c00e603fe9b0fd2f14eeb60466 (diff)
downloadtor-cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd.tar.gz
tor-cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd.zip
Use a 64-bit type to hold sockets on win64.
On win64, sockets are of type UINT_PTR; on win32 they're u_int; elsewhere they're int. The correct windows way to check a socket for being set is to compare it with INVALID_SOCKET; elsewhere you see if it is negative. On Libevent 2, all callbacks take sockets as evutil_socket_t; we've been passing them int. This patch should fix compilation and correctness when built for 64-bit windows. Fixes bug 3270.
Diffstat (limited to 'src/or/buffers.h')
-rw-r--r--src/or/buffers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/buffers.h b/src/or/buffers.h
index e50b9ff6fb..63fab4957a 100644
--- a/src/or/buffers.h
+++ b/src/or/buffers.h
@@ -24,11 +24,11 @@ size_t buf_datalen(const buf_t *buf);
size_t buf_allocation(const buf_t *buf);
size_t buf_slack(const buf_t *buf);
-int read_to_buf(int s, size_t at_most, buf_t *buf, int *reached_eof,
+int read_to_buf(tor_socket_t s, size_t at_most, buf_t *buf, int *reached_eof,
int *socket_error);
int read_to_buf_tls(tor_tls_t *tls, size_t at_most, buf_t *buf);
-int flush_buf(int s, buf_t *buf, size_t sz, size_t *buf_flushlen);
+int flush_buf(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen);
int flush_buf_tls(tor_tls_t *tls, buf_t *buf, size_t sz, size_t *buf_flushlen);
int write_to_buf(const char *string, size_t string_len, buf_t *buf);