From 749e95cbf14f73da507dfd5c6b247614d1d288f6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 14 Apr 2009 08:58:11 +0000 Subject: Format packet_write(). git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@458 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/packet.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/libssh/packet.c b/libssh/packet.c index 41cd54f9..6e903068 100644 --- a/libssh/packet.c +++ b/libssh/packet.c @@ -412,14 +412,23 @@ int packet_flush(SSH_SESSION *session, int enforce_blocking) { return ssh_socket_nonblocking_flush(session->socket); } -/* this function places the outgoing packet buffer into an outgoing socket buffer */ -static int packet_write(SSH_SESSION *session){ - int ret; - enter_function(); - ssh_socket_write(session->socket,buffer_get(session->out_buffer),buffer_get_len(session->out_buffer)); - ret=packet_flush(session,0); - leave_function(); - return ret; +/* + * This function places the outgoing packet buffer into an outgoing + * socket buffer + */ +static int packet_write(SSH_SESSION *session) { + int rc = SSH_ERROR; + + enter_function(); + + ssh_socket_write(session->socket, + buffer_get(session->out_buffer), + buffer_get_len(session->out_buffer)); + + rc = packet_flush(session, 0); + + leave_function(); + return rc; } static int packet_send2(SSH_SESSION *session){ -- cgit