From 2af59ebbef8799e27190cc701e5122e302c3430c Mon Sep 17 00:00:00 2001 From: Ben Sartor Date: Mon, 25 Nov 2013 03:53:59 +0100 Subject: [PATCH] tls channel continues in case of POLARSSL_ERR_NET_WANT_READ or POLARSSL_ERR_NET_WANT_READ --- src/transports/tls_channel_polarssl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/transports/tls_channel_polarssl.c b/src/transports/tls_channel_polarssl.c index 67bd866..7097e6c 100644 --- a/src/transports/tls_channel_polarssl.c +++ b/src/transports/tls_channel_polarssl.c @@ -95,7 +95,10 @@ static int tls_channel_send(belle_sip_channel_t *obj, const void *buf, size_t bu static int tls_channel_recv(belle_sip_channel_t *obj, void *buf, size_t buflen){ belle_sip_tls_channel_t* channel = (belle_sip_tls_channel_t*)obj; int err = ssl_read(&channel->sslctx,buf,buflen); - if (err<0){ + if (err == POLARSSL_ERR_NET_WANT_READ || err == POLARSSL_ERR_NET_WANT_WRITE){ + belle_sip_error("Channel [%p]: busy.",obj); + return 1; + } else if (err<0){ belle_sip_error("Channel [%p]: error in ssl_read().",obj); } return err; -- 1.7.10.4