bug 991: fix crash when the file is already cached
commit1544b5f4b9ef1c84bf4d6492bbd3987a379f4e00
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>
Sun, 15 Jun 2008 10:53:34 +0000 (15 13:53 +0300)
tree7cc23b3bf768d6bbacdfc4f7c677e95b66470c89
parentd15439edffba8f705894981ec1064643f9cf2936
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.
(cherry picked from commit 81f8ee1fa2b94ef40460eb4a42710e1ed9e22c98)
src/cache/cache.h
src/protocol/http/http.c
src/session/download.c