conduit r1559 - in trunk: . conduit/modules/NetworkModule



Author: jstowers
Date: Wed Jul 16 04:49:03 2008
New Revision: 1559
URL: http://svn.gnome.org/viewvc/conduit?rev=1559&view=rev

Log:
Send and check the protocol version over the network module. This will require the maemo packages to be updated

Modified:
   trunk/   (props changed)
   trunk/conduit/modules/NetworkModule/Peers.py

Modified: trunk/conduit/modules/NetworkModule/Peers.py
==============================================================================
--- trunk/conduit/modules/NetworkModule/Peers.py	(original)
+++ trunk/conduit/modules/NetworkModule/Peers.py	Wed Jul 16 04:49:03 2008
@@ -19,6 +19,7 @@
 
 AVAHI_SERVICE_NAME = "_conduit._tcp"
 AVAHI_SERVICE_DOMAIN = ""
+PROTOCOL_VERSION = "1"
 
 PORT_IDX = 0
 VERSION_IDX = 1
@@ -165,7 +166,9 @@
                 AVAHI_SERVICE_DOMAIN,   #domain
                 '',                     #host
                 dbus.UInt16(self.port), #port
-                string_array_to_txt_array(["version=%s" % conduit.VERSION])
+                string_array_to_txt_array([
+                                "version=%s" % conduit.VERSION,
+                                "protocol-version=%s" % PROTOCOL_VERSION])
                 )
         self.group.Commit()
             
@@ -243,10 +246,13 @@
 
         # Check if the service is local and then check the 
         # conduit versions are identical
-        if extra.has_key("version") and extra["version"] == conduit.VERSION:
+        if extra.get("protocol-version", None) == PROTOCOL_VERSION:
             self.detected_cb(str(name), str(host), str(address), str(port), extra_info)
         else:
-            log.debug("Ignoring %s because remote conduit is different version" % name)
+            log.debug("Ignoring %s (version: %s, protocol version: %s)" % (
+                            name,
+                            extra.get("version", "unknown"),
+                            extra.get("protocol-version", "unknown")))
 
     def _remove_service(self, interface, protocol, name, type, domain, flags):
         """



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