|
2022-09-10
| ||
| 12:07 | • Ticket [3382532fff] Synchronous geturl uses vwait status still Open with 5 o... artifact: 180a478e4e user: kjnash | |
|
2011-07-31
| ||
| 23:07 | • Add attachment httpsync.patch to ticket [3382532fff] artifact: 76e97284a1 user: ferrieux | |
| 23:07 | • Ticket [3382532fff] Synchronous geturl uses vwait status still Open with 4 o... artifact: d980af5b1a user: ferrieux | |
| 22:53 | • Ticket [3382532fff]: 4 changes artifact: 0ba5176684 user: ferrieux | |
| 22:44 | • Ticket [3382532fff]: 4 changes artifact: 0ced5b88ca user: ferrieux | |
| 22:21 | • Ticket [3382532fff]: 4 changes artifact: 364b8f06d4 user: ferrieux | |
| 22:20 | • Ticket [3382532fff]: 4 changes artifact: 59b68a9226 user: ferrieux | |
| 21:45 | • Ticket [3382532fff]: 1 change artifact: f02351c6f1 user: dkf | |
|
2011-07-29
| ||
| 23:01 | • New ticket [3382532fff]. artifact: e348c72218 user: ferrieux | |
Synchronous geturl uses vwait
Open3382532fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 4 years ago
Descriptionplain2011-07-29 23:01:38
This makes it impossible to use a synchronous geturl in an otherwise event-driven program (nested vwaits).
dkf Ticket [3382532fff]: 1 change
[History diff]2011-07-31 21:45:19
ferrieuxplain2011-07-31 22:20:44
Attached, very small, patch restores the fully sync behavior when neither -nocommand nor -timeout nor -queryprogress are specified. (Note that the fact that -queryprogress makes geturl async is not documented, and is nonetheless enforced by the http::wait in test http-3.10. So the current patch is also working around another misbehavior)
ferrieuxplain2011-07-31 22:21:18
File Added - 419862: httpsync.patch
ferrieuxplain2011-07-31 22:44:00
File Deleted - 419862:
ferrieuxplain2011-07-31 22:53:11
-querychannel and -channel also prevent the sync mode. The former for the same reason as -queryprogress (undocumented assumptions in tests); the latter because of heavily async fcopy machinery (could be relaxed).
ferrieuxplain2011-07-31 23:07:16
File Added - 419867: httpsync.patch
kjnashplain2022-09-10 12:07:04
The patch no longer works with current http. The http package now has more asynchronous code than it did when this bug was filed in 2011. http::Event has been made into a coroutine that yields to the event loop, with the connection made permanently non-blocking, in order to implement HTTP/1.1 pipelining. Part of http::geturl was given the same treatment in order to prevent blocking during socket connection. Many users want http::geturl to be asynchronous and to avoid long-running events that block a return to the event loop. These recent revisions are not needed for a synchronous HTTP connection. The simplest way to implement synchronous http::geturl would be to use an earlier version of http with the patch provided by ferrieux. However, the issues with -queryprogress, -querychannel, -channel, and -timeout would remain. An alternative might be to use a synchronous thread::send to run http::geturl asynchronously in another thread. However there will be issues about how much of the script would need to be accessible to the thread running geturl. The -proxyfilter, -progress and -queryprogress commands, the file sockets used by -channel and -querychannel, cookies, TLS and the certificate store, etc. I do not see an easy way to do synchronous http::geturl without the vwait nesting problem.
Log in (anonymous is fine) to add a comment.
Attachments:
- httpsync.patch [download] added by ferrieux on 2011-07-31 23:07:16. [details]