2010/9/26 Jocelyn Jaubert <jocelyn.jaub...@gmail.com>:
> Le 26 septembre 2010, Guilhem Bonnefille a écrit :
>> Please, find my work on integrating ETag on my own public repo:
>> http://repo.or.cz/w/viking/guyou.git/shortlog/refs/heads/etag
>>
>> Jocelyn, can you double check these patches and eventually apply them
>> to your own etag branch?
>
> I have checked all your patchs.

OK

> The one I don't like is this one:
> http://repo.or.cz/w/viking/guyou.git/blobdiff/80e7bc44bcbadfbb6a9146d2ef8968f8f23d4e00..97f7e1e62e0fc17625c445e40f1b326e1402a3f6:/src/curl_download.c

I would bet on it. I'm not really proud of it. :-)

> I replaced the \n by \0 in the string to make sure that there is no \n
> added in the headers sent to the server. in HTTP spec, two following \n
> marks the end of the headers section, which is why we must be sure that
> we don't add \n to the strings given to CURLOPT_HTTPHEADER.
>
> There might be a cleaner way to this than the one I used in this
> function...

I think we have to play with "length". Perhaps can we replace
g_strndup(etag_str, len) by g_strndup(etag_str, end_str - etag_str);

Furthermore, I forgot to fix an other possible bug.
In g_strstr_len(etag_str, len, "\n"), len is too big as etag_str was
shifted. I think we have to use something like
g_strstr_len(etag_str, len - strlen("ETag: "), "\n")

And in order to gain some CPU cycles, we can replace strlen("ETag: ")
by (sizeof("ETag: ")-1).
-- 
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/

Reply via email to