diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-02-08 15:03:35 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-02-08 15:03:35 (GMT) |
commit | 35c72808bf91794671a1b947e665c2a200ddd61d (patch) | |
tree | 1df97bf2fa4569b61e6964b4ae9bdf81a3c07670 /library/http | |
parent | 859eff84db9b495f0a1b3f31891771cf97ef84b0 (diff) | |
parent | b6ae0212a194c6c55a0c05a0f2194213da433583 (diff) | |
download | tcl-35c72808bf91794671a1b947e665c2a200ddd61d.zip tcl-35c72808bf91794671a1b947e665c2a200ddd61d.tar.gz tcl-35c72808bf91794671a1b947e665c2a200ddd61d.tar.bz2 |
merge trunk
Diffstat (limited to 'library/http')
-rw-r--r-- | library/http/http.tcl | 21 | ||||
-rw-r--r-- | library/http/pkgIndex.tcl | 2 |
2 files changed, 13 insertions, 10 deletions
diff --git a/library/http/http.tcl b/library/http/http.tcl index 8985368..81a008a 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -11,7 +11,7 @@ package require Tcl 8.6 # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles -package provide http 2.8.7 +package provide http 2.8.8 namespace eval http { # Allow resourcing to not clobber existing data @@ -117,7 +117,7 @@ if {[info command http::Log] eq {}} {proc http::Log {args} {}} proc http::register {proto port command} { variable urlTypes - set urlTypes($proto) [list $port $command] + set urlTypes([string tolower $proto]) [list $port $command] } # http::unregister -- @@ -131,11 +131,12 @@ proc http::register {proto port command} { proc http::unregister {proto} { variable urlTypes - if {![info exists urlTypes($proto)]} { + set lower [string tolower $proto] + if {![info exists urlTypes($lower)]} { return -code error "unsupported url type \"$proto\"" } - set old $urlTypes($proto) - unset urlTypes($proto) + set old $urlTypes($lower) + unset urlTypes($lower) return $old } @@ -522,12 +523,13 @@ proc http::geturl {url args} { if {$proto eq ""} { set proto http } - if {![info exists urlTypes($proto)]} { + set lower [string tolower $proto] + if {![info exists urlTypes($lower)]} { unset $token return -code error "Unsupported URL type \"$proto\"" } - set defport [lindex $urlTypes($proto) 0] - set defcmd [lindex $urlTypes($proto) 1] + set defport [lindex $urlTypes($lower) 0] + set defcmd [lindex $urlTypes($lower) 1] if {$port eq ""} { set port $defport @@ -658,7 +660,8 @@ proc http::Connected { token proto phost srvurl} { set host [lindex [split $state(socketinfo) :] 0] set port [lindex [split $state(socketinfo) :] 1] - set defport [lindex $urlTypes($proto) 0] + set lower [string tolower $proto] + set defport [lindex $urlTypes($lower) 0] # Send data in cr-lf format, but accept any line terminators diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index 753b972..8b48a9f 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,4 +1,4 @@ if {![package vsatisfies [package provide Tcl] 8.6]} {return} -package ifneeded http 2.8.7 [list tclPkgSetup $dir http 2.8.7 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.8.8 [list tclPkgSetup $dir http 2.8.8 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] package ifneeded cookiejar 0.1 [list source [file join $dir cookiejar.tcl]] package ifndeeded tcl::idna 1.0 [list source [file join $dir idna.tcl]] |