Просмотр исходного кода

more verbose error messages on disconnect

David Rose 22 лет назад
Родитель
Сommit
c5a0b25bc8
2 измененных файлов с 19 добавлено и 0 удалено
  1. 16 0
      panda/src/downloader/bioStreamBuf.cxx
  2. 3 0
      panda/src/downloader/httpClient.cxx

+ 16 - 0
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;

+ 3 - 0
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;