From 4d10b4dc8604a4ad1d03f3f86794d67a6ce059cc Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Mon, 20 Jul 2015 20:36:00 +0300 Subject: [PATCH] minor fix; --- lib/sntllv2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/sntllv2.c b/lib/sntllv2.c index 2b0ccfb..050c85d 100644 --- a/lib/sntllv2.c +++ b/lib/sntllv2.c @@ -208,14 +208,15 @@ int _sntll_writemsg(conn_t *co, sxmsg_t *msg) if(rd < 0) { co->flags |= SNSX_CLOSED; r = SNE_ESSL; - } else if(head->payload_length) rd = __conn_write(co, msg->payload, head->payload_length); - /* check up again */ - if(rd < 0) { - co->flags |= SNSX_CLOSED; - r = SNE_ESSL; + } else if(head->payload_length) { + rd = __conn_write(co, msg->payload, head->payload_length); + /* check up again */ + if(rd < 0) { co->flags |= SNSX_CLOSED; r = SNE_ESSL; } } pthread_mutex_unlock(&co->sslinout[2]); + if(!(co->flags & SNSX_CLOSED)) r = SNE_SUCCESS; + return r; }