Package: lua-sec / 0.6-3

0005-Return-the-number-of-data-read-and-remove-a-useless-.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Bruno Silvestre <brunoos@inf.ufg.br>
Date: Wed, 3 Aug 2016 14:56:07 -0300
Subject: Return the number of data read and remove a useless line.

---
 src/ssl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/ssl.c b/src/ssl.c
index 0ac1c56..84c609d 100644
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -200,10 +200,9 @@ static int ssl_recv(void *ctx, char *data, size_t count, size_t *got,
     ssl->error = SSL_get_error(ssl->ssl, err);
     switch (ssl->error) {
     case SSL_ERROR_NONE:
-      *got = 0;
+      *got = err;
       return IO_DONE;
     case SSL_ERROR_ZERO_RETURN:
-      *got = 0;
       return IO_CLOSED;
     case SSL_ERROR_WANT_READ:
       err = socket_waitfd(&ssl->sock, WAITFD_R, tm);