cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Problem with cookie

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 17 Apr 2002 08:52:28 +0200 (MET DST)

On Tue, 16 Apr 2002, Mandar Wadekar wrote:

> ok. I was able to force the cookie. Some formatting of the cookie was
> necessary before I could send it such as removing trailing white spaces or
> newline characters. I could get the page now. But the question remains is,
> why I have to do this on windows when its *not* necessary on Unix.

From what contents did you remove "trailing white spaces or newline
characters" ? Was it from the contents you saw in the headers that curl
received, or was it from contents that were stored in the cookiejar file?

I did ask you several questions in my previous mail that you left unanswered
and that make the debugging this harder.

> Furthermore, while trying various versions, I built 7.9.5 version. But it
> consistently failed in I/O operations. I tracked down to following line :
>
> CURLcode Curl_client_write(struct SessionHandle *data,
> int type,
> char *ptr,
> size_t len)
> {
> size_t wrote;
>
> if(0 == len)
> len = strlen(ptr);
>
> if(type & CLIENTWRITE_BODY) {
> /**************Following operation
> fails************************************/
> wrote = data->set.fwrite(ptr, 1, len, data->set.out);
> /***********************************************************************
> ****/
> if(wrote != len) {
> failf (data, "Failed writing body");
> return CURLE_WRITE_ERROR;
> }
> }
> ....
> ....
> }
>
> I checked the value of data->set.out and the FILE* I am setting. They are
> same. There is no corruption of the pointer value.

Yes, but were you allowed to write to that file? set.fwrite is simply a
pointer to the fwrite() function by default, so if that returns an error,
well then it is bad...

I trust that if you're using libcurl as a windows DLL, you have read the docs
regarding CURLOPT_WRITEFUNCTION too...

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-17