From 36907337fa37b07da48dd6d2f7027a12f58a2316 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Fri, 22 Feb 2008 11:36:49 +0000 Subject: Fix for #1815865 - always check the existence of the state array when checking http::status --- ChangeLog | 6 ++++++ library/http/http.tcl | 9 +++++---- library/http/pkgIndex.tcl | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb7de07..645e02e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-22 Pat Thoyts + + * library/http/pkgIndex.tcl: Set version 2.5.4 + * library/http/http.tcl: Fix for bug #1818565. Always check that + the state array exists in the http::status command. + 2008-02-06 Don Porter *** 8.4.18 TAGGED FOR RELEASE *** diff --git a/library/http/http.tcl b/library/http/http.tcl index c412f6e..cc91421 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: http.tcl,v 1.43.2.13 2006/10/06 05:56:48 hobbs Exp $ +# RCS: @(#) $Id: http.tcl,v 1.43.2.14 2008/02/22 11:36:56 patthoyts Exp $ # Rough version history: # 1.0 Old http_get interface. @@ -24,7 +24,7 @@ package require Tcl 8.4 # Keep this in sync with pkgIndex.tcl and with the install directories # in Makefiles -package provide http 2.5.3 +package provide http 2.5.4 namespace eval http { variable http @@ -632,6 +632,7 @@ proc http::data {token} { return $state(body) } proc http::status {token} { + if {![info exists $token]} { return "error" } variable $token upvar 0 $token state return $state(status) @@ -940,7 +941,7 @@ proc http::Eof {token} { # http::wait -- # -# See documentaion for details. +# See documentation for details. # # Arguments: # token Connection token. @@ -957,7 +958,7 @@ proc http::wait {token} { vwait $token\(status) } - return $state(status) + return [status $token] } # http::formatQuery -- diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index af88a2e..eaf0c86 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.5.3 [list tclPkgSetup $dir http 2.5.3 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.5.4 [list tclPkgSetup $dir http 2.5.4 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] -- cgit v0.12