curl-library
RE: libcurl is unable to load the cookies when constructing a custom HTTP request over IPv6
Date: Wed, 21 Mar 2012 12:25:55 +0000
>> On Tue, 6 Mar 2012, Andrei Cipu wrote:
>> We pinpointed the problem to our custom "Host" header, which was an
>> IPv6 address between [] (e.g. "Host: [2001::1]" - just like libcurl
>> was sending for non-custom requests). The cookie domain was determined
>> from this host by removing the part after ':' which was considered the
>> port, leaving us with a host of "[2001", which did not match the domain in the cookie repository.
>>
>> I'm attaching a bug that solved this problem, and possibly also solves
>> the bug reported by mailsvb in September 2011
>> (http://curl.haxx.se/mail/archive-2011-09/0022.html ). This patch is
>> made on libcurl 7.24.0.
>
> Awesome. Thanks a lot, I've merged and pushed this now!
It looks like my previous patch was making libcURL crash when freeing the cookiehost field, because it was changing the pointer and thus messing with libcURL's memdebug data.
I'm attaching a new patch that replaces cookie++ with memmove and fixes this. Hopefully I haven't missed any other problems.
Andrei
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/octet-stream attachment: host_port_fix2.patch