Le 26 septembre 2010, Jon Burgess a écrit :
> On Sat, 2010-09-25 at 23:30 +0200, Guilhem Bonnefille wrote:

> What I think happens is:
> 1) We first do a request for a tile with an ETag and apply a custom
> header, this gets set into the conn->data->set.headers pointer
> 2) The header gets freed, but the set.headers pointer is left as a
> dangling reference to the memory
> 3) A subsequent request is generated for a tile without an etag so we
> do not overwrite the set.headers pointer and it keeps the old, invalid
> value and the HTTP request code tries to reference it.

Yes, that makes sense, and that explains Guilhem's failure.

I think that I never hit the bug because I'm using only Mapnik tiles,
which uses etag, and not any other tile server that doesn't use etag.

Guilhem: to make things clearer, curl uses the option
CURLOPT_HTTPHEADER to add any header, and expect a valid string there.
Viking also reuse curl from the previous call of curl_download(), which
means that CURLOPT_HTTPHEADER wasn't cleared.

Btw, shouldn't we initialize _all_ curl options at each pass ? I think
we can the same problem with other curl options that are initialized
each time - like CURLOPT_TIMECONDITION or CURLOPT_TIMEVALUE. I will try
to provide a patch to initialize everything.


Thank you both for having detected and fixed the problem :)

Jocelyn

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to