mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
fixed a bug where channel_poll could wait forever for a packet already in socket buffer.
Inc'ed libtool numbers git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@184 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -13,8 +13,8 @@ AM_MAINTAINER_MODE
|
|||||||
# (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
|
# (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
|
||||||
# (Interfaces added: CURRENT++, AGE++, REVISION=0)
|
# (Interfaces added: CURRENT++, AGE++, REVISION=0)
|
||||||
# (No interfaces changed: REVISION++)
|
# (No interfaces changed: REVISION++)
|
||||||
LIBSSH_CURRENT=2
|
LIBSSH_CURRENT=3
|
||||||
LIBSSH_AGE=0
|
LIBSSH_AGE=1
|
||||||
LIBSSH_REVISION=0
|
LIBSSH_REVISION=0
|
||||||
AC_SUBST(LIBSSH_CURRENT)
|
AC_SUBST(LIBSSH_CURRENT)
|
||||||
AC_SUBST(LIBSSH_AGE)
|
AC_SUBST(LIBSSH_AGE)
|
||||||
|
|||||||
@@ -212,18 +212,6 @@ socket_t ssh_connect_host(SSH_SESSION *session, const char *host, const char
|
|||||||
/** \addtogroup ssh_session
|
/** \addtogroup ssh_session
|
||||||
* * @{ */
|
* * @{ */
|
||||||
|
|
||||||
/** \internal
|
|
||||||
* \brief polls the stream for activity
|
|
||||||
* \param session ssh session
|
|
||||||
* \param write value pointed to set to 1 if it is possible to write
|
|
||||||
* \param except value pointed to set to 1 if there is an exception
|
|
||||||
* \return 1 if it is possible to read, 0 otherwise, -1 on error
|
|
||||||
*/
|
|
||||||
int ssh_fd_poll(SSH_SESSION *session, int *write, int *except){
|
|
||||||
return ssh_socket_poll(session->socket,write,except);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** This functions acts more or less like the select(2) syscall.\n
|
/** This functions acts more or less like the select(2) syscall.\n
|
||||||
* There is no support for writing or exceptions.\n
|
* There is no support for writing or exceptions.\n
|
||||||
* \brief wrapper for the select syscall
|
* \brief wrapper for the select syscall
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ int ssh_handle_packets(SSH_SESSION *session){
|
|||||||
int w,err,r,i=0;
|
int w,err,r,i=0;
|
||||||
enter_function();
|
enter_function();
|
||||||
do {
|
do {
|
||||||
r=ssh_fd_poll(session,&w,&err);
|
r=ssh_socket_poll(session->socket,&w,&err);
|
||||||
if(r<=0){
|
if(r<=0){
|
||||||
leave_function();
|
leave_function();
|
||||||
return r; // error or no data available
|
return r; // error or no data available
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ int ssh_socket_poll(struct socket *s, int *write, int *except){
|
|||||||
*except=s->data_except;
|
*except=s->data_except;
|
||||||
*write=s->data_to_write;
|
*write=s->data_to_write;
|
||||||
leave_function();
|
leave_function();
|
||||||
return s->data_to_read;
|
return s->data_to_read || (buffer_get_rest_len(s->in_buffer)>0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -454,7 +454,7 @@ int ssh_socket_poll(struct socket *s, int *write, int *except){
|
|||||||
*except=s->data_except;
|
*except=s->data_except;
|
||||||
*write=s->data_to_write;
|
*write=s->data_to_write;
|
||||||
leave_function();
|
leave_function();
|
||||||
return s->data_to_read;
|
return s->data_to_read || (buffer_get_rest_len(s->in_buffer)>0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ int ssh_socket_nonblocking_flush(struct socket *s){
|
|||||||
}
|
}
|
||||||
buffer_pass_bytes(s->out_buffer,w);
|
buffer_pass_bytes(s->out_buffer,w);
|
||||||
/* refresh the socket status */
|
/* refresh the socket status */
|
||||||
ssh_fd_poll(session,&can_write,&except);
|
ssh_socket_poll(session->socket,&can_write,&except);
|
||||||
}
|
}
|
||||||
if(buffer_get_rest_len(s->out_buffer)>0){
|
if(buffer_get_rest_len(s->out_buffer)>0){
|
||||||
leave_function();
|
leave_function();
|
||||||
|
|||||||
Reference in New Issue
Block a user