From 5da917f576dc191da3fc187c93000774d3103dcb Mon Sep 17 00:00:00 2001 From: PobreGato <315121269+pobregat0@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:35:08 -0400 Subject: [PATCH] treat reseed connect timeout as a failure instead of a connection --- libi2pd/Reseed.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libi2pd/Reseed.cpp b/libi2pd/Reseed.cpp index 68ca3a65..26a2bcb6 100644 --- a/libi2pd/Reseed.cpp +++ b/libi2pd/Reseed.cpp @@ -732,7 +732,14 @@ namespace data ecode = ec; }); service.run_for (std::chrono::seconds (RESEED_CONNECT_TIMEOUT)); - if (!service.stopped()) s.lowest_layer().close (); + if (!service.stopped()) + { + // the handler never ran, so ecode still holds success from resolve: + // without this the timeout reads as a connection and the request goes + // out on a socket that was just closed + ecode = boost::asio::error::timed_out; + s.lowest_layer().close (); + } if (!ecode) { @@ -857,7 +864,11 @@ namespace data ecode = ec; }); service.run_for (std::chrono::seconds (2*RESEED_CONNECT_TIMEOUT)); - if (!service.stopped()) s.close (); + if (!service.stopped()) + { + ecode = boost::asio::error::timed_out; + s.close (); + } if (!ecode) {