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

[vidalia-svn] r1953: Give ControlConnection a handy isConnected() method. (in trunk: . src/control)



Author: edmanm
Date: 2007-09-29 16:58:49 -0400 (Sat, 29 Sep 2007)
New Revision: 1953

Modified:
   trunk/
   trunk/src/control/controlconnection.cpp
   trunk/src/control/controlconnection.h
Log:
 r1972@lysithea:  edmanm | 2007-09-29 15:48:40 -0400
 Give ControlConnection a handy isConnected() method.



Property changes on: trunk
___________________________________________________________________
 svk:merge ticket from /local/vidalia/trunk [r1972] on dc66be73-d13e-47ba-a267-8dc7cda68c65

Modified: trunk/src/control/controlconnection.cpp
===================================================================
--- trunk/src/control/controlconnection.cpp	2007-09-28 13:05:29 UTC (rev 1952)
+++ trunk/src/control/controlconnection.cpp	2007-09-29 20:58:49 UTC (rev 1953)
@@ -160,6 +160,13 @@
   exit(0);
 }
 
+/** Returns true if the control socket is connected to Tor. */
+bool
+ControlConnection::isConnected()
+{
+  return (status() == Connected);
+}
+
 /** Returns the status of the control connection. */
 ControlConnection::Status
 ControlConnection::status()

Modified: trunk/src/control/controlconnection.h
===================================================================
--- trunk/src/control/controlconnection.h	2007-09-28 13:05:29 UTC (rev 1952)
+++ trunk/src/control/controlconnection.h	2007-09-29 20:58:49 UTC (rev 1953)
@@ -66,6 +66,8 @@
   void cancelConnect();
   /** Disconnect from Tor's control interface. */
   void disconnect();
+  /** Returns true if the control socket is connected to Tor. */
+  bool isConnected();
   /** Returns the status of the control connection. */
   Status status();
   /** Sends a control command to Tor and waits for the reply. */