version 1.88, 2001/02/01 21:58:08 |
version 1.89, 2001/02/04 15:32:23 |
|
|
int err = 0; |
int err = 0; |
int sz = sizeof(err); |
int sz = sizeof(err); |
c->type = SSH_CHANNEL_OPEN; |
c->type = SSH_CHANNEL_OPEN; |
if (getsockopt(c->sock, SOL_SOCKET, SO_ERROR, (char *)&err, &sz) < 0) { |
if (getsockopt(c->sock, SOL_SOCKET, SO_ERROR, (char *)&err, &sz) < 0) { |
debug("getsockopt SO_ERROR failed"); |
debug("getsockopt SO_ERROR failed"); |
} else { |
} else { |
if (err == 0) { |
if (err == 0) { |
|
|
|
|
if (remote_fwd) { |
if (remote_fwd) { |
host = listen_address; |
host = listen_address; |
ctype = SSH_CHANNEL_RPORT_LISTENER; |
ctype = SSH_CHANNEL_RPORT_LISTENER; |
} else { |
} else { |
host = host_to_connect; |
host = host_to_connect; |
ctype =SSH_CHANNEL_PORT_LISTENER; |
ctype =SSH_CHANNEL_PORT_LISTENER; |
|
|
error("connect %.100s port %s: %.100s", ntop, strport, |
error("connect %.100s port %s: %.100s", ntop, strport, |
strerror(errno)); |
strerror(errno)); |
close(sock); |
close(sock); |
continue; /* fail -- try next */ |
continue; /* fail -- try next */ |
} |
} |
break; /* success */ |
break; /* success */ |
|
|
} |
} |
freeaddrinfo(aitop); |
freeaddrinfo(aitop); |
if (!ai) { |
if (!ai) { |
error("connect %.100s port %d: failed.", host, host_port); |
error("connect %.100s port %d: failed.", host, host_port); |
return -1; |
return -1; |
} |
} |
/* success */ |
/* success */ |
|
|
} |
} |
c->dettach_user = NULL; |
c->dettach_user = NULL; |
} |
} |
void |
void |
channel_register_filter(int id, channel_filter_fn *fn) |
channel_register_filter(int id, channel_filter_fn *fn) |
{ |
{ |
Channel *c = channel_lookup(id); |
Channel *c = channel_lookup(id); |