Στις 20-08-2009, ημέρα Πεμ, και ώρα 22:25 -0400, ο/η Stéphane Graber
έγραψε:
> Could you try the attached patch ?
> 
> My patch simply ensure that all ICA running on localhost will appear as
> 127.0.0.1 and that there are no duplicate in the final list. That should
> fix your issue.

Hi Stéphane,

The patch that you attached works fine, except for a small glitch:

local_addr had not yet been assigned a value before the call to
getAvahiHosts, so I had to move these two lines above the call:

  local_addr=getLocalIPs()
  isdhost,isdport=getHostPort()

Thanks a lot,
Alkis
=== modified file 'debian/italc-launcher'
--- debian/italc-launcher	2009-08-19 06:17:13 +0000
+++ debian/italc-launcher	2009-08-21 10:02:49 +0300
@@ -87,6 +87,7 @@
     return hosts
 
 def getAvahiHosts():
+    global local_addr
     hosts=[]
     if not os.path.exists("/usr/bin/avahi-browse"):
         return hosts
@@ -98,7 +99,11 @@
                 param=line.split(";")
                 comment=re.findall('"(.*)" "(.*)" "(.*)" "(.*)"\n',param[9])[0]
                 if (comment[1] == md5_1 or comment[2] == md5_2 or comment[3] == md5_3):
-                    hosts.append([param[7]+":"+param[8],1,comment[0]])
+                    if param[7] in local_addr:
+                        param[7]="127.0.0.1"
+                    host=[param[7]+":"+param[8],1,comment[0]]
+                    if host not in hosts:
+                        hosts.append(host)
             except:
                 print 'Ignoring a client, invalid data received'
     return hosts
@@ -145,13 +150,13 @@
 avahi.setAttribute("forcevisible","yes")
 body.appendChild(avahi)
 
+local_addr=getLocalIPs()
+isdhost,isdport=getHostPort()
+
 # Add computers to the classroom
 clients=getAvahiHosts()+getClusterHosts()
 count=0
 
-local_addr=getLocalIPs()
-isdhost,isdport=getHostPort()
-
 if isdhost not in local_addr:
     local_addr=[isdhost]
 
-- 
edubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/edubuntu-devel

Reply via email to