aboutsummaryrefslogtreecommitdiff
path: root/libssh/packet.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-07-23 11:01:06 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-07-23 11:01:06 +0200
commite721c122d3f453094d4ab27040765974620f15ef (patch)
tree5ef53f6dbd202e07c1b01748b76d76dff292c4ec /libssh/packet.c
parent8cd0d0040e70b5a1ab0a8d8588190dd88f17ce4f (diff)
downloadlibssh-e721c122d3f453094d4ab27040765974620f15ef.tar.gz
libssh-e721c122d3f453094d4ab27040765974620f15ef.tar.xz
libssh-e721c122d3f453094d4ab27040765974620f15ef.zip
Continue removing old flushing code
Diffstat (limited to 'libssh/packet.c')
-rw-r--r--libssh/packet.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/libssh/packet.c b/libssh/packet.c
index ca8db178..a97db93b 100644
--- a/libssh/packet.c
+++ b/libssh/packet.c
@@ -422,20 +422,6 @@ int ssh_packet_parse_type(ssh_session session) {
}
/*
- * Write the the bufferized output. If the session is blocking, or
- * enforce_blocking is set, the call may block. Otherwise, it won't block.
- * Return SSH_OK if everything has been sent, SSH_AGAIN if there are still
- * things to send on buffer, SSH_ERROR if there is an error.
- */
-int packet_flush(ssh_session session, int enforce_blocking) {
- if (enforce_blocking || session->blocking) {
- return ssh_socket_blocking_flush(session->socket);
- }
-
- return ssh_socket_nonblocking_flush(session->socket);
-}
-
-/*
* This function places the outgoing packet buffer into an outgoing
* socket buffer
*/
@@ -447,7 +433,9 @@ static int ssh_packet_write(ssh_session session) {
rc=ssh_socket_write(session->socket,
ssh_buffer_get_begin(session->out_buffer),
ssh_buffer_get_len(session->out_buffer));
-
+ if(rc == SSH_OK){
+ rc=ssh_socket_nonblocking_flush(session->socket);
+ }
leave_function();
return rc;
}