Buy commercial curl support. We
help you work out your issues, debug your libcurl applications, use the API,
port to new platforms, add new features and more. With a team lead by the
curl founder Daniel himself.
Re: How to dry-run a http request
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Dan Fandrich via curl-library <curl-library_at_lists.haxx.se>
Date: Sat, 15 Feb 2025 11:59:10 -0800
On Sat, Feb 15, 2025 at 08:48:48PM +0100, Jeroen Ooms wrote:
> The difficult part is that I need a callback function for the moment
> where libcurl is done uploading (When curlopt_verbose says "Request
There has been a proposal for a callback to provide events on a connection, but
I don't recall where it currently stands.
> completely sent off") such that I know I have received full request
> data and can close() the socket at that point.
You can probably get away with just the timeout scheme I suggested. If you set
high (or infinite) values for all timeouts then the transfer will never
complete, except that it MUST timeout to complete because there's no server
there and there will never be a response. So, if you set a minimum timeout for
CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, the timeout should immediately be hit after
the request is sent and the request will complete.
Dan
Date: Sat, 15 Feb 2025 11:59:10 -0800
On Sat, Feb 15, 2025 at 08:48:48PM +0100, Jeroen Ooms wrote:
> The difficult part is that I need a callback function for the moment
> where libcurl is done uploading (When curlopt_verbose says "Request
There has been a proposal for a callback to provide events on a connection, but
I don't recall where it currently stands.
> completely sent off") such that I know I have received full request
> data and can close() the socket at that point.
You can probably get away with just the timeout scheme I suggested. If you set
high (or infinite) values for all timeouts then the transfer will never
complete, except that it MUST timeout to complete because there's no server
there and there will never be a response. So, if you set a minimum timeout for
CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, the timeout should immediately be hit after
the request is sent and the request will complete.
Dan
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2025-02-15