summaryrefslogtreecommitdiffstats
path: root/include/libssh/libssh.h
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2005-11-22 23:15:31 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2005-11-22 23:15:31 +0000
commit1847fb2373f6cc5e95d36efa4e0b260fb1337c3c (patch)
tree2b9370ba4cfd49a1554caca9b43753bc179553cc /include/libssh/libssh.h
parentcddc5d6889f252b2cde5403f16063b640864f55d (diff)
downloadlibssh-1847fb2373f6cc5e95d36efa4e0b260fb1337c3c.tar.gz
libssh-1847fb2373f6cc5e95d36efa4e0b260fb1337c3c.tar.xz
libssh-1847fb2373f6cc5e95d36efa4e0b260fb1337c3c.zip
added bases for nonblocking packet sending and receiving. packet_send
and packet_read may return SSH_AGAIN if the session is nonblocking and there is not enough data to be read. I also added a socket buffering through session->in_socket_buffer. It is more low-level than the packet buffer. I should rename in_buffer with in_packet_buffer. There is still work to do with the socket status, (opened, error, closed, ...) and much more work to extend the nonblocking to session opening, messages sending and such. I find the switch(session->packet_state) solution very nice (especially when the nonblocking function may have 10 differents states, like in a connection.) git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@49 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'include/libssh/libssh.h')
-rw-r--r--include/libssh/libssh.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index ebfe41f1..60002504 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -90,6 +90,10 @@ typedef uint8_t u8;
#define SSH_FATAL 2
#define SSH_EINTR 3
+/* error return codes */
+#define SSH_OK 0 /* No error */
+#define SSH_ERROR -1 /* error of some kind */
+#define SSH_AGAIN 1 /* the nonblocking call must be repeated */
char *ssh_get_error(void *error);
int ssh_get_error_code(void *error);