Eggdrop 1.6.21
TCL 8.4.13
HTTP 2.2 or 2.7.9
I've been having some crazy hair-pulling problems with TCL and its HTTP module.
I have some simple TCL code that executes whenever someone types a specific command into chat. This command simply submits an HTTP query. (It happens the query is to a Google docs form, though I'm not sure that's relevant.)
Code: Select all
set query [::http::formatQuery "pageNumber" 0 "entry.0.single" $a "entry.1.single" $b "entry.2.single" $c "entry.4.single" $d "entry.6.single" $e "entry.7.single" $f]
set token [::http::geturl $url -timeout 45000 -query $query]
set status [::http::status $token]
if {$status != "ok"} {
putchan $chan "Error..."
::http::cleanup $token
return 1
}
::http::cleanup $token
return 1
Code: Select all
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 1 0 *******************:33810 nuq04s08-in-f7.1e100.n:http CLOSE_WAIT
From this point on, every future HTTP connection from the bot will fail (timeout). It fails because the socket it obtains never becomes writable (on this line in http code):
Code: Select all
fileevent $sock writable [list http::Connect $token]
Can anyone offer me any suggestions?
I've tried high and low to reproduce this problem directly in the TCL interpreter via scripts that submit queries every X seconds, but I've never been able to reproduce it in this way.
Thank you.