aboutsummaryrefslogtreecommitdiff
path: root/libssh/session.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2008-06-16 23:55:12 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2008-06-16 23:55:12 +0000
commit8ce42c279ec470bc600fcf9dd3450b450f6c32f0 (patch)
tree227054b8513168f0c36be7c8b6c4a486d0b72020 /libssh/session.c
parent1fce8c72e79a69b0478b2f3bf84d058ebaf5211c (diff)
downloadlibssh-8ce42c279ec470bc600fcf9dd3450b450f6c32f0.tar.gz
libssh-8ce42c279ec470bc600fcf9dd3450b450f6c32f0.tar.xz
libssh-8ce42c279ec470bc600fcf9dd3450b450f6c32f0.zip
displaced the data_to_* into socket
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@171 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/session.c')
-rw-r--r--libssh/session.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libssh/session.c b/libssh/session.c
index 80b9e3a1..b346ddb4 100644
--- a/libssh/session.c
+++ b/libssh/session.c
@@ -145,21 +145,22 @@ socket_t ssh_get_fd(SSH_SESSION *session){
* \param session ssh session
*/
void ssh_set_fd_toread(SSH_SESSION *session){
- session->data_to_read=1;
+ ssh_socket_set_toread(session->socket);
}
/** \brief say the session it may write to the file descriptor without blocking
* \param session ssh session
*/
void ssh_set_fd_towrite(SSH_SESSION *session){
- session->data_to_write=1;
+ ssh_socket_set_towrite(session->socket);
+
}
/** \brief say the session it has an exception to catch on the file descriptor
* \param session ssh session
*/
void ssh_set_fd_except(SSH_SESSION *session){
- session->data_except=1;
+ ssh_socket_set_except(session->socket);
}
/** \warning I don't remember if this should be internal or not
@@ -193,11 +194,12 @@ int ssh_handle_packets(SSH_SESSION *session){
*/
int ssh_get_status(SSH_SESSION *session){
int ret=0;
+ int socketstate=ssh_socket_get_status(session->socket);
if(session->closed)
ret |= SSH_CLOSED;
- if(session->channel_bytes_toread > 0 || session->data_to_read)
+ if(socketstate & SSH_READ_PENDING)
ret |= SSH_READ_PENDING;
- if(session->closed && session->closed_by_except)
+ if(session->closed && socketstate & SSH_CLOSED_ERROR)
ret |= SSH_CLOSED_ERROR;
return ret;
}