summaryrefslogtreecommitdiffstats
path: root/library/http
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2022-11-07 22:06:42 (GMT)
committerkjnash <k.j.nash@usa.net>2022-11-07 22:06:42 (GMT)
commite977d6e7af0d658006f243be34f927a266b0fc23 (patch)
treeab21ee30cc20977936ab819da12ad4eb788b4660 /library/http
parentc3e9fc9aedad22f58fd1fe766f6d01ccb8d3d6f7 (diff)
downloadtcl-e977d6e7af0d658006f243be34f927a266b0fc23.zip
tcl-e977d6e7af0d658006f243be34f927a266b0fc23.tar.gz
tcl-e977d6e7af0d658006f243be34f927a266b0fc23.tar.bz2
library/http/http.tcl - bugfix OpenSocket to replay any requests in the socketPhQueue placeholder queue, if the socket was not created.
Diffstat (limited to 'library/http')
-rw-r--r--library/http/http.tcl15
1 files changed, 14 insertions, 1 deletions
diff --git a/library/http/http.tcl b/library/http/http.tcl
index f1d5f8b..4c9f6a7 100644
--- a/library/http/http.tcl
+++ b/library/http/http.tcl
@@ -1753,7 +1753,20 @@ proc http::OpenSocket {token DoLater} {
ConfigureNewSocket $token $sockOld $DoLater
##Log OpenSocket success $sock - token $token
} result errdict]} {
- ##Log OpenSocket failed $result - token $token
+ ##Log OpenSocket failed $result - token $token
+ # There may be other requests in the socketPhQueue.
+ # Prepare socketPlayCmd so that Finish will replay them.
+ if { ($state(-keepalive)) && (!$state(reusing))
+ && [info exists socketPhQueue($sockOld)]
+ && ($socketPhQueue($sockOld) ne {})
+ } {
+ if {$socketMapping($state(socketinfo)) ne $sockOld} {
+ Log "WARNING: this code should not be reached.\
+ {$socketMapping($state(socketinfo)) ne $sockOld}"
+ }
+ set socketPlayCmd($state(socketinfo)) [list ReplayIfClose Wready {} $socketPhQueue($sockOld)]
+ set socketPhQueue($sockOld) {}
+ }
if {[string range $result 0 20] eq {proxy connect failed:}} {
# - The HTTPS proxy did not create a socket. The pre-existing value
# (a "placeholder socket") is unchanged.