New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ephiperfifo.c example #5485
Comments
I was able to reproduce the output by triggering a bad case (i.e. passing in an unresolvable hostname). Looking further into the ephiperfifo source code, it appears that, unless In real world scenarios, the documentation suggests CURLMOPT_TIMER_FUNCTION setting a non-repeating timer, so that the timer will not be triggered repeatedly when bad cases arise (where there's no need to reset a timer). I ended up turning these interval settings to 0: curl/docs/examples/ephiperfifo.c Line 149 in f3d501d
curl/docs/examples/ephiperfifo.c Line 158 in f3d501d
curl/docs/examples/ephiperfifo.c Line 491 in f3d501d
|
@Billyzou0741326 would you mind submitting these fixes as a pull request? |
I did this
Ran the example, passed URL to the fifo
I expected the following
Whenever the last transfer finishes, I'd expect to see
"last transfer done, kill timeout"
and the mainloop waits for the next fifo call, without timer events
What I saw
Sometimes the message above is missing, and the mainloop keeps calling the timer after the last transfer is done.
curl/libcurl version
curl 7.66.0 (x86_64-redhat-linux-gnu) libcurl/7.66.0 OpenSSL/1.1.1d-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.0/openssl/zlib nghttp2/1.39.2
Release-Date: 2019-09-11
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
operating system
Linux fc31 5.3.7-301.fc31.x86_64 #1 SMP Mon Oct 21 19:18:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Extra info:
In the good case, the end of the sequence is generally:
REMAINING: 1
Progress: http://www.example.com (62/62)
socket callback: s=6 e=0x54a1e20 what=REMOVE
multi_timer_cb: Setting timeout to -1 ms
REMAINING: 0
DONE: http://www.example.com => (0)
last transfer done, kill timeout
In the "bad" case, it's:
REMAINING: 1
socket callback: s=6 e=0x5482b60 what=REMOVE
Progress: http://www.example.com (62/62)
REMAINING: 0
DONE: http://www.leahnim.org => (0)
REMAINING: 0
REMAINING: 0
...
Call chain in the good case seems to be:
curl_multi_socket_action(real socket)-> { write_callback ; socket_callback remove action } -> timer_callback -1
In the bad case:
curl_multi_socket_action(TIMEOUT) -> {write_callback ; socket_callback remove action }
i.e. the timer callback isn't called.
The text was updated successfully, but these errors were encountered: