[Tkabber-dev] r728 - in trunk/tkabber: . plugins/filetransfer plugins/si

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Sep 24 10:39:35 MSD 2006


Author: sergei
Date: 2006-09-24 10:39:28 +0400 (Sun, 24 Sep 2006)
New Revision: 728

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/filetransfer/si.tcl
   trunk/tkabber/plugins/si/socks5.tcl
Log:
	* filetransfer/si.tcl: Do not use progressbar if file size is
	  zero (thanks to Konstantin Khomoutov).

	* si/socks5.tcl: Removed forgotten debug code.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-09-23 19:48:37 UTC (rev 727)
+++ trunk/tkabber/ChangeLog	2006-09-24 06:39:28 UTC (rev 728)
@@ -1,3 +1,10 @@
+2006-09-24  Sergei Golovan  <sgolovan at nes.ru>
+
+	* filetransfer/si.tcl: Do not use progressbar if file size is
+	  zero (thanks to Konstantin Khomoutov).
+
+	* si/socks5.tcl: Removed forgotten debug code.
+
 2006-09-23  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/filetransfer/si.tcl, plugins/si/ibb.tcl,

Modified: trunk/tkabber/plugins/filetransfer/si.tcl
===================================================================
--- trunk/tkabber/plugins/filetransfer/si.tcl	2006-09-23 19:48:37 UTC (rev 727)
+++ trunk/tkabber/plugins/filetransfer/si.tcl	2006-09-24 06:39:28 UTC (rev 728)
@@ -121,9 +121,11 @@
 
     set name [file tail $state(filename)]
     set size [file size $state(filename)]
+    set state(size) $size
 
     if {$size == 0} {
-	$state(pb) configure -maximum -1
+	$state(pb) configure -maximum 1
+	set state(progress) -1
     } else {
 	$state(pb) configure -maximum $size
     }
@@ -185,7 +187,9 @@
 	    -message [format [::msgcat::mc "Transfer failed: %s"] \
 			  [lindex $res 1]] -type user \
 	    -buttons ok -default 0 -cancel 0
-	set state(progress) 0
+	if {$state(size) > 0} {
+	    set state(progress) 0
+	}
 	si::close $state(stream)
 	si::freeout $state(stream)
 	close $state(fd)
@@ -193,7 +197,9 @@
 	return
     }
 
-    set state(progress) [tell $state(fd)]
+    if {$state(size) > 0} {
+	set state(progress) [tell $state(fd)]
+    }
     after idle [list [namespace current]::send_chunk $token]
 }
 

Modified: trunk/tkabber/plugins/si/socks5.tcl
===================================================================
--- trunk/tkabber/plugins/si/socks5.tcl	2006-09-23 19:48:37 UTC (rev 727)
+++ trunk/tkabber/plugins/si/socks5.tcl	2006-09-24 06:39:28 UTC (rev 728)
@@ -159,7 +159,7 @@
     set myjid [jlib::connection_jid $state(connid)]
     set hash [::sha1::sha1 $state(id)$myjid$state(jid)]
     set hash_sid($hash) $state(id)
-::close $servsock
+
     set streamhosts [list [jlib::wrapper:createtag streamhost \
 			       -vars [list jid $myjid \
 					   host $ip \
@@ -273,7 +273,7 @@
 	set port [jlib::wrapper:getattr $vars2 port]
 	
 	# Target uses proxy, so closing server socket
-	catch {::close $state(servsock)}
+	::close $state(servsock)
 	proxy_connect $stream $jid $host $port $command
     }
 }



More information about the Tkabber-dev mailing list