[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r4360: Only update a stream's displayed target address in the netwo (in vidalia/trunk: . src/vidalia/network)



Author: edmanm
Date: 2010-07-30 22:41:16 -0400 (Fri, 30 Jul 2010)
New Revision: 4360

Modified:
   vidalia/trunk/CHANGELOG
   vidalia/trunk/src/vidalia/network/NetViewer.cpp
   vidalia/trunk/src/vidalia/network/StreamItem.cpp
Log:

Only update a stream's displayed target address in the network map if
no hostname was given in the stream's NEW status event. Fix suggested
by Robert Hogan. (Ticket #608)


Modified: vidalia/trunk/CHANGELOG
===================================================================
--- vidalia/trunk/CHANGELOG	2010-07-29 19:49:19 UTC (rev 4359)
+++ vidalia/trunk/CHANGELOG	2010-07-31 02:41:16 UTC (rev 4360)
@@ -1,3 +1,9 @@
+0.2.10  xx-xxx-2010
+  o  Only update a stream's displayed target address in the network map if
+     no hostname was given in the stream's NEW status event. Fix suggested
+     by Robert Hogan. (Ticket #608)
+
+
 0.2.9   20-May-2010
   o Remove the GoDaddy CA certificate bundle since we changed the
     certificate used to authenticate connections to

Modified: vidalia/trunk/src/vidalia/network/NetViewer.cpp
===================================================================
--- vidalia/trunk/src/vidalia/network/NetViewer.cpp	2010-07-29 19:49:19 UTC (rev 4359)
+++ vidalia/trunk/src/vidalia/network/NetViewer.cpp	2010-07-31 02:41:16 UTC (rev 4360)
@@ -281,17 +281,17 @@
 void
 NetViewer::addStream(const Stream &stream)
 {
-  QString target = stream.targetAddress();
-  QHostAddress addr(target);
-  
-  /* If the stream's target has an IP address instead of a host name,
+  /* If the new stream's target has an IP address instead of a host name,
    * check our cache for an existing reverse address mapping. */
-  if (!addr.isNull() && _addressMap.isMapped(target)) {
-    /* Replace the IP address in the stream event with the original 
-     * hostname */
-    ui.treeCircuitList->addStream(
-      Stream(stream.id(), stream.status(), stream.circuitId(),
-             _addressMap.mappedTo(target), stream.targetPort()));
+  if (stream.status() == Stream::New) {
+    QString target = stream.targetAddress();
+    if (! QHostAddress(target).isNull() && _addressMap.isMapped(target)) {
+      /* Replace the IP address in the stream event with the original 
+       * hostname */
+      ui.treeCircuitList->addStream(
+        Stream(stream.id(), stream.status(), stream.circuitId(),
+               _addressMap.mappedTo(target), stream.targetPort()));
+    }
   } else {
     ui.treeCircuitList->addStream(stream);
   }

Modified: vidalia/trunk/src/vidalia/network/StreamItem.cpp
===================================================================
--- vidalia/trunk/src/vidalia/network/StreamItem.cpp	2010-07-29 19:49:19 UTC (rev 4359)
+++ vidalia/trunk/src/vidalia/network/StreamItem.cpp	2010-07-31 02:41:16 UTC (rev 4360)
@@ -21,6 +21,10 @@
 /** Constructor */
 StreamItem::StreamItem(const Stream &stream)
 {
+  /* Set the stream's displayed target information */
+  setText(CircuitListWidget::ConnectionColumn, stream.target());
+  setToolTip(CircuitListWidget::ConnectionColumn, stream.target());
+ 
   /* Update the status and target */
   update(stream);
 }
@@ -30,8 +34,6 @@
 StreamItem::update(const Stream &stream)
 {
   _stream = stream;
-  setText(CircuitListWidget::ConnectionColumn, stream.target());
-  setToolTip(CircuitListWidget::ConnectionColumn, stream.target());
   setText(CircuitListWidget::StatusColumn, stream.statusString());
   setToolTip(CircuitListWidget::StatusColumn, stream.statusString());
 }