33 lines
1.8 KiB
Diff
33 lines
1.8 KiB
Diff
diff -ru dhtnet.orig/src/upnp/upnp_context.cpp dhtnet/src/upnp/upnp_context.cpp
|
|
--- dhtnet.orig/src/upnp/upnp_context.cpp 2025-10-04 15:51:40.889482196 +0200
|
|
+++ dhtnet/src/upnp/upnp_context.cpp 2025-10-04 16:09:31.538008243 +0200
|
|
@@ -734,9 +734,12 @@
|
|
}
|
|
if (toRenewLaterCount > 0) {
|
|
nextRenewalTime += MAPPING_RENEWAL_THROTTLING_DELAY;
|
|
- if (logger_) logger_->debug("{} mapping(s) didn't need to be renewed (next renewal scheduled for {:%Y-%m-%d %H:%M:%S})",
|
|
+ if (logger_) {
|
|
+ std::time_t t = sys_clock::to_time_t(nextRenewalTime);
|
|
+ logger_->debug("{} mapping(s) didn't need to be renewed (next renewal scheduled for {:%Y-%m-%d %H:%M:%S})",
|
|
toRenewLaterCount,
|
|
- fmt::localtime(sys_clock::to_time_t(nextRenewalTime)));
|
|
+ *std::localtime(&t));
|
|
+ }
|
|
mappingRenewalTimer_.expires_at(nextRenewalTime);
|
|
mappingRenewalTimer_.async_wait([this](asio::error_code const& ec) {
|
|
if (ec != asio::error::operation_aborted)
|
|
@@ -783,8 +786,11 @@
|
|
if (nextRenewalTime == mappingRenewalTimer_.expiry())
|
|
return;
|
|
|
|
- if (logger_) logger_->debug("Scheduling next port mapping renewal for {:%Y-%m-%d %H:%M:%S}",
|
|
- fmt::localtime(sys_clock::to_time_t(nextRenewalTime)));
|
|
+ if (logger_) {
|
|
+ std::time_t t = sys_clock::to_time_t(nextRenewalTime);
|
|
+ logger_->debug("Scheduling next port mapping renewal for {:%Y-%m-%d %H:%M:%S}",
|
|
+ *std::localtime(&t));
|
|
+ }
|
|
mappingRenewalTimer_.expires_at(nextRenewalTime);
|
|
mappingRenewalTimer_.async_wait([this](asio::error_code const& ec) {
|
|
if (ec != asio::error::operation_aborted)
|