Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Doc: Note from Dave Dykstra that getaddrinfo calls must be paired with
[rsync/rsync.git]
/
socket.c
diff --git
a/socket.c
b/socket.c
index
c4420ba
..
acf6234
100644
(file)
--- a/
socket.c
+++ b/
socket.c
@@
-119,6
+119,8
@@
int try_bind_local(int s,
return -1;
}
return -1;
}
+ /* FIXME: Call freeaddrinfo() on all return paths! */
+
for (r = bres_all; r; r = r->ai_next) {
if (bind(s, r->ai_addr, r->ai_addrlen) == -1)
continue;
for (r = bres_all; r; r = r->ai_next) {
if (bind(s, r->ai_addr, r->ai_addrlen) == -1)
continue;
@@
-182,6
+184,10
@@
int open_socket_out(char *host, int port, const char *bind_address,
*cp++ = '\0';
strcpy(portbuf, cp);
h = buffer;
*cp++ = '\0';
strcpy(portbuf, cp);
h = buffer;
+ if (verbose >= 2) {
+ rprintf(FINFO, "connection via http proxy %s port %s\n",
+ h, portbuf);
+ }
} else {
snprintf(portbuf, sizeof(portbuf), "%d", port);
h = host;
} else {
snprintf(portbuf, sizeof(portbuf), "%d", port);
h = host;
@@
-325,7
+331,8
@@
static int open_socket_in(int type, int port, const char *bind_address,
close(s);
continue;
}
close(s);
continue;
}
-
+
+ /* FIXME: Call freeaddrinfo? */
return s;
}
return s;
}
@@
-436,6
+443,7
@@
void start_accept_loop(int port, int (*fn)(int ))
* accept again. */
sleep(2);
} else {
* accept again. */
sleep(2);
} else {
+ /* Parent doesn't need this fd anymore. */
close(fd);
}
}
close(fd);
}
}