projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for automatically tuning the SSH-2 window size for decent
[u/mdw/putty]
/
unix
/
uxnet.c
diff --git
a/unix/uxnet.c
b/unix/uxnet.c
index
3cf1b5f
..
e1dfce3
100644
(file)
--- a/
unix/uxnet.c
+++ b/
unix/uxnet.c
@@
-236,7
+236,7
@@
SockAddr sk_nonamelookup(const char *host)
static int sk_nextaddr(SockAddr addr)
{
#ifndef NO_IPV6
static int sk_nextaddr(SockAddr addr)
{
#ifndef NO_IPV6
- if (addr->ai->ai_next) {
+ if (addr->ai
&& addr->ai
->ai_next) {
addr->ai = addr->ai->ai_next;
addr->family = addr->ai->ai_family;
return TRUE;
addr->ai = addr->ai->ai_next;
addr->family = addr->ai->ai_family;
return TRUE;
@@
-470,6
+470,8
@@
static int try_connect(Actual_Socket sock)
goto ret;
}
goto ret;
}
+ cloexec(s);
+
if (sock->oobinline) {
int b = TRUE;
setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (void *) &b, sizeof(b));
if (sock->oobinline) {
int b = TRUE;
setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (void *) &b, sizeof(b));
@@
-723,6
+725,8
@@
Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i
return (Socket) ret;
}
return (Socket) ret;
}
+ cloexec(s);
+
ret->oobinline = 0;
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof(on));
ret->oobinline = 0;
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof(on));
@@
-1282,9
+1286,10
@@
SockAddr platform_get_x11_unix_address(int displaynum, char **canonicalname)
else
*canonicalname = dupstr(ret->hostname);
#ifndef NO_IPV6
else
*canonicalname = dupstr(ret->hostname);
#ifndef NO_IPV6
- ret->ais = NULL;
+ ret->ai
= ret->ai
s = NULL;
#else
ret->addresses = NULL;
#else
ret->addresses = NULL;
+ ret->curraddr = ret->naddresses = 0;
#endif
return ret;
}
#endif
return ret;
}