2 Commits d35d84bf10 ... dc0398c477

Autore SHA1 Messaggio Data
  Ivan Baidakou dc0398c477 core, win32: more properly setup system verify paths for openssl 3 giorni fa
  Ivan Baidakou 7d9ca76ecb core, fltk, win32: use microsecond precision in timer logs as nanosecond precision is not available for win32 3 giorni fa

+ 7 - 1
src/transport/impl.hpp

@@ -134,11 +134,17 @@ template <> struct base_impl_t<ssl_socket_t> {
                 use_sytem_verify_paths = false;
             }
         }
-
         if (use_sytem_verify_paths) {
             log->trace("using default verify paths");
             auto ec = sys::error_code();
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32)
+            if (!SSL_CTX_load_verify_store(ctx.native_handle(), "org.openssl.winstore://")) {
+                auto code = ::ERR_get_error();
+                ec = sys::error_code(static_cast<int>(code), asio::error::get_ssl_category());
+            }
+#else
             ctx.set_default_verify_paths(ec);
+#endif
             if (ec) {
                 utils::get_logger("transport.tls")->warn("cannot set ssl default verify paths: {}", ec.message());
             }

+ 7 - 1
src/ui-fltk/log_sink.cpp

@@ -5,7 +5,13 @@
 
 using namespace syncspirit::fltk;
 
-in_memory_sink_t::in_memory_sink_t() : date_formatter("%H:%M:%S.%F") {}
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32)
+#define SECOND_FRACTION "%f"
+#else
+#define SECOND_FRACTION "%F"
+#endif
+
+in_memory_sink_t::in_memory_sink_t() : date_formatter("%H:%M:%S." SECOND_FRACTION) {}
 
 void in_memory_sink_t::flush() {}
 

+ 0 - 4
src/ui-fltk/log_table.cpp

@@ -2,16 +2,12 @@
 // SPDX-FileCopyrightText: 2024-2025 Ivan Baidakou
 
 #include "log_table.h"
-#include "log_sink.h"
 #include "log_colors.h"
 #include "log_utils.h"
 
 #include <FL/Fl.H>
 #include <FL/fl_draw.H>
 
-#include <spdlog/sinks/sink.h>
-#include <spdlog/pattern_formatter.h>
-#include <spdlog/fmt/fmt.h>
 #include <sstream>
 
 namespace syncspirit::fltk {

+ 7 - 1
src/utils/log-setup.cpp

@@ -18,7 +18,13 @@ namespace syncspirit::utils {
 namespace bfs = std::filesystem;
 namespace sys = boost::system;
 
-static const char *log_pattern = "[%Y-%m-%d %H:%M:%S.%e] [%^%L/%t%$] {%n} %v";
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32)
+#define SECOND_FRACTION "%f"
+#else
+#define SECOND_FRACTION "%F"
+#endif
+
+static const char *log_pattern = "[%Y-%m-%d %H:%M:%S." SECOND_FRACTION "] [%^%L/%t%$] {%n} %v";
 
 using sink_option_t = outcome::result<spdlog::sink_ptr>;