bug 991: fix crash when the file is already cached
commit81f8ee1fa2b94ef40460eb4a42710e1ed9e22c98
authorWitold Filipczyk <witekfl@poczta.onet.pl>
Thu, 13 Mar 2008 21:53:31 +0000 (13 22:53 +0100)
committerKalle Olavi Niemitalo <Kalle@Astalo.kon.iki.fi>
Sat, 15 Mar 2008 18:49:15 +0000 (15 20:49 +0200)
treef46d29ea145a1298eab3bbd3ac284158352c4536
parent2aa70f77bc5a79af6c97c8d50d202ee6a096ae22
bug 991: fix crash when the file is already cached

If the user opens the same file again after it is in the cache, then
ELinks does not always open a new connection, so download->conn can be
NULL in init_type_query(), and download->conn->cgi would crash.
Don't read that, then; instead add a new flag cache_entry.cgi, which
http_got_header() sets or clears as soon as possible after the cache
entry has been created.
src/cache/cache.h
src/protocol/http/http.c
src/session/download.c