Overview
| Artifact ID: | 9b1d205dc7559029681dbe87399bf7160e8ebb23992a5fe15d047ef4e6ca7ed4 |
|---|---|
| Ticket: | 1253676fffffffffffffffffffffffffffffffff
http::geturl should not vwait when used asynchronously |
| User & Date: | kjnash on 2022-09-09 17:41:58 |
Changes
- assignee changed to: "aku"
- closedate changed to: "2459832.2374814"
- closer changed to: "kjnash"
- comment changed to:
When http::geturl is called with -command and -timeout > 0 it should not vwait for the socket connection to be established. Instead it should return immediately to the caller and do any further actions in event handlers. See also http://wiki.tcl.tk/1255 Here's the original discussion on the Tcler's chat about this subject: [21:30]schelteHow sneaky, http::geturl uses a vwait [21:32]kbk_schelte - But you can get it to return immediately by giving it -command [21:33]schelteThat's what I'm doing. It still uses vwait for opening the socket in -async mode ... [21:35]kbk_Not if -timeout is 0. [21:36]schelteYeah, but of course it isn't. Can't hang up the program because a site cannot be reached. [21:37]kbk_You're right, it would be better to isolate the continuation. Best to log a feature request on that. I tak it that The Right Thing would be to make the part of geturl after line 372 or so into a callback? [21:38]kbk_There doesn't appear to be much state being passed from before that point to after it, so that mightn't even be that difficult. [21:43]schelteThis is only true if both -command and -timeout are specified. [21:43]schelteIf only -timeout is used, the current method will still have to be used. [21:45]kbk_Right. [21:45]kbk_In that case, we should still set up the callback, but then a vwait is appropriate; the caller's asked for it. [21:48]schelteYes, it just makes the code a bit more complicated. [21:49]kbk_Not even that bad - the callback structure would be the same in all cases. It's just a decision that if there is no -command, then vwait before returning.
- icomment:
This abuse of vwait, disguised as http::wait, was fixed in [c2dabc4396] on 2013-01-17. The fix was merged into core-8-5-branch in [e47216d06d] on 2013-04-04, and into the trunk in [b242bb3e4b] on 2013-01-23. The bug was duplicated as [2911139] which provided the fix.
- login: "kjnash"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- severity changed to: "Minor"
- status changed to: "Closed"