From 29c8205e79956b4cc9ea59850a73534730f30283 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 17 Jun 2019 17:15:24 +0200 Subject: [PATCH] Tweaked verbosity of lost connections in HTTP::Downloader and closed connections in Socket::SSLConnection. --- lib/downloader.cpp | 7 +++++-- lib/socket.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/downloader.cpp b/lib/downloader.cpp index 02c478cc..65030e0e 100644 --- a/lib/downloader.cpp +++ b/lib/downloader.cpp @@ -198,8 +198,11 @@ namespace HTTP{ retryCount - loop + 1, retryCount); getSocket().close(); }else{ - FAIL_MSG("Lost connection while retrieving %s (%zu/%" PRIu32 ")", link.getUrl().c_str(), - retryCount - loop + 1, retryCount); + if (retryCount - loop + 1 > 2){ + INFO_MSG("Lost connection while retrieving %s (%zu/%" PRIu32 ")", link.getUrl().c_str(), retryCount - loop + 1, retryCount); + }else{ + MEDIUM_MSG("Lost connection while retrieving %s (%zu/%" PRIu32 ")", link.getUrl().c_str(), retryCount - loop + 1, retryCount); + } } Util::sleep(500); // wait a bit before retrying } diff --git a/lib/socket.cpp b/lib/socket.cpp index 63608271..87cc3f10 100644 --- a/lib/socket.cpp +++ b/lib/socket.cpp @@ -1013,6 +1013,7 @@ int Socket::SSLConnection::iread(void *buffer, int len, int flags){ } if (r < 0){ switch (errno){ + case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY: close(); return 0; break; case MBEDTLS_ERR_SSL_WANT_WRITE: return 0; break; case MBEDTLS_ERR_SSL_WANT_READ: return 0; break; case EWOULDBLOCK: return 0; break;