cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: fixing schemes and domains on the fly

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 23 Oct 2007 11:05:25 +0200 (CEST)

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.

And a note about the example code: it is not good. libcurl can be built to use
its own memory handling (malloc, free etc) so you cannot easily do malloc or
strdup in the app and pass that on to the lib and expect its free() to be able
to free it without problems. Your example code will crash.

> 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?

> 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.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-10-23