160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
# designed to emit a message to the HTTP client log. The string
# argument is the content of the message to emit. If the string
# argument is an empty string, nothing is written.
#
proc pageLog { string } {
if {[string length $string] > 0} then {
catch {
tclLog [appendArgs [pid] " : " [clock seconds] " : http : " $string]
}
}
}
#
# NOTE: This procedure was stolen from the "getEagle.tcl" script. It is
# designed to emit a progress indicator while an HTTP request is
|
>
|
|
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
# designed to emit a message to the HTTP client log. The string
# argument is the content of the message to emit. If the string
# argument is an empty string, nothing is written.
#
proc pageLog { string } {
if {[string length $string] > 0} then {
catch {
tclLog [appendArgs \
[pid] " : " [clock seconds] " : http : " $string]
}
}
}
#
# NOTE: This procedure was stolen from the "getEagle.tcl" script. It is
# designed to emit a progress indicator while an HTTP request is
|
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
set token [eval ::http::geturl [list $uri] $args]
#
# NOTE: Grab the HTTP response code and data now as they are needed
# in almost all cases.
#
set code [::http::ncode $token]; set data [::http::data $token]
#
# NOTE: Check the HTTP response code, in order to follow any HTTP
# redirect responses.
#
switch -glob -- $code {
100 -
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
|
set token [eval ::http::geturl [list $uri] $args]
#
# NOTE: Grab the HTTP response code and data now as they are needed
# in almost all cases.
#
set code [::http::ncode $token]; set data [::http::data $token]
#
# NOTE: If the HTTP response code is an empty string that may
# indicate a serious bug in the tls (or http) package for
# this platform. So far, this issue has only been seen
# with the tls 1.6.1 package that shipped with macOS.
#
if {[string length $code] == 0} then {
error [appendArgs \
"received empty HTTP response code for URL \"" $uri \
"\", the \"tls\" (and/or \"http\") package(s) may be " \
"broken for this platform"]
}
#
# NOTE: Check the HTTP response code, in order to follow any HTTP
# redirect responses.
#
switch -glob -- $code {
100 -
|