]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From: Henrik Nordstrom <hno@hem.passagen.se>
authorwessels <>
Sat, 14 Feb 1998 00:55:18 +0000 (00:55 +0000)
committerwessels <>
Sat, 14 Feb 1998 00:55:18 +0000 (00:55 +0000)
Take icon content types from the mime.conf definitions

src/cf.data.pre
src/mime.cc
src/structs.h

index d5d942202d57684cdb75e6db7e4265e5ef844142..f7fdf8bf5d6f4f09dde07f74f0a94f99d9a9cd6d 100644 (file)
@@ -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
index 1e74588b4ff6ee37c8af038d4ea616e3d510f0f7..9e877fab1f086af87a210b4215e3c13467957b41 100644 (file)
@@ -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));
index c47ceb55616e1e3e664a7d120268bbf718df3f60..bbfed3f4b5ce7831fc3e96a8d9353d9e5819e690 100644 (file)
@@ -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 {