aboutsummaryrefslogtreecommitdiff
path: root/libssh/poll.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-05-09 00:48:10 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-05-09 00:48:10 +0200
commitf31a14b7932ef4cc165ddd8f1f1a5b23eb21beb3 (patch)
tree2b4149ee9bbd8c264e63de9653d026f29d028a61 /libssh/poll.c
parent7886326aa8a4ac2242c743bfe38f4266b0d24551 (diff)
downloadlibssh-f31a14b7932ef4cc165ddd8f1f1a5b23eb21beb3.tar.gz
libssh-f31a14b7932ef4cc165ddd8f1f1a5b23eb21beb3.tar.xz
libssh-f31a14b7932ef4cc165ddd8f1f1a5b23eb21beb3.zip
ssh_socket support for 2 fd + Proxyhost command
Diffstat (limited to 'libssh/poll.c')
-rw-r--r--libssh/poll.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libssh/poll.c b/libssh/poll.c
index ea59266..56f940a 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -463,10 +463,18 @@ int ssh_poll_ctx_add(ssh_poll_ctx ctx, ssh_poll_handle p) {
* @return 0 on success, < 0 on error
*/
int ssh_poll_ctx_add_socket (ssh_poll_ctx ctx, ssh_socket s) {
- ssh_poll_handle p=ssh_socket_get_poll_handle(s);
- if(p==NULL)
+ ssh_poll_handle p_in, p_out;
+ int ret;
+ p_in=ssh_socket_get_poll_handle_in(s);
+ if(p_in==NULL)
return -1;
- return ssh_poll_ctx_add(ctx,p);
+ ret = ssh_poll_ctx_add(ctx,p_in);
+ if(ret != 0)
+ return ret;
+ p_out=ssh_socket_get_poll_handle_out(s);
+ if(p_in != p_out)
+ ret = ssh_poll_ctx_add(ctx,p_out);
+ return ret;
}