[Tkabber-dev] r1564 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Oct 19 16:18:18 MSD 2008


Author: sergei
Date: 2008-10-19 16:18:18 +0400 (Sun, 19 Oct 2008)
New Revision: 1564

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/login.tcl
Log:
	* login.tcl: Process DNS errors.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2008-10-19 11:56:48 UTC (rev 1563)
+++ trunk/tkabber/ChangeLog	2008-10-19 12:18:18 UTC (rev 1564)
@@ -35,6 +35,8 @@
 
 	* plugins/general/remote.tcl: Fixed typo.
 
+	* login.tcl: Process DNS errors.
+
 2008-10-18  Sergei Golovan  <sgolovan at nes.ru>
 
 	* presence.tcl: Fixed sending directed presence.

Modified: trunk/tkabber/login.tcl
===================================================================
--- trunk/tkabber/login.tcl	2008-10-19 11:56:48 UTC (rev 1563)
+++ trunk/tkabber/login.tcl	2008-10-19 12:18:18 UTC (rev 1564)
@@ -515,7 +515,14 @@
 	if {$lc(pollurl) != ""} {
 	    set url $lc(pollurl)
 	} else {
-	    set url [lindex [::xmpp::dns::resolveHTTPPoll $ascii_server] 0]
+	    if {[catch {::xmpp::dns::resolveHTTPPoll $ascii_server} urls]} {
+		set urls {}
+	    }
+	    if {[llength $urls] == 0} {
+		set url ""
+	    } else {
+		set url [lindex $urls 0]
+	    }
 	}
 
 	# TODO: Asynchronous connect
@@ -535,8 +542,10 @@
 	if {$lc(usealtserver)} {
 	    set hosts {}
 	} else {
-	    set hosts [::xmpp::dns::resolveXMPPClient $ascii_server]
-	    if {[lempty $hosts]} {
+	    if {[catch {::xmpp::dns::resolveXMPPClient $ascii_server} hosts]} {
+		set hosts {}
+	    }
+	    if {[llength $hosts] == 0} {
 		set hosts [list [list $ascii_server 5222]]
 	    }
 	}



More information about the Tkabber-dev mailing list