From 200bd35bb24f3fe3b2e970e4fbedddef4a426aad Mon Sep 17 00:00:00 2001 From: Pierrick Charron Date: Sun, 7 Dec 2014 21:15:03 -0500 Subject: [PATCH] Fix error message mismatch --- stomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stomp.c b/stomp.c index f0810f0..b68acc6 100644 --- a/stomp.c +++ b/stomp.c @@ -368,7 +368,7 @@ static int _stomp_recv(stomp_t *stomp, char *msg, const size_t length) } #endif - if (len == 0) { + if (len == -1) { #if HAVE_STOMP_SSL if (stomp->options.use_ssl) { stomp_set_error(stomp, "Error reading from socket", errno, "%s. (SSL in use)", strerror(errno)); @@ -379,7 +379,7 @@ static int _stomp_recv(stomp_t *stomp, char *msg, const size_t length) } #endif stomp->status = -1; - } else if (len == -1) { + } else if (len == 0) { stomp_set_error(stomp, "Sender closed connection unexpectedly", 0, NULL); stomp->status = -1; }