Correctly clear blocking flag after sending multipart packet

commit 7317edab61d2179febc38a2c2c4da0b951d74cbc cleared the outbound
blocking bit when send_existing() returned PACKET_NONE and *ret=0, as
opposed to before even calling send_existing(), but because *ret=1 when
sending parts 2..n of an existing packet, the bit would only be cleared
when calling libssh2_transport_write() for a new packet.

Clear the direction flag after the final part of a packet has been sent.
This commit is contained in:
Peter Stuge 2010-03-28 00:50:49 +01:00
parent 79acf60ae6
commit b6ed60d2cc

View File

@ -708,13 +708,14 @@ _libssh2_transport_write(LIBSSH2_SESSION * session, unsigned char *data,
/* FIRST, check if we have a pending write to complete */
rc = send_existing(session, data, data_len, &ret);
if (rc || ret) {
if (rc)
return rc;
}
/* default clear the bit */
session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_OUTBOUND;
if (ret)
return rc;
encrypted = (session->state & LIBSSH2_STATE_NEWKEYS) ? 1 : 0;
/* check if we should compress */