[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 97/222: openssl: use strerror on SSL_ERROR_SYSCALL
From: |
gnunet |
Subject: |
[gnurl] 97/222: openssl: use strerror on SSL_ERROR_SYSCALL |
Date: |
Thu, 07 Nov 2019 00:09:53 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 0ab38f5fd6c15451cdec816ca6c6a163b98e1d25
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Sep 24 14:03:23 2019 +0200
openssl: use strerror on SSL_ERROR_SYSCALL
Instead of showing the somewhat nonsensical errno number, use strerror()
to provide a more relatable error message.
Closes #4411
---
lib/vtls/openssl.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 28d23c50f..760758d23 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -44,6 +44,7 @@
#include "strcase.h"
#include "hostcheck.h"
#include "multiif.h"
+#include "strerror.h"
#include "curl_printf.h"
#include <openssl/ssl.h>
#include <openssl/rand.h>
@@ -3825,8 +3826,8 @@ static ssize_t ossl_send(struct connectdata *conn,
*curlcode = CURLE_AGAIN;
return -1;
case SSL_ERROR_SYSCALL:
- failf(conn->data, "SSL_write() returned SYSCALL, errno = %d",
- SOCKERRNO);
+ Curl_strerror(SOCKERRNO, error_buffer, sizeof(error_buffer));
+ failf(conn->data, OSSL_PACKAGE " SSL_write: %s", error_buffer);
*curlcode = CURLE_SEND_ERROR;
return -1;
case SSL_ERROR_SSL:
@@ -3893,6 +3894,11 @@ static ssize_t ossl_recv(struct connectdata *conn, /*
connection data */
/* there's data pending, re-invoke SSL_read() */
*curlcode = CURLE_AGAIN;
return -1;
+ case SSL_ERROR_SYSCALL:
+ Curl_strerror(SOCKERRNO, error_buffer, sizeof(error_buffer));
+ failf(conn->data, OSSL_PACKAGE " SSL_read: %s", error_buffer);
+ *curlcode = CURLE_RECV_ERROR;
+ return -1;
default:
/* openssl/ssl.h for SSL_ERROR_SYSCALL says "look at error stack/return
value/errno" */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 102/222: quiche: set 'drain' when returning without having drained the queues, (continued)
- [gnurl] 102/222: quiche: set 'drain' when returning without having drained the queues, gnunet, 2019/11/06
- [gnurl] 92/222: travis: move the go install to linux-only, gnunet, 2019/11/06
- [gnurl] 100/222: HTTP3: merged and simplified the two 'running' sections, gnunet, 2019/11/06
- [gnurl] 87/222: os400: getpeername() and getsockname() return ebcdic AF_UNIX sockaddr,, gnunet, 2019/11/06
- [gnurl] 91/222: altsvc: correct the #ifdef for the ngtcp2 backend, gnunet, 2019/11/06
- [gnurl] 94/222: ngtcp2: remove fprintf() calls, gnunet, 2019/11/06
- [gnurl] 88/222: HTTP3.md: move -p for mkdir, remove -j for make, gnunet, 2019/11/06
- [gnurl] 108/222: FTP: url-decode path before evaluation, gnunet, 2019/11/06
- [gnurl] 89/222: urlapi: question mark within fragment is still fragment, gnunet, 2019/11/06
- [gnurl] 93/222: url: fix the NULL hostname compiler warning case, gnunet, 2019/11/06
- [gnurl] 97/222: openssl: use strerror on SSL_ERROR_SYSCALL,
gnunet <=
- [gnurl] 109/222: FTP: add test for FTPFILE_NOCWD: Avoid redundant CWDs, gnunet, 2019/11/06
- [gnurl] 127/222: chunked-encoding: stop hiding the CURLE_BAD_CONTENT_ENCODING error, gnunet, 2019/11/06
- [gnurl] 95/222: url: don't set appconnect time for non-ssl/non-ssh connections, gnunet, 2019/11/06
- [gnurl] 121/222: git: add tests/server/disabled to .gitignore, gnunet, 2019/11/06
- [gnurl] 122/222: AppVeyor: remove MSYS2_ARG_CONV_EXCL for winbuild, gnunet, 2019/11/06
- [gnurl] 125/222: urlapi: fix unused variable warning, gnunet, 2019/11/06
- [gnurl] 123/222: AppVeyor: add 32-bit MinGW-w64 build, gnunet, 2019/11/06
- [gnurl] 130/222: tool_operate: rename functions to make more sense, gnunet, 2019/11/06
- [gnurl] 129/222: curl: create easy handles on-demand and not ahead of time, gnunet, 2019/11/06
- [gnurl] 131/222: urlapi: fix URL encoding when setting a full URL, gnunet, 2019/11/06