cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: fixing schemes and domains on the fly

From: Yaroslav Samchuk <yarcat_at_ank-sia.com>
Date: Tue, 23 Oct 2007 13:28:03 +0300

On 23.10.2007, at 12:05, Daniel Stenberg wrote:

> On Fri, 19 Oct 2007, Yaroslav Samchuk wrote:
>
>> I made small patch adding four features:
>> 1) url checking callback (could be used to fix current url before
>> it's actually used in query)
>> 2) user-defined data passed to callback from (1)
>
> First, can you please clarify for me what you need this for? It
> feels like an edge case you could just as well do in your
> application instead of adding it to libcurl... You mentioned
> redirects, but the redirect-following within libcurl was never
> meant to always cover all possible cases and I've always had the
> position that apps can do that logic themselves if they require
> more fancy ways than what libcurl does by itself.

I agree that this could be done on application level. and now I now
how to do this. but from the very beginning I did not know the way I
could access cookies and thought that the only possibility is to make
curl handle redirects by itself, providing callbacks to patch urls
and cookies' domains.

>> 3) Set-Cookie checking callback (could be used to fixed given
>> cookie, but does not allow to exclude cookie)
>> 4) user-defined data passed to callback from (3)
>
> In what ways can't you get this exact functionality by using the
> CURLOPT_COOKIELIST option?

currently seems that I can retrieve cookies after every query (with
CURLINFO_COOKIELIST), change them and set again with CURLOPT_COOKIELIST)
but I have already explained why I did not do this - I just had no
idea about this possibility.

>> If you have any suggestions, requests, claims, etc (like I do have
>> to provide/update documentation, create test cases, etc) before
>> this patch could be included - please tell me and I'll try to
>> satisfy them.
>
> Yes please, if I should take this patch really seriously I want
> docs and test cases added as well! But before you proceed with
> those, I think we should rather straighten out details like my
> questions above first.

I have asked for any suggestions from the very beginning, but I have
received nothing and started to patch curl's sources. may be it was a
completely wrong solution. if you feel on a hunch that this should
be done on application level (at least I have this feeling), then
probably it's better for me to make changes on my side than to
include them into curl. especially taking into account the fact that
now I know how to do this.

--
Best regards,
Yaroslav Samchuk
Received on 2007-10-23