diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/nsd_gtls.c | 6 | ||||
-rw-r--r-- | runtime/nsdsel_gtls.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index 03ceba7b..be3910f9 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -534,6 +534,12 @@ Rcv(nsd_t *pNsd, uchar *pBuf, ssize_t *pLenBuf) /* in TLS mode now */ lenRcvd = gnutls_record_recv(pThis->sess, pBuf, *pLenBuf); + if(lenRcvd < 0) { +int gnuRet; /* this is a hack */ + *pLenBuf = -1; + CHKgnutls(lenRcvd); /* this will abort the function */ + } + *pLenBuf = lenRcvd; finalize_it: diff --git a/runtime/nsdsel_gtls.c b/runtime/nsdsel_gtls.c index 1ee4b46c..24c074f6 100644 --- a/runtime/nsdsel_gtls.c +++ b/runtime/nsdsel_gtls.c @@ -141,6 +141,10 @@ doRetry(nsd_gtls_t *pNsd) if(gnuRet == 0) { pNsd->rtryCall = gtlsRtry_None; /* we are done */ } else if(gnuRet != GNUTLS_E_AGAIN && gnuRet != GNUTLS_E_INTERRUPTED) { + uchar *pErr = gtlsStrerror(gnuRet); + dbgprintf("unexpected GnuTLS error %d in %s:%d: %s\n", gnuRet, __FILE__, __LINE__, pErr); + free(pErr); + pNsd->rtryCall = gtlsRtry_None; /* we are also done... ;) */ ABORT_FINALIZE(RS_RET_GNUTLS_ERR); } /* if we are interrupted once again (else case), we do not need to |