If we don't query a server (because we already know about it)
authorCarl Hetherington <cth@carlh.net>
Thu, 26 Nov 2020 01:05:25 +0000 (02:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 26 Nov 2020 01:24:32 +0000 (02:24 +0100)
the "last seen time" will never be updated, so the server will
be discarded.

It seems that we should always ping servers (so that set_seen gets
called on receipt of the response), no matter whether
"auto-discovered" or configured, so that the "discard" code doesn't
kick in.

Otherwise we remove and re-add our configured servers every
10 seconds, which is inefficient and which possibly triggers
other bugs.

src/lib/encode_server_finder.cc

index 3401a5cf52529542638ea89c9174fadd4a12ee4d..c823d868f03f90560430e227ccbf470757192d89 100644 (file)
@@ -123,10 +123,6 @@ try
 
                /* Query our `definite' servers (if there are any) */
                BOOST_FOREACH (string const& i, Config::instance()->servers()) {
-                       if (server_found(i)) {
-                               /* Don't bother asking a server that we already know about */
-                               continue;
-                       }
                        try {
                                boost::asio::ip::udp::resolver resolver (io_service);
                                boost::asio::ip::udp::resolver::query query (i, raw_convert<string> (HELLO_PORT));