diff options
author | Roger Dingledine <arma@torproject.org> | 2004-10-14 02:47:09 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-10-14 02:47:09 +0000 |
commit | aebc3a03ba6eea02f4d50fa4bd5dbf49cd37a0c7 (patch) | |
tree | bd0b81c8f1021d0b8150cd32ba41b4c6c5489e78 /src/or/connection.c | |
parent | 92bb360ad771a4cba21f1e4a77e367f973e546ef (diff) | |
download | tor-aebc3a03ba6eea02f4d50fa4bd5dbf49cd37a0c7.tar.gz tor-aebc3a03ba6eea02f4d50fa4bd5dbf49cd37a0c7.zip |
more int to size_t conversions, fixing one or more amd64 bugs
plus a whitespace patch on config.c from vicman
svn:r2482
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index c2f01c052a..cf94213f05 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -376,8 +376,10 @@ static int connection_create_listener(const char *bindaddress, uint16_t bindport static int connection_handle_listener_read(connection_t *conn, int new_type) { int news; /* the new socket */ connection_t *newconn; - struct sockaddr_in remote; /* information about the remote peer when connecting to other routers */ - int remotelen = sizeof(struct sockaddr_in); /* length of the remote address */ + /* information about the remote peer when connecting to other routers */ + struct sockaddr_in remote; + /* length of the remote address. Must be an int, since accept() needs that. */ + int remotelen = sizeof(struct sockaddr_in); news = accept(conn->s,(struct sockaddr *)&remote,&remotelen); if (news == -1) { /* accept() error */ @@ -811,7 +813,7 @@ static int connection_read_to_buf(connection_t *conn) { } /** A pass-through to fetch_from_buf. */ -int connection_fetch_from_buf(char *string, int len, connection_t *conn) { +int connection_fetch_from_buf(char *string, size_t len, connection_t *conn) { return fetch_from_buf(string, len, conn->inbuf); } @@ -953,7 +955,7 @@ int connection_handle_write(connection_t *conn) { /** Append <b>len</b> bytes of <b>string</b> onto <b>conn</b>'s * outbuf, and ask it to start writing. */ -void connection_write_to_buf(const char *string, int len, connection_t *conn) { +void connection_write_to_buf(const char *string, size_t len, connection_t *conn) { if(!len || conn->marked_for_close) return; |