2010/9/26 Jocelyn Jaubert <jocelyn.jaub...@gmail.com>: > 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.
Here is my understanding. We use curl in a multi-thread context. To optimize connection, we also reuse curl's handles. We reuse the handle in the context of a single thread. And a thread is fired for a single map source. So, the matter occured only when, in a single request, we request a fresh version of an already downloaded tile (with local etag value) and a new tile (without local etag value). Am I right? > 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. If we are true, we have to reset all CURLOPT that can be set or not set between two consecutive downloads. -- Guilhem BONNEFILLE -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com -=- mailto:guilhem.bonnefi...@gmail.com -=- http://nathguil.free.fr/ ------------------------------------------------------------------------------ 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/