From: wessels <> Date: Sat, 14 Feb 1998 00:55:18 +0000 (+0000) Subject: From: Henrik Nordstrom X-Git-Tag: SQUID_3_0_PRE1~4096 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4cd746ee92383abd27fa9f0ebe8ded8e871c91d5;p=thirdparty%2Fsquid.git From: Henrik Nordstrom Take icon content types from the mime.conf definitions --- diff --git a/src/cf.data.pre b/src/cf.data.pre index d5d942202d..f7fdf8bf5d 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1907,16 +1907,6 @@ DOC_START @DEFAULT_ICON_DIR@ DOC_END -NAME: icon_content_type -TYPE: string -LOC: Config.icons.content_type -DEFAULT: image/gif -DOC_START - The default Squid icons that come with Squid (and are used in - FTP and gopher listings) are in GIF format. If you want to - use JPG format icons you would have to change this. -DOC_END - NAME: error_directory TYPE: string LOC: Config.errorDirectory diff --git a/src/mime.cc b/src/mime.cc index 1e74588b4f..9e877fab1f 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -1,6 +1,6 @@ /* - * $Id: mime.cc,v 1.47 1998/02/02 21:15:03 wessels Exp $ + * $Id: mime.cc,v 1.48 1998/02/13 17:55:19 wessels Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -375,10 +375,10 @@ mimeInit(char *filename) m->transfer_mode = 'A'; else m->transfer_mode = 'I'; - mimeLoadIconFile(m->icon); - debug(25, 5) ("mimeInit: added '%s'\n", buf); *MimeTableTail = m; MimeTableTail = &m->next; + mimeLoadIconFile(m->icon); + debug(25, 5) ("mimeInit: added '%s'\n", buf); } fclose(fp); mimeLoadIconFile(ICON_MENU); @@ -400,6 +400,9 @@ mimeLoadIconFile(const char *icon) LOCAL_ARRAY(char, url, MAX_URL); char *buf; const cache_key *key; + const char *type = mimeGetContentType(icon); + if (type == NULL) + fatal("Unknown icon format while reading mime.conf\n"); snprintf(url, MAX_URL, "http://internal.squid/icons/%s", icon); key = storeKeyPublic(url, METHOD_GET); if (storeGet(key)) @@ -427,7 +430,7 @@ mimeLoadIconFile(const char *icon) l += snprintf(buf + l, SM_PAGE_SIZE - l, "HTTP/1.0 200 OK\r\n"); l += snprintf(buf + l, SM_PAGE_SIZE - l, "Date: %s\r\n", mkrfc1123(squid_curtime)); l += snprintf(buf + l, SM_PAGE_SIZE - l, "Server: Squid/%s\r\n", version_string); - l += snprintf(buf + l, SM_PAGE_SIZE - l, "Content-Type: %s\r\n", Config.icons.content_type); + l += snprintf(buf + l, SM_PAGE_SIZE - l, "Content-Type: %s\r\n", type); l += snprintf(buf + l, SM_PAGE_SIZE - l, "Content-Length: %d\r\n", (int) sb.st_size); l += snprintf(buf + l, SM_PAGE_SIZE - l, "Last-Modified: %s\r\n", mkrfc1123(sb.st_mtime)); l += snprintf(buf + l, SM_PAGE_SIZE - l, "Expires: %s\r\n", mkrfc1123(squid_curtime + 86400)); diff --git a/src/structs.h b/src/structs.h index c47ceb5561..bbfed3f4b5 100644 --- a/src/structs.h +++ b/src/structs.h @@ -302,8 +302,6 @@ struct _SquidConfig { struct { size_t list_width; int list_wrap; - char *icon_prefix; - char *icon_suffix; char *anon_user; } Ftp; refresh_t *Refresh; @@ -315,7 +313,6 @@ struct _SquidConfig { char *fake_ua; struct { char *directory; - char *content_type; } icons; char *errorDirectory; struct {