curl-library
Re: libCurl does not send data using multi interface on high latency connections
Date: Thu, 13 Sep 2018 13:59:45 -0300
> When you say libcurl never sends the request of the connection, we need to
> figure out what activities (CURL_POLL_IN / CURL_POLL_OUT) curl asked you to
> wait for and what activities on that socket you told libcurl to act on with
> curl_multi_socket_action().
Ok, I've added new fprintf to get more insight on the problem. The
added logs start with an arrow (-->)
The important things happens after the line "Connected to
127.0.0.1....." which is logged by libCurl.
After the connect, I call curl_multi_socket_action with action 2
(CURL_POLL_OUT).
Then libCurl calls sock_cb callback with action 4 which is CURL_POLL_REMOVE.
Finally curl_multi_socket_action returns with code 0 and running_handles=1.
The thing I do not comprehend is why after calling
curl_multi_socket_action with CURL_POLL_OUT, libCurls then call me
with the event CURL_POLL_REMOVE instead of simply write the data.
I've configured a bigger timeout of 2000 ms with CURLOPT_TIMEOUT_MS in
case that was the problem, but it did not change the results. It keeps
saying "Operation timed out after 2000 milliseconds with 0 out of 0
bytes received".
Am I missing something about that sequence of events?
This is the complete trace:
Adding easy 0xe78d40 to multi 0xe48e90 (127.0.0.1:8124)
multi_timer_cb: timeout_ms 0
* Rebuilt URL to: 127.0.0.1:8124/
timer_cb:
opensocket :
* Trying 127.0.0.1...
* TCP_NODELAY set
Opened socket 6
sock_cb: socket=6, what=2, sockp=(nil)
socket callback: s=6 e=0xe78d40 what=OUT
Adding data: OUT
setsock: socket=6, act=2, fdp=0xe830a0
watching for socket to become writable
multi_timer_cb: timeout_ms 0
timer_cb:
multi_timer_cb: timeout_ms 199
REMAINING: 1
REMAINING: 1
timer_cb:
multi_timer_cb: timeout_ms 1
REMAINING: 1
timer_cb:
multi_timer_cb: timeout_ms 1800
REMAINING: 1
event_cb: action=2
* Connected to 127.0.0.1 (127.0.0.1) port 8124 (#0)
-->calling curl_multi_socket_action with action=2
sock_cb: socket=6, what=4, sockp=0xe830a0
socket callback: s=6 e=0xe78d40 what=REMOVE
remsock: sockp=0xe830a0
-->curl_multi_socket_action returned rc=0 with running_handles=1
REMAINING: 1
* Operation timed out after 2000 milliseconds with 0 out of 0 bytes received
* Closing connection 0
timer_cb:
close_socket : 6
REMAINING: 0
DONE: http://127.0.0.1:8124/ => (28) Operation timed out after 2000
milliseconds with 0 out of 0 bytes received
done.
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-09-13