From c5a0b25bc85eb4a566c99e286ee9ae5191787f68 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 2 Jan 2004 23:18:21 +0000 Subject: [PATCH] more verbose error messages on disconnect --- panda/src/downloader/bioStreamBuf.cxx | 16 ++++++++++++++++ panda/src/downloader/httpClient.cxx | 3 +++ 2 files changed, 19 insertions(+) diff --git a/panda/src/downloader/bioStreamBuf.cxx b/panda/src/downloader/bioStreamBuf.cxx index 7b7d8946bf..4603af0c02 100644 --- a/panda/src/downloader/bioStreamBuf.cxx +++ b/panda/src/downloader/bioStreamBuf.cxx @@ -164,6 +164,22 @@ underflow() { << _source->get_server_name() << ":" << _source->get_port() << " (" << read_count << ").\n"; notify_ssl_errors(); + + SSL *ssl; + BIO_get_ssl(*_source, &ssl); + if (ssl != (SSL *)NULL) { + downloader_cat.warning() + << "OpenSSL error code: " << SSL_get_error(ssl, read_count) + << "\n"; + } + +#ifdef WIN32_VC + downloader_cat.warning() + << "Windows error code: " << WSAGetLastError() << "\n"; +#else + downloader_cat.warning() + << "Unix error code: " << errno << "\n"; +#endif // WIN32_VC } gbump(num_bytes); return EOF; diff --git a/panda/src/downloader/httpClient.cxx b/panda/src/downloader/httpClient.cxx index 37b21d520e..003aa0fd08 100644 --- a/panda/src/downloader/httpClient.cxx +++ b/panda/src/downloader/httpClient.cxx @@ -926,6 +926,9 @@ get_ssl_ctx() { } #endif + // Make sure the error strings are loaded. + notify_ssl_errors(); + // Get the configured set of expected servers. { Config::ConfigTable::Symbol expected_servers;