Buy commercial curl support from WolfSSL. 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
himself.
Re: Cached CURL handle causing problems with PUT Data?
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 21 Apr 2021 00:00:06 +0200 (CEST)
On Tue, 20 Apr 2021, kent williams via curl-library wrote:
> I implemented using the same CURL handle across separate HTTP requests, but
> it appears to screw things up in the case where I use it after a PUT, if
> I've used CURLOPT_READDATA and CURLOPT_READFUNCTION.
>
> How do I reset those options so that a subsequent GET request doesn't try
> and use that put data?
Set CURLOPT_READFUNCTION to NULL to reset it - as mentioned in the man page.
But also, if you reset it to do a GET (with CURLOPT_HTTPGET) it won't use the
read callback anyway.
> Also if I set CURLOPT_CUSTOMREQUEST, how do I reset it?
For ordinary PUT you don't need CURLOPT_CUSTOMREQUEST, but you set it to NULL
to reset it. As documented.
Date: Wed, 21 Apr 2021 00:00:06 +0200 (CEST)
On Tue, 20 Apr 2021, kent williams via curl-library wrote:
> I implemented using the same CURL handle across separate HTTP requests, but
> it appears to screw things up in the case where I use it after a PUT, if
> I've used CURLOPT_READDATA and CURLOPT_READFUNCTION.
>
> How do I reset those options so that a subsequent GET request doesn't try
> and use that put data?
Set CURLOPT_READFUNCTION to NULL to reset it - as mentioned in the man page.
But also, if you reset it to do a GET (with CURLOPT_HTTPGET) it won't use the
read callback anyway.
> Also if I set CURLOPT_CUSTOMREQUEST, how do I reset it?
For ordinary PUT you don't need CURLOPT_CUSTOMREQUEST, but you set it to NULL
to reset it. As documented.
-- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://www.wolfssl.com/contact/ ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2021-04-21