fix ssl error reporting
authorAndy Green <andy.green@linaro.org>
Sun, 6 Apr 2014 11:39:22 +0000 (12:39 +0100)
committerAndy Green <andy.green@linaro.org>
Sun, 6 Apr 2014 11:41:31 +0000 (12:41 +0100)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/ssl.c

index c653454..f0a9a32 100644 (file)
--- a/lib/ssl.c
+++ b/lib/ssl.c
@@ -345,7 +345,7 @@ lws_ssl_capable_read(struct libwebsocket *wsi, unsigned char *buf, int len)
        if (n >= 0)
                return n;
 
-       n = SSL_get_error(wsi->ssl, len);
+       n = SSL_get_error(wsi->ssl, n);
        if (n ==  SSL_ERROR_WANT_READ || n ==  SSL_ERROR_WANT_WRITE)
                return LWS_SSL_CAPABLE_MORE_SERVICE;
 
@@ -364,7 +364,7 @@ lws_ssl_capable_write(struct libwebsocket *wsi, unsigned char *buf, int len)
        if (n >= 0)
                return n;
 
-       n = SSL_get_error(wsi->ssl, len);
+       n = SSL_get_error(wsi->ssl, n);
        if (n == SSL_ERROR_WANT_READ || n == SSL_ERROR_WANT_WRITE) {
                if (n == SSL_ERROR_WANT_WRITE)
                        lws_set_blocking_send(wsi);