[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1501: If the network map is not visible, but the geoip request que (in trunk: doc src/gui/network)
Author: edmanm
Date: 2006-12-06 01:27:26 -0500 (Wed, 06 Dec 2006)
New Revision: 1501
Modified:
trunk/doc/geoip-spec.txt
trunk/src/gui/network/netviewer.cpp
Log:
If the network map is not visible, but the geoip request queue contains
requests for >= 1/4 of the known servers, go ahead and send the request.
Update geoip spec, too.
Modified: trunk/doc/geoip-spec.txt
===================================================================
--- trunk/doc/geoip-spec.txt 2006-12-05 07:23:50 UTC (rev 1500)
+++ trunk/doc/geoip-spec.txt 2006-12-06 06:27:26 UTC (rev 1501)
@@ -34,7 +34,7 @@
cups.cs.cmu.edu 128.2.220.167 Sasha Romanosky, Serge Egelman
Carnegie Mellon University
- [XXX What is their logging policy?]
+ Request logs are not kept on the geographic information servers.
Each server maintains a GeoLite City database from MaxMind which
allows lookup of geographic location information for a given IP
@@ -115,7 +115,10 @@
queued request, but no longer than MAX_RESOLVE_QUEUE_DELAY
(currently 10 seconds) after the first queued request, before actually
launching the connection. This way we lump them together and send
- one larger request instead of several little ones.
+ one larger request instead of several little ones. If Vidalia's network
+ map window is not currently visible, the requests are queued until
+ either the queue contains requests for at least 1/4 of all known
+ servers, or the network map window becomes visible again.
If we don't get an answer, we don't retry -- if we don't have
geographic information for a server, it simply doesn't get mapped.
Modified: trunk/src/gui/network/netviewer.cpp
===================================================================
--- trunk/src/gui/network/netviewer.cpp 2006-12-05 07:23:50 UTC (rev 1500)
+++ trunk/src/gui/network/netviewer.cpp 2006-12-06 06:27:26 UTC (rev 1501)
@@ -363,12 +363,17 @@
void
NetViewer::resolve()
{
- if (!_resolveQueue.isEmpty() && isVisible()) {
- /* Flush the resolve queue and stop the timers */
- _geoip.resolve(_resolveQueue);
- _resolveQueue.clear();
- _minResolveQueueTimer.stop();
- _maxResolveQueueTimer.stop();
+ if (!_resolveQueue.isEmpty()) {
+ /* Send the request now if either the network map is visible, or the
+ * request is for more than a quarter of the servers in the list. */
+ if (isVisible() ||
+ (_resolveQueue.size() >= ui.treeRouterList->topLevelItemCount()/4)) {
+ /* Flush the resolve queue and stop the timers */
+ _geoip.resolve(_resolveQueue);
+ _resolveQueue.clear();
+ _minResolveQueueTimer.stop();
+ _maxResolveQueueTimer.stop();
+ }
}
}