version 1.7, 1999/09/30 04:30:03 |
version 1.8, 1999/09/30 05:53:04 |
|
|
struct servent *sp; |
struct servent *sp; |
struct hostent *hp; |
struct hostent *hp; |
struct sockaddr_in hostaddr; |
struct sockaddr_in hostaddr; |
#ifdef SO_LINGER |
|
struct linger linger; |
struct linger linger; |
#endif /* SO_LINGER */ |
|
|
|
debug("ssh_connect: getuid %d geteuid %d anon %d", |
debug("ssh_connect: getuid %d geteuid %d anon %d", |
(int)getuid(), (int)geteuid(), anonymous); |
(int)getuid(), (int)geteuid(), anonymous); |
|
|
/* Set socket options. We would like the socket to disappear as soon as |
/* Set socket options. We would like the socket to disappear as soon as |
it has been closed for whatever reason. */ |
it has been closed for whatever reason. */ |
/* setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */ |
/* setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */ |
#ifdef TCP_NODELAY |
|
setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(on)); |
setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(on)); |
#endif /* TCP_NODELAY */ |
|
#ifdef SO_LINGER |
|
linger.l_onoff = 1; |
linger.l_onoff = 1; |
linger.l_linger = 5; |
linger.l_linger = 5; |
setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *)&linger, sizeof(linger)); |
setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *)&linger, sizeof(linger)); |
#endif /* SO_LINGER */ |
|
|
|
/* Set the connection. */ |
/* Set the connection. */ |
packet_set_connection(sock, sock); |
packet_set_connection(sock, sock); |