I am trying to pause the http(HTTP 1.1) connection in the write call back using curl_easy_pause() API. The API returns success and does not invoke write call back. Once resumed, I see write call back delivering more data per second then what is being configured using CURLOPT_MAX_RECV_SPEED_LARGE. This issue has been reported here: #3240 and fix available in 7.69.1, but it does not seems to be working.
I have tried returning CURL_WRITEFUNC_PAUSE inside write callback. Same result.
I expected the following
I don't expect any data exchange between server and client till resume is called. Even after resuming, expecting CURLOPT_MAX_RECV_SPEED_LARGE data size to be delivered not more than that.
And also would like to know what is the maximum time we can pause the http connection.
Currently using 7.69.1 and tested with latest also 7.84.0
[curl -V output]
The text was updated successfully, but these errors were encountered:
@bagder I see that only invoking of write call back from libcurl is paused. I believe that the underlying socket still receives data from server which is accumulated in socket buffer(Fix from #3240 looks like we are just skipping the read from socket, not pausing data exchange between the client and http server, not sure if it is possible in any way). So when we un-pause the connection, we are receiving more data probably because of all accumulated in the socket buffer.
Reading the code, we don't have any consideration for CURLOPT_MAX_RECV_SPEED_LARGE when a transfer is unpaused and the cached data is delivered to the application. I think I would rather document this as a known behavior than trying to fix it, because it is going to be a rather kludgy fix - unpausing the transfer but still not actually receiving data because the draining of the cache isn't complete.