search for: channel_post_rdynamic

Displaying 1 result from an estimated 1 matches for "channel_post_rdynamic".

2012 Oct 22
1
[PATCH] Implement remote dynamic TCP forwarding
...nnect cctx; + int sock; + + sock = connect_to_helper(c->path, c->host_port, &cctx); + if (sock < 0) { + chan_mark_dead(c); + return; + } + + channel_register_fds(c, sock, sock, -1, 0, 1, 0); + c->connect_ctx = cctx; + + FD_SET(c->sock, writeset); + } +} + +static void +channel_post_rdynamic(Channel *c, fd_set *readset, fd_set *writeset) +{ + if (c->sock < 0) + return; + if (FD_ISSET(c->sock, writeset)) { + int err = 0; + socklen_t sz = sizeof(err); + + if (getsockopt(c->sock, SOL_SOCKET, SO_ERROR, &err, &sz) < 0) { + err = errno; + error("getsockopt...