cleanup TLS on tls_write error - hurl - Gopher/HTTP/HTTPS file grabber
(HTM) git clone git://git.codemadness.org/hurl
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 49f3642c3fa644bc376ad67e33a8f686c72c7e06
(DIR) parent cbccd2ddfd3cc994f06c966eb88d088e52d92159
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 16 Nov 2018 16:05:03 +0100
cleanup TLS on tls_write error
Diffstat:
M hurl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/hurl.c b/hurl.c
@@ -215,10 +215,9 @@ https_request(void)
"Connection: close\r\n"
"%s"
"\r\n", u.path, u.host, config_custom ? config_custom : "");
- if ((r = tls_write(t, buf, strlen(buf))) == -1) {
+ if ((r = tls_write(t, buf, strlen(buf))) == -1)
fprintf(stderr, "tls_write: %s\n", tls_error(t));
- exit(1);
- }
+ goto err;
/* NOTE: HTTP header must fit in the buffer */
for (len = 0; len < sizeof(buf); len += r) {