From f4be61553c38f980d38c7afd7b693def3ec5208c Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 30 May 2008 11:09:50 +0000 Subject: Fix handling of cache control data svn path=/trunk/netsurf/; revision=4227 --- content/fetchers/fetch_curl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'content/fetchers') diff --git a/content/fetchers/fetch_curl.c b/content/fetchers/fetch_curl.c index 7c2ca5c8d..465af2c9c 100644 --- a/content/fetchers/fetch_curl.c +++ b/content/fetchers/fetch_curl.c @@ -1132,11 +1132,12 @@ bool fetch_curl_process_headers(struct curl_fetch_info *f) if (url_path && stat(url_path, &s) == 0) { /* file: URL and file exists */ /* create etag */ - /*free(f->cachedata.etag); - f->cachedata.etag = malloc(13); - if (f->cachedata.etag) - sprintf(f->cachedata.etag, - "\"%10d\"", (int)s.st_mtime);*/ + char etag_buf[20]; + snprintf(etag_buf, sizeof etag_buf, + "ETag: \"%10d\"", (int) s.st_mtime); + /* And send it to the header handler */ + fetch_send_callback(FETCH_HEADER, f->fetch_handle, etag_buf, + strlen(etag_buf)); /* don't set last modified time so as to ensure that local * files are revalidated at all times. */ -- cgit v1.2.3