]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
use LOCAL_ARRAY macro
authorwessels <>
Fri, 19 Jul 1996 02:26:59 +0000 (02:26 +0000)
committerwessels <>
Fri, 19 Jul 1996 02:26:59 +0000 (02:26 +0000)
20 files changed:
src/acl.cc
src/debug.cc
src/disk.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/ident.cc
src/ipcache.cc
src/mime.cc
src/neighbors.cc
src/redirect.cc
src/send-announce.cc
src/squid.h
src/ssl.cc
src/stat.cc
src/store.cc
src/tools.cc
src/tunnel.cc
src/url.cc
src/wais.cc

index 759f994f5c669b5b5eaa3d98a99a4a428a7bbfb5..e76ef0a29b813df0d55695afbe9e976b747421cd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: acl.cc,v 1.16 1996/07/15 23:10:53 wessels Exp $
+ * $Id: acl.cc,v 1.17 1996/07/18 20:26:59 wessels Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -197,7 +197,9 @@ static struct _acl_ip_data *aclParseIpList()
     struct _acl_ip_data *head = NULL;
     struct _acl_ip_data **Tail = &head;
     struct _acl_ip_data *q = NULL;
-    static char addr1[256], addr2[256], mask[256];
+    LOCAL_ARRAY(char, addr1, 256);
+    LOCAL_ARRAY(char, addr2, 256);
+    LOCAL_ARRAY(char, mask, 256);
 
     while ((t = strtok(NULL, w_space))) {
        q = xcalloc(1, sizeof(struct _acl_ip_data));
@@ -568,7 +570,7 @@ static int aclMatchEndOfWord(data, word)
        debug(28, 3, "aclMatchEndOfWord: looking for '%s'\n", data->key);
        if ((offset = strlen(word) - strlen(data->key)) < 0)
            continue;
-       if (strcmp(word + offset, data->key) == 0)
+       if (strcasecmp(word + offset, data->key) == 0)
            return 1;
     }
     return 0;
index a2b045fa0517a363c815e06284265a2fac6a2301..7dca120f9b4ca2cf9283224c3104d61ce9943769 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.cc,v 1.18 1996/07/09 03:41:21 wessels Exp $
+ * $Id: debug.cc,v 1.19 1996/07/18 20:27:00 wessels Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -130,8 +130,8 @@ void _db_print(va_alist)
     int level;
     char *format = NULL;
 #endif
-    static char f[BUFSIZ];
-    static char tmpbuf[BUFSIZ];
+    LOCAL_ARRAY(char, f, BUFSIZ);
+    LOCAL_ARRAY(char, tmpbuf, BUFSIZ);
     char *s = NULL;
 
     if (debug_log == NULL)
