summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-15 13:19:01 +0100
committerFelix Fietkau <nbd@openwrt.org>2014-03-15 13:19:01 +0100
commit56f5d54985e1e974711d6f602faf98a00e306364 (patch)
tree349101e0a5aa13fbe54d49774ac646734705068a
parent2263994fef00cd53642c0337e893fb2d1b35c081 (diff)
downloadustream-ssl-56f5d54985e1e974711d6f602faf98a00e306364.tar.gz
polarssl: fix error check on write
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--ustream-polarssl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ustream-polarssl.c b/ustream-polarssl.c
index 10221d3..d55fe04 100644
--- a/ustream-polarssl.c
+++ b/ustream-polarssl.c
@@ -51,12 +51,13 @@ static int s_ustream_read(void *ctx, unsigned char *buf, size_t len)
static int s_ustream_write(void *ctx, const unsigned char *buf, size_t len)
{
struct ustream *s = ctx;
+ int ret;
- len = ustream_write(s, (const char *) buf, len, false);
- if (len < 0 || s->write_error)
+ ret = ustream_write(s, (const char *) buf, len, false);
+ if (ret < 0 || s->write_error)
return POLARSSL_ERR_NET_SEND_FAILED;
- return len;
+ return ret;
}
__hidden void ustream_set_io(void *ctx, void *ssl, struct ustream *conn)