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
This commit is contained in:
Aris Adamantiadis
2005-11-22 23:15:31 +00:00
parent cddc5d6889
commit 1847fb2373
5 changed files with 217 additions and 118 deletions

View File

@@ -34,6 +34,7 @@ SSH_SESSION *ssh_new() {
session->next_crypto=crypto_new();
session->maxchannel=FIRST_CHANNEL;
session->fd=-1;
session->blocking=1;
return session;
}