@@ -255,8 +255,8 @@ void _db_init(logfile, options)
 void _db_rotate_log()
 {
     int i;
-    static char from[MAXPATHLEN];
-    static char to[MAXPATHLEN];
+    LOCAL_ARRAY(char, from, MAXPATHLEN);
+    LOCAL_ARRAY(char, to, MAXPATHLEN);
 
     if (debug_log_file == NULL)
        return;
index e2384d35ba313d3caced3cee1c181506fb220f17..6dc267b054b8b4e72827e03fa5e4df47021cb2ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.19 1996/07/17 16:59:59 wessels Exp $
+ * $Id: disk.cc,v 1.20 1996/07/18 20:27:00 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -519,7 +519,7 @@ int diskHandleWalk(fd, walk_dat)
     int end_pos;
     int st_pos;
     int used_bytes;
-    static char temp_line[DISK_LINE_LEN];
+    LOCAL_ARRAY(char, temp_line, DISK_LINE_LEN);
 
     lseek(fd, walk_dat->offset, SEEK_SET);
     file_table[fd].at_eof = NO;
index 1afa78343e8e58d2766f6faaedcc4228e28841cd..ff7c3d036e68147606ea34ca215146fc3d3a1ff6 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: ftp.cc,v 1.42 1996/07/15 23:57:51 wessels Exp $
+ * $Id: ftp.cc,v 1.43 1996/07/18 20:27:01 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -305,7 +306,7 @@ int ftpReadReply(fd, data)
      int fd;
      FtpData *data;
 {
-    static char buf[SQUID_TCP_SO_RCVBUF];
+    LOCAL_ARRAY(char, buf, SQUID_TCP_SO_RCVBUF);
     int len;
     int clen;
     int off;
@@ -472,8 +473,8 @@ void ftpSendRequest(fd, data)
     char *path = NULL;
     char *mode = NULL;
     char *buf = NULL;
-    static char tbuf[BUFSIZ];
-    static char opts[BUFSIZ];
+    LOCAL_ARRAY(char, tbuf, BUFSIZ);
+    LOCAL_ARRAY(char, opts, BUFSIZ);
     static char *space = " ";
     char *s = NULL;
     int got_timeout = 0;
@@ -592,7 +593,7 @@ int ftpStart(unusedfd, url, request, entry)
      request_t *request;
      StoreEntry *entry;
 {
-    static char realm[8192];
+    LOCAL_ARRAY(char, realm, 8192);
     FtpData *data = NULL;
     char *req_hdr = entry->mem_obj->mime_hdr;
     char *auth_hdr;
@@ -732,7 +733,7 @@ int ftpInitialize()
     int cfd;
     int squid_to_ftpget[2];
     int ftpget_to_squid[2];
-    static char pbuf[128];
+    LOCAL_ARRAY(char, pbuf, 128);
     char *ftpget = getFtpProgram();
     struct sockaddr_in S;
     int len;
index ca3a47de74ebe3fa8d581f20a459975c7274abdb..44ebf033fedd826c96d3e9eaa4b84f4b89e653d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.32 1996/07/15 23:14:27 wessels Exp $
+ * $Id: gopher.cc,v 1.33 1996/07/18 20:27:01 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -184,7 +184,7 @@ static void gopher_mime_content(buf, name, def)
      char *name;
      char *def;
 {
-    static char temp[MAX_URL + 1];
+    LOCAL_ARRAY(char, temp, MAX_URL + 1);
     char *ext1 = NULL;
     char *ext2 = NULL;
     char *str = NULL;
@@ -234,7 +234,7 @@ static void gopher_mime_content(buf, name, def)
 void gopherMimeCreate(data)
      GopherData *data;
 {
-    static char tempMIME[MAX_MIME];
+    LOCAL_ARRAY(char, tempMIME, MAX_MIME);
 
     sprintf(tempMIME, "\
 HTTP/1.0 200 OK Gatewaying\r\n\
@@ -289,8 +289,8 @@ int gopher_url_parser(url, host, port, type_id, request)
      char *type_id;
      char *request;
 {
-    static char proto[MAX_URL];
-    static char hostbuf[MAX_URL];
+    LOCAL_ARRAY(char, proto, MAX_URL);
+    LOCAL_ARRAY(char, hostbuf, MAX_URL);
     int t;
 
     proto[0] = hostbuf[0] = '\0';
@@ -355,7 +355,7 @@ int gopherCachable(url)
 void gopherEndHTML(data)
      GopherData *data;
 {
-    static char tmpbuf[TEMP_BUF_SIZE];
+    LOCAL_ARRAY(char, tmpbuf, TEMP_BUF_SIZE);
 
     if (!data->data_in) {
        sprintf(tmpbuf, "<HR><H2><i>Server Return Nothing.</i></H2>\n");
@@ -375,9 +375,9 @@ void gopherToHTML(data, inbuf, len)
     char *pos = inbuf;
     char *lpos = NULL;
     char *tline = NULL;
-    static char line[TEMP_BUF_SIZE];
-    static char tmpbuf[TEMP_BUF_SIZE];
-    static char outbuf[TEMP_BUF_SIZE << 4];
+    LOCAL_ARRAY(char, line, TEMP_BUF_SIZE);
+    LOCAL_ARRAY(char, tmpbuf, TEMP_BUF_SIZE);
+    LOCAL_ARRAY(char, outbuf, TEMP_BUF_SIZE << 4);
     char *name = NULL;
     char *selector = NULL;
     char *host = NULL;
@@ -593,7 +593,7 @@ void gopherToHTML(data, inbuf, len)
                int t;
                int code;
                int recno;
-               static char result[MAX_CSO_RESULT];
+               LOCAL_ARRAY(char, result, MAX_CSO_RESULT);
 
                tline = line;
 
@@ -908,7 +908,7 @@ void gopherSendRequest(fd, data)
      GopherData *data;
 {
     int len;
-    static char query[MAX_URL];
+    LOCAL_ARRAY(char, query, MAX_URL);
     char *buf = get_free_4k_page();
 
     data->icp_page_ptr = buf;
index 43508a5c969fe9ec9a30c637a5b99961fe0cd08e..0f416b1217c75809f086333cb0d1199b53612d96 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.61 1996/07/15 23:15:16 wessels Exp $
+ * $Id: http.cc,v 1.62 1996/07/18 20:27:02 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -400,7 +400,7 @@ static void httpReadReply(fd, httpState)
      int fd;
      HttpStateData *httpState;
 {
-    static char buf[SQUID_TCP_SO_RCVBUF];
+    LOCAL_ARRAY(char, buf, SQUID_TCP_SO_RCVBUF);
     int len;
     int bin;
     int clen;
index a2b45b652caedaf341f7ffcad633a8ae416e7a4e..ec1c2bc1f1944b5c8d225e11d91bf2aa450f9590 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ident.cc,v 1.4 1996/07/11 17:25:24 wessels Exp $
+ * $Id: ident.cc,v 1.5 1996/07/18 20:27:04 wessels Exp $
  *
  * DEBUG: section 31    Ident (RFC 931)
  * AUTHOR: Duane Wessels
@@ -49,7 +49,7 @@ void identStart(sock, icpState)
 {
     char *host;
     u_short port;
-    static char reqbuf[BUFSIZ];
+    LOCAL_ARRAY(char, reqbuf, BUFSIZ);
     int status;
 
     host = inet_ntoa(icpState->peer.sin_addr);
@@ -104,7 +104,7 @@ static void identReadReply(fd, icpState)
      int fd;
      icpStateData *icpState;
 {
-    static char buf[BUFSIZ];
+    LOCAL_ARRAY(char, buf, BUFSIZ);
     char *t = NULL;
     int len = -1;
 
index 948c2931633cd9356a6bf245d953f083dc003f27..7a3bc282429d692000fff31aa96e3d5e43a41978 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ipcache.cc,v 1.32 1996/07/15 23:10:54 wessels Exp $
+ * $Id: ipcache.cc,v 1.33 1996/07/18 20:27:04 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -1027,7 +1027,7 @@ void ipcacheOpenServers()
     char *prg = getDnsProgram();
     int k;
     int dnssocket;
-    static char fd_note_buf[FD_ASCII_NOTE_SZ];
+    LOCAL_ARRAY(char, fd_note_buf, FD_ASCII_NOTE_SZ);
 
     /* free old structures if present */
     if (dns_child_table) {
index 7c1335c4a55580bb4d4e4600f6da80c9fe1e0cce..5cfe2a5200a5e8bbd613f21c6a93b7c81655b5b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: mime.cc,v 1.13 1996/07/09 03:41:33 wessels Exp $
+ * $Id: mime.cc,v 1.14 1996/07/18 20:27:05 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
 
 char *mime_get_header(char *mime, char *name)
 {
-    static char header[GET_HDR_SZ];
+    LOCAL_ARRAY(char, header, GET_HDR_SZ);
     char *p = NULL;
     char *q = NULL;
     char got = 0;
@@ -187,7 +187,7 @@ ext_table_entry *mime_ext_to_type(extension)
     int low;
     int high;
     int comp;
-    static char ext[16];
+    LOCAL_ARRAY(char, ext, 16);
     char *cp = NULL;
 
     if (!extension || strlen(extension) >= (sizeof(ext) - 1))
@@ -229,10 +229,10 @@ int mk_mime_hdr(result, ttl, size, lmt, type)
 {
     time_t expiretime;
     time_t t;
-    static char date[100];
-    static char expires[100];
-    static char last_modified[100];
-    static char content_length[100];
+    LOCAL_ARRAY(char, date, 100);
+    LOCAL_ARRAY(char, expires, 100);
+    LOCAL_ARRAY(char, last_modified, 100);
+    LOCAL_ARRAY(char, content_length, 100);
 
     if (result == NULL)
        return 1;
index 5f18141a8fbda40f4494a3b0002066ae72ad2fc3..775d155dbbcb3c0fc7269526f8fc7075bf5605a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.30 1996/07/17 17:50:07 wessels Exp $
+ * $Id: neighbors.cc,v 1.31 1996/07/18 20:27:06 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -173,7 +173,7 @@ void hierarchy_log_append(entry, code, timeout, cache_host)
     char *url = entry->url;
     MemObject *mem = entry->mem_obj;
     static time_t last_time = 0;
-    static char time_str[128];
+    LOCAL_ARRAY(char, time_str, 128);
     char *s = NULL;
 
     if (!cache_hierarchy_log)
@@ -500,7 +500,7 @@ int neighborsUdpPing(proto)
     mem->w_rtt = 0;
     mem->start_ping = current_time;
 
-    if (friends->edges_head == (edge *) NULL)
+    if (friends->edges_head == NULL)
        return 0;
 
     for (i = 0, e = friends->first_ping; i++ < friends->n; e = e->next) {
@@ -510,7 +510,7 @@ int neighborsUdpPing(proto)
 
        /* Don't resolve refreshes through neighbors because we don't resolve
         * misses through neighbors */
-       if (e->type == EDGE_SIBLING && entry->flag & REFRESH_REQUEST)
+       if (entry->flag & REFRESH_REQUEST && e->type == EDGE_SIBLING)
            continue;
 
        /* skip any cache where we failed to connect() w/in the last 60s */
@@ -535,9 +535,19 @@ int neighborsUdpPing(proto)
 
        if (e->icp_port == echo_port) {
            debug(15, 4, "neighborsUdpPing: Looks like a dumb cache, send DECHO ping\n");
-           icpUdpSend(friends->fd, url, &echo_hdr, &e->in_addr, ICP_OP_DECHO, LOG_TAG_NONE);
+           icpUdpSend(friends->fd,
+               url,
+               &echo_hdr,
+               &e->in_addr,
+               ICP_OP_DECHO,
+               LOG_TAG_NONE);
        } else {
-           icpUdpSend(friends->fd, url, &e->header, &e->in_addr, ICP_OP_QUERY, LOG_TAG_NONE);
+           icpUdpSend(friends->fd,
+               url,
+               &e->header,
+               &e->in_addr,
+               ICP_OP_QUERY,
+               LOG_TAG_NONE);
        }
 
        e->stats.ack_deficit++;
@@ -907,8 +917,8 @@ void neighbors_rotate_log()
 {
     char *fname = NULL;
     int i;
-    static char from[MAXPATHLEN];
-    static char to[MAXPATHLEN];
+    LOCAL_ARRAY(char, from, MAXPATHLEN);
+    LOCAL_ARRAY(char, to, MAXPATHLEN);
 
     if ((fname = getHierarchyLogFile()) == NULL)
        return;
index de7014de5801de0079339d3d11587820a8234f3b..575d0e3c2e150ab6d7dfd3fc8a83623b7d549dcb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: redirect.cc,v 1.4 1996/07/16 01:51:14 wessels Exp $
+ * $Id: redirect.cc,v 1.5 1996/07/18 20:27:07 wessels Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -310,7 +310,7 @@ void redirectOpenServers()
     char *prg = getRedirectProgram();
     int k;
     int redirectsocket;
-    static char fd_note_buf[FD_ASCII_NOTE_SZ];
+    LOCAL_ARRAY(char, fd_note_buf, FD_ASCII_NOTE_SZ);
     static int first_time = 0;
 
     if (!do_redirect)
index 9434e8cec4421abe8724303a52b03267aadf5ca8..1ed664200b90bc2dfa47b30c179248b6e9394ed5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: send-announce.cc,v 1.14 1996/07/15 23:10:57 wessels Exp $
+ * $Id: send-announce.cc,v 1.15 1996/07/18 20:27:08 wessels Exp $
  *
  * DEBUG: section 27    Cache Announcer
  * AUTHOR: Duane Wessels
@@ -33,8 +33,8 @@
 
 void send_announce()
 {
-    static char tbuf[256];
-    static char sndbuf[BUFSIZ];
+    LOCAL_ARRAY(char, tbuf, 256);
+    LOCAL_ARRAY(char, sndbuf, BUFSIZ);
     icpUdpData *qdata = NULL;
     struct hostent *hp = NULL;
     char *host = NULL;
index 4449658ace70654b29423fde5039da5224226819..d9e16d6a240d37b3f2dbfc19197902a5f54985e9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.27 1996/07/15 23:48:36 wessels Exp $
+ * $Id: squid.h,v 1.28 1996/07/18 20:27:08 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -199,6 +199,15 @@ typedef unsigned long u_num32;
 #endif
 #define NUM32LEN sizeof(num32) /* this should always be 4 */
 
+#if MALLOC_GUARD
+#define LOCAL_ARRAY(type,name,size) \
+        static type *local_##name=NULL; \
+        type *name = local_##name ? local_##name : \
+                ( local_##name = (type *)xcalloc(size, sizeof(type)) )
+#else
+#define LOCAL_ARRAY(type,name,size) static type name[size]
+#endif
+
 #include "GNUregex.h"
 #include "ansihelp.h"
 
index d48e7c5f0a8538308473f4e9cf2edceb22d58c70..5f1a50b493ed452a16d8d1834bac63d1e89dd401 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: ssl.cc,v 1.5 1996/07/11 17:42:53 wessels Exp $
+ * $Id: ssl.cc,v 1.6 1996/07/18 20:27:09 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
index 320c14c39dfa5cbc23ec164cb2a687f0e902fe15..3f51d70f9d0589e7a6a00b06e94fbf29d78adb0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stat.cc,v 1.41 1996/07/17 17:03:20 wessels Exp $
+ * $Id: stat.cc,v 1.42 1996/07/18 20:27:10 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -262,8 +262,8 @@ void stat_objects_get(obj, sentry, vm_or_not)
      StoreEntry *sentry;
      int vm_or_not;
 {
-    static char space[40];
-    static char space2[40];
+    LOCAL_ARRAY(char, space, 40);
+    LOCAL_ARRAY(char, space2, 40);
     int npend = 0;
     StoreEntry *entry = NULL;
     int N = 0;
@@ -522,7 +522,7 @@ static char *host_port_fmt(host, port)
      char *host;
      u_short port;
 {
-    static char buf[32];
+    LOCAL_ARRAY(char, buf, 32);
     sprintf(buf, "%s.%d", host, (int) port);
     return buf;
 }
@@ -894,7 +894,7 @@ void log_append(obj, url, id, size, action, method, http_code, msec, ident, hier
      char *ident;
      hier_code hier;
 {
-    static char tmp[6000];     /* MAX_URL is 4096 */
+    LOCAL_ARRAY(char, tmp, 6000);      /* MAX_URL is 4096 */
     char *buf = NULL;
     int x;
 
@@ -1163,7 +1163,7 @@ void stat_init(object, logfilename)
 char *stat_describe(entry)
      StoreEntry *entry;
 {
-    static char state[256];
+    LOCAL_ARRAY(char, state, 256);
 
     state[0] = '\0';
     switch (entry->store_status) {
@@ -1205,7 +1205,7 @@ char *stat_describe(entry)
 char *mem_describe(entry)
      StoreEntry *entry;
 {
-    static char where[100];
+    LOCAL_ARRAY(char, where, 100);
 
     where[0] = '\0';
     if (entry->swap_file_number >= 0)
@@ -1231,7 +1231,7 @@ char *ttl_describe(entry)
      StoreEntry *entry;
 {
     int hh, mm, ss;
-    static char TTL[60];
+    LOCAL_ARRAY(char, TTL, 60);
     int ttl;
 
     TTL[0] = '\0';
@@ -1281,7 +1281,7 @@ char *elapsed_time(entry, since, TTL)
 char *flags_describe(entry)
      StoreEntry *entry;
 {
-    static char FLAGS[32];
+    LOCAL_ARRAY(char, FLAGS, 32);
     char LOCK_CNT[32];
 
     strcpy(FLAGS, "F:");
@@ -1311,8 +1311,8 @@ char *flags_describe(entry)
 void stat_rotate_log()
 {
     int i;
-    static char from[MAXPATHLEN];
-    static char to[MAXPATHLEN];
+    LOCAL_ARRAY(char, from, MAXPATHLEN);
+    LOCAL_ARRAY(char, to, MAXPATHLEN);
     char *fname = NULL;
 
     if ((fname = CacheInfo->logfilename) == NULL)
index 904415ddd0e9fbb68c0665d97fb27d0b2c2b6f6d..ac2e562700726daca8b0c96c2a03466d54103755 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: store.cc,v 1.69 1996/07/17 17:10:00 wessels Exp $
+ * $Id: store.cc,v 1.70 1996/07/18 20:27:10 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -387,7 +387,7 @@ void storeSetMemStatus(e, status)
 static char *time_describe(t)
      time_t t;
 {
-    static char buf[128];
+    LOCAL_ARRAY(char, buf, 128);
 
     if (t < 60) {
        sprintf(buf, "%ds", (int) t);
@@ -1024,7 +1024,7 @@ void storeAppend(e, data, len)
 void storeAppendPrintf(StoreEntry * e, char *fmt,...)
 {
     va_list args;
-    static char buf[4096];
+    LOCAL_ARRAY(char, buf, 4096);
     va_start(args, fmt);
 #else
 void storeAppendPrintf(va_alist)
@@ -1033,7 +1033,7 @@ void storeAppendPrintf(va_alist)
     va_list args;
     StoreEntry *e = NULL;
     char *fmt = NULL;
-    static char buf[4096];
+    LOCAL_ARRAY(char, buf, 4096);
     va_start(args);
     e = va_arg(args, StoreEntry *);
     fmt = va_arg(args, char *);
@@ -1069,7 +1069,7 @@ char *storeSwapFullPath(fn, fullpath)
      int fn;
      char *fullpath;
 {
-    static char fullfilename[MAX_FILE_NAME_LEN];
+    LOCAL_ARRAY(char, fullfilename, MAX_FILE_NAME_LEN);
 
     if (fullpath) {
        sprintf(fullpath, "%s/%02d/%d",
@@ -1209,7 +1209,7 @@ void storeSwapOutHandle(fd, flag, e)
      int flag;
      StoreEntry *e;
 {
-    static char filename[MAX_FILE_NAME_LEN];
+    LOCAL_ARRAY(char, filename, MAX_FILE_NAME_LEN);
     MemObject *mem = e->mem_obj;
 
     debug(20, 3, "storeSwapOutHandle: '%s'\n", e->key);
@@ -1306,7 +1306,7 @@ static int storeSwapOutStart(e)
      StoreEntry *e;
 {
     int fd;
-    static char swapfilename[MAX_FILE_NAME_LEN];
+    LOCAL_ARRAY(char, swapfilename, MAX_FILE_NAME_LEN);
     int x;
     MemObject *mem = e->mem_obj;
     /* Suggest a new swap file number */
@@ -1361,9 +1361,9 @@ static int storeSwapOutStart(e)
 static int storeDoRebuildFromDisk(data)
      struct storeRebuild_data *data;
 {
-    static char log_swapfile[MAXPATHLEN];
-    static char swapfile[MAXPATHLEN];
-    static char url[MAX_URL + 1];
+    LOCAL_ARRAY(char, log_swapfile, MAXPATHLEN);
+    LOCAL_ARRAY(char, swapfile, MAXPATHLEN);
+    LOCAL_ARRAY(char, url, MAX_URL + 1);
     char *t = NULL;
     StoreEntry *e = NULL;
     time_t expires;
@@ -1682,8 +1682,8 @@ int storeAbort(e, msg)
      StoreEntry *e;
      char *msg;
 {
-    static char mime_hdr[300];
-    static char abort_msg[2000];
+    LOCAL_ARRAY(char, mime_hdr, 300);
+    LOCAL_ARRAY(char, abort_msg, 2000);
 
     debug(20, 6, "storeAbort: '%s'\n", e->key);
     e->expires = squid_curtime + getNegativeTTL();
@@ -2598,7 +2598,7 @@ static int storeVerifySwapDirs(clean)
 static void storeCreateSwapSubDirs()
 {
     int i, j;
-    static char name[MAXPATHLEN];
+    LOCAL_ARRAY(char, name, MAXPATHLEN);
     for (j = 0; j < ncache_dirs; j++) {
        for (i = 0; i < SWAP_DIRECTORIES; i++) {
            sprintf(name, "%s/%02d", swappath(j), i);
@@ -2680,7 +2680,7 @@ int storeInit()
  */
 void storeSanityCheck()
 {
-    static char name[4096];
+    LOCAL_ARRAY(char, name, 4096);
     int i;
 
     if (ncache_dirs < 1)
@@ -2772,7 +2772,7 @@ int storeMaintainSwapSpace()
 int storeWriteCleanLog()
 {
     StoreEntry *e = NULL;
-    static char swapfilename[MAX_FILE_NAME_LEN];
+    LOCAL_ARRAY(char, swapfilename, MAX_FILE_NAME_LEN);
     FILE *fp = NULL;
     int n = 0;
     int x = 0;
@@ -2877,8 +2877,8 @@ void storeRotateLog()
 {
     char *fname = NULL;
     int i;
-    static char from[MAXPATHLEN];
-    static char to[MAXPATHLEN];
+    LOCAL_ARRAY(char, from, MAXPATHLEN);
+    LOCAL_ARRAY(char, to, MAXPATHLEN);
 
     if (storelog_fd > -1) {
        file_close(storelog_fd);
index 94939d5ecb62c817865b33afd1ef06d1f4c097ad..b55cdc0422db891d69b7b3509934bb3d6f426430 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.44 1996/07/15 23:48:38 wessels Exp $
+ * $Id: tools.cc,v 1.45 1996/07/18 20:27:12 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -122,7 +122,7 @@ Thanks!\n"
 
 static char *dead_msg()
 {
-    static char msg[1024];
+    LOCAL_ARRAY(char, msg, 1024);
     sprintf(msg, DEAD_MSG, version_string, version_string);
     return msg;
 }
@@ -130,8 +130,8 @@ static char *dead_msg()
 void mail_warranty()
 {
     FILE *fp = NULL;
-    static char filename[256];
-    static char command[256];
+    LOCAL_ARRAY(char, filename, 256);
+    LOCAL_ARRAY(char, command, 256);
 
     sprintf(filename, "/tmp/mailin%d", (int) getpid());
     fp = fopen(filename, "w");
@@ -359,7 +359,7 @@ void sig_child(sig)
 
 char *getMyHostname()
 {
-    static char host[SQUIDHOSTNAMELEN + 1];
+    LOCAL_ARRAY(char, host, SQUIDHOSTNAMELEN + 1);
     static int present = 0;
     struct hostent *h = NULL;
     char *t = NULL;
index d8d4853583cb4bddc1a97b77440a64aca53a6467..f6d04bb0d820fc1a2dc709d14c24d793eb581992 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: tunnel.cc,v 1.5 1996/07/11 17:42:53 wessels Exp $
+ * $Id: tunnel.cc,v 1.6 1996/07/18 20:27:09 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
index dc6c9a6de7e0b046eee5a62db9ff6a1e63c77ac8..7473e7f8728093a7b17715886494a04ffff8dc0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: url.cc,v 1.23 1996/07/15 23:13:34 wessels Exp $
+ * $Id: url.cc,v 1.24 1996/07/18 20:27:12 wessels Exp $
  *
  * DEBUG: section 23    URL Parsing
  * AUTHOR: Duane Wessels
@@ -188,10 +188,10 @@ request_t *urlParse(method, url)
      method_t method;
      char *url;
 {
-    static char proto[MAX_URL + 1];
-    static char login[MAX_URL + 1];
-    static char host[MAX_URL + 1];
-    static char urlpath[MAX_URL + 1];
+    LOCAL_ARRAY(char, proto, MAX_URL + 1);
+    LOCAL_ARRAY(char, login, MAX_URL + 1);
+    LOCAL_ARRAY(char, host, MAX_URL + 1);
+    LOCAL_ARRAY(char, urlpath, MAX_URL + 1);
     request_t *request = NULL;
     char *t = NULL;
     int port;
@@ -240,8 +240,8 @@ char *urlCanonical(request, buf)
      request_t *request;
      char *buf;
 {
-    static char urlbuf[MAX_URL + 1];
-    static char portbuf[32];
+    LOCAL_ARRAY(char, urlbuf, MAX_URL + 1);
+    LOCAL_ARRAY(char, portbuf, 32);
     if (buf == NULL)
        buf = urlbuf;
     switch (request->method) {
index 74d9f02e8bed0e163d1b7ec18c518cacbfec97d9..7bf85b4b839c605bf1be571a4528a9c008a5e417 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: wais.cc,v 1.32 1996/07/15 23:14:28 wessels Exp $
+ * $Id: wais.cc,v 1.33 1996/07/18 20:27:13 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -174,7 +174,7 @@ static void waisReadReply(fd, waisState)
      int fd;
      WaisStateData *waisState;
 {
-    static char buf[4096];
+    LOCAL_ARRAY(char, buf, 4096);
     int len;
     StoreEntry *entry = NULL;