aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-08 09:15:14 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-09-17 10:48:49 +0200
commit97d2e1f4cb7bf7e2434685a20c9a78cf28b3b44b (patch)
tree6110821f57745a86f4cc0122581227f8b00daf5f
parent12fc0ea1bf9f2e2c8dab6c6ff448c982c8d94175 (diff)
downloadlibssh-97d2e1f4cb7bf7e2434685a20c9a78cf28b3b44b.tar.gz
libssh-97d2e1f4cb7bf7e2434685a20c9a78cf28b3b44b.tar.xz
libssh-97d2e1f4cb7bf7e2434685a20c9a78cf28b3b44b.zip
sftp: Reformat sftp_read_and_dispatch()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/sftp.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/sftp.c b/src/sftp.c
index 53790491..fdcffcd7 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -521,26 +521,28 @@ static sftp_message sftp_get_message(sftp_packet packet)
return msg;
}
-static int sftp_read_and_dispatch(sftp_session sftp) {
- sftp_packet packet = NULL;
- sftp_message msg = NULL;
+static int sftp_read_and_dispatch(sftp_session sftp)
+{
+ sftp_packet packet = NULL;
+ sftp_message msg = NULL;
- packet = sftp_packet_read(sftp);
- if (packet == NULL) {
- return -1; /* something nasty happened reading the packet */
- }
+ packet = sftp_packet_read(sftp);
+ if (packet == NULL) {
+ /* something nasty happened reading the packet */
+ return -1;
+ }
- msg = sftp_get_message(packet);
- if (msg == NULL) {
- return -1;
- }
+ msg = sftp_get_message(packet);
+ if (msg == NULL) {
+ return -1;
+ }
- if (sftp_enqueue(sftp, msg) < 0) {
- sftp_message_free(msg);
- return -1;
- }
+ if (sftp_enqueue(sftp, msg) < 0) {
+ sftp_message_free(msg);
+ return -1;
+ }
- return 0;
+ return 0;
}
void sftp_packet_free(sftp_packet packet) {