cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Behavior of -D and -c options in curl

From: imran shaik <sk.imran_at_yahoo.com>
Date: Tue, 16 Jan 2007 07:27:48 -0800 (PST)

Daniel,
  
  I think I got what I needed this time. Probably I didn't put up my words clearly.
  
  -D dumps the headers to the file as soon as they are received.
  
> What is the behavior of -c when writing cookies?
  
  They are written to the file when the 'CURL' handle is closed, which is at the
  end of all the redirects.
  
  
  Thats fine. But when are they read and how are they read? If 3 cookies are dumped during 2 redirects, among which the first one is a session cookie that is needed for each redirection, then how do i read that?
  
  Dont I need -b dumped_headers option there?How would I know how many redirects were made? How was this behaviour in older vesrsions of curl. I see that they were automatically read and parsed and sent from the dumped headers file. But now I need an explicit -b option if I am using -D. Is that true?
  
  In such cases -c could be better rite? As it puts everything in memory for subsequent redirects?
  
  

  thanks,
  Imran
  
Daniel Stenberg <daniel_at_haxx.se> wrote: On Tue, 16 Jan 2007, imran shaik wrote:

> A small modification to my question:
> Does -D dumps cookies for each URL or at the end of handling all the URLs?

-D dumps the headers to the file as soon as they are received.

> What is the behavior of -c when writing cookies?

They are written to the file when the 'CURL' handle is closed, which is at the
end of all the redirects.

> curl -L -c "hello" http://foo.bar.com
>
> Suppose the above command follows 3 URLs seeing Location in header.
>
> I need a timeline status of the contents of "hello" file after each URL is
> followed.

Then -c won't be your friend.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
 
---------------------------------
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
Received on 2007-01-16