--- curl-7.17.1/lib/transfer.c 2007-10-22 16:30:18.000000000 +0200 +++ curl-7.17.1.patched/lib/transfer.c 2007-11-19 16:17:22.000000000 +0100 @@ -1047,8 +1047,15 @@ k->content_range = TRUE; } #if !defined(CURL_DISABLE_COOKIES) - else if(data->cookies && - checkprefix("Set-Cookie:", k->p)) { + else if(checkprefix("Set-Cookie:", k->p)) { + + /* According to TR-069 section 3.4.2 cookies must be supported + in the HTTP digest authentication challange to keep track + of sessions. */ + if (!data->cookies){ + data->cookies = Curl_cookie_init(conn, NULL, NULL, TRUE); + } + Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); Curl_cookie_add(data,