Skip to content

Commit 28788e1

Browse files
committed
fail transfer if no close_notify was received
1 parent f7254ed commit 28788e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gplaces.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,8 @@ static void mkcert(const char *crtpath, const char *keypath) {
941941

942942
static int ssl_error(const URL *url, void *c, int err) {
943943
if ((err = SSL_get_error((SSL *)c, err)) == SSL_ERROR_ZERO_RETURN) return 0;
944-
if (err == SSL_ERROR_SSL) { error(0, "protocol error while downloading `%s`", url->url); return 0; }; /* some servers seem to ignore this part of the specification (v0.16.1): "As per RFCs 5246 and 8446, Gemini servers MUST send a TLS `close_notify`" */
945-
if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) error(0, "failed to download `%s`: cancelled", url->url);
944+
if (err == SSL_ERROR_SSL) error(0, "protocol error while downloading `%s`", url->url);
945+
else if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) error(0, "failed to download `%s`: cancelled", url->url);
946946
else error(0, "failed to download `%s`: error %d", url->url, err);
947947
return 1;
948948
}

0 commit comments

Comments
 (0)