projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15aeea3
)
SSL: Handle EOF case in ssl_get
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 11 Aug 2011 08:31:25 +0000
(10:31 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 11 Aug 2011 08:31:25 +0000
(10:31 +0200)
If gnutls was in use and gnutls_record_recv returned 0 (EOF)
the ssl_get function would never terminate.
src/tcpip.c
patch
|
blob
|
history
diff --git
a/src/tcpip.c
b/src/tcpip.c
index
b9466d6
..
c3a4b05
100644
(file)
--- a/
src/tcpip.c
+++ b/
src/tcpip.c
@@
-1159,7
+1159,12
@@
int ssl_get(COMSTACK h, char **buf, int *bufsize)
#if HAVE_GNUTLS_H
res = gnutls_record_recv(sp->session, *buf + hasread,
CS_TCPIP_BUFCHUNK);
- if (res < 0)
+ if (res == 0)
+ {
+ TRC(fprintf(stderr, "gnutls_record_recv returned 0\n"));
+ return 0;
+ }
+ else if (res < 0)
{
if (ssl_check_error(h, sp, res))
break;