summaryrefslogtreecommitdiffstats
path: root/libssh/socket.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-11-29 22:51:14 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2009-11-29 22:51:14 +0100
commit0bfb9d476c3dfc1ed74763665611891bcc277e9e (patch)
tree2ecbe008cbb309e57c818ca992a3154ed656a48b /libssh/socket.c
parent91bb1b2de66a62723e0cbdda02e455f728522181 (diff)
downloadlibssh-0bfb9d476c3dfc1ed74763665611891bcc277e9e.tar.gz
libssh-0bfb9d476c3dfc1ed74763665611891bcc277e9e.tar.xz
libssh-0bfb9d476c3dfc1ed74763665611891bcc277e9e.zip
Standardize callbacks style and add documentation
Diffstat (limited to 'libssh/socket.c')
-rw-r--r--libssh/socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libssh/socket.c b/libssh/socket.c
index cb96e8d..8acc76c 100644
--- a/libssh/socket.c
+++ b/libssh/socket.c
@@ -153,8 +153,9 @@ int ssh_socket_pollcallback(ssh_poll_handle p, int fd, int revents, void *v_s){
/* Bufferize the data and then call the callback */
buffer_add_data(s->in_buffer,buffer,r);
if(s->callbacks){
- r= s->callbacks->data(s->callbacks->user,
- buffer_get_rest(s->in_buffer), buffer_get_rest_len(s->in_buffer));
+ r= s->callbacks->data(buffer_get_rest(s->in_buffer),
+ buffer_get_rest_len(s->in_buffer),
+ s->callbacks->user);
buffer_pass_bytes(s->in_buffer,r);
}
}
@@ -167,7 +168,7 @@ int ssh_socket_pollcallback(ssh_poll_handle p, int fd, int revents, void *v_s){
buffer_get_rest_len(s->out_buffer));
} else if(s->callbacks){
/* Otherwise advertise the upper level that write can be done */
- s->callbacks->controlflow(s->callbacks->user,SSH_SOCKET_FLOW_WRITEWONTBLOCK);
+ s->callbacks->controlflow(SSH_SOCKET_FLOW_WRITEWONTBLOCK,s->callbacks->user);
ssh_poll_set_events(p,ssh_poll_get_events(p) & ~POLLOUT);
/* TODO: Find a way to put back POLLOUT when buffering occurs */
}