On 7/17/2017 3:50 PM, Jeroen Ooms via curl-library wrote:
On Thu, Jul 6, 2017 at 9:59 AM, Daniel Stenberg <[email protected]> wrote:

Applications that currently disable Expect: header use should of course not be 
affected by this sort of change. They would just disable it extra much! =)

I've been debugging a problem with a server randomly returning 408 for
POST requests occasionally, and I finally understand now it is
happening because of this 1000ms idle time.

What is the proper way to disable the 'Expect' header which will work
across versions of libcurl? Does this work?

   assert(curl_easy_setopt(handle, CURLOPT_EXPECT_100_TIMEOUT_MS, 0L));

I can't comment on use of the Expect header, but I will note that you should never put code with side effects into an assert() call - it may in fact be a macro that is compiled out when NDEBUG is set. On my local Linux machine, /usr/include/assert.h has this (simplified somewhat):

#ifdef NDEBUG
#define assert(expr) ((void) 0)
#endif

As you can see, the expression will not be executed.

Instead you'd want:

CURLcode res;

res = curl_easy_setopt(handle, CURLOPT_EXPECT_100_TIMEOUT_MS, 0L);
assert(res);

--
    David Chapman      [email protected]
    Chapman Consulting -- San Jose, CA
    Software Development Done Right.
    www.chapman-consulting-sj.com

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to