cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: overriding automatic Expect: 100-continue behavior

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 8 Aug 2006 23:03:45 +0200 (CEST)

On Tue, 8 Aug 2006, Andrew Biggs wrote:

> Now to my problem... I'm using libcurl3-7.15.4-1 to talk webdav to an
> Exchange server, which doesn't seem to like the "Expect: 100-continue"
> header that libcurl is adding to the request when the submitted data exceeds
> 1024 bytes. Turning off the header is easy, I've already added an "Expect:"
> header which does a nice job of preventing libcurl from adding it
> automatically. The problem remains, though, that libcurl still does not
> transmit the "post-data" (actually, the command is PROPATCH set using
> CURLOPT_CUSTOMREQUEST) immediately following the request headers. So, the
> header is gone, but the behavior remains. That is, libcurl is still waiting
> for a 100 Continue from the server before it will sent the data.
>
> Is this expected behavior? Is there a way to tell libcurl: "look, I know
> the post-data is a bit long (1435 bytes), just send it all at once anyway
> please"?

No, it is not the expected behavior. There's code in libcurl
(lib/http.c:expect100()) that checks if the header is disabled, and only if it
isn't it adds the header and sets the variable that makes it expect a 100
header.

Now, I see a slight flaw in how this is stored and kept state-wise, it will
not be properly switched off when a first post is using expect and the second
is not when re-using a connection, but I don't think that's what you're
seeing, is it?

How can you tell libcurl is waiting for the 100 response?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-08-08