]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Change some sizes to 'size_t'
authorwessels <>
Mon, 21 Jul 1997 13:20:55 +0000 (13:20 +0000)
committerwessels <>
Mon, 21 Jul 1997 13:20:55 +0000 (13:20 +0000)
- Change some offsets to 'off_t'
- Need to unlock static icons
- Move unbuffered logs flag to Config
- Too much time debugging keep-alive problems with Netscape Navigator-2.x

src/cf.data.pre
src/debug.cc
src/globals.h
src/main.cc
src/mime.cc
src/protos.h
src/ssl.cc
src/structs.h
src/tunnel.cc
src/useragent.cc

index b16e3a092cdc5f81d25bd6d0c26cb81d69f6b432..a95003baac08a674c31613ff2b6539fa55e0e6f3 100644 (file)
@@ -1803,6 +1803,18 @@ DOC_START
 query_icmp off
 DOC_END
 
+NAME: buffered_logs
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: off
+LOC: Config.Options.buffered_logs
+DOC_START
+       Some log files (cache.log, useragent.log) are written with
+       stdio functions, and as such they can be buffered or
+       unbuffered.  By default they will be unbuffered.
+buffered_logs off
+DOC_END
+
 NAME: always_direct
 TYPE: acl_access
 LOC: Config.accessList.AlwaysDirect
index f29494b8e215bef8a444023eea04c4611503dcd9..a25c4b85aaca15452e24f3cff16eaebeb54a7834 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.cc,v 1.49 1997/07/16 20:32:02 wessels Exp $
+ * $Id: debug.cc,v 1.50 1997/07/21 07:20:56 wessels Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -149,7 +149,7 @@ _db_print(va_alist)
 #endif /* HAVE_SYSLOG */
     /* write to log file */
     vfprintf(debug_log, f, args);
-    if (unbuffered_logs)
+    if (!Config.Options.buffered_logs)
        fflush(debug_log);
     if (opt_debug_stderr && debug_log != stderr)
        vfprintf(stderr, f, args);
index 811e05f04ab023a6ceff02b4e63630630858839e..2dc6634edc3f1580a9d003552d668ff7b5c87b43 100644 (file)
@@ -82,7 +82,6 @@ extern time_t squid_curtime;  /* 0 */
 extern time_t squid_starttime; /* 0 */
 extern volatile int reconfigure_pending;       /* 0 */
 extern volatile int shutdown_pending;  /* 0 */
-extern volatile int unbuffered_logs;   /* 0 */
 extern volatile unsigned long nudpconn;                /* 0 */
 extern volatile unsigned long ntcpconn;                /* 0 */
 extern int unlinkd_count;      /* 0 */
index 4dccdf3e055f946d27ced15dc3ac35612abc9321..c12ff7157ebcea5f71e26480d9a7f0098545aacc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.167 1997/07/19 07:20:02 wessels Exp $
+ * $Id: main.cc,v 1.168 1997/07/21 07:20:58 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -131,9 +131,8 @@ static void
 usage(void)
 {
     fprintf(stderr,
-       "Usage: %s [-hsvzCDFRUVY] [-f config-file] [-[au] port] [-k signal]\n"
+       "Usage: %s [-svzCDFRUVY] [-f config-file] [-[au] port] [-k signal]\n"
        "       -a port   Specify ASCII port number (default: %d).\n"
-       "       -b        Buffer log output (default is unbuffered).\n"
        "       -d        Write debugging to stderr also.\n"
        "       -f file   Use given config-file instead of\n"
        "                 %s\n"
@@ -188,9 +187,6 @@ mainParseOptions(int argc, char *argv[])
        case 'a':
            httpPortNumOverride = atoi(optarg);
            break;
-       case 'b':
-           unbuffered_logs = 0;
-           break;
        case 'd':
            opt_debug_stderr = 1;
            break;
index 0413bcdd18544e363dd11c1e75f847bac3312f5d..6e04f70c1cc3bf8aa0a8bbc63bd0d8bf4b76e442 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: mime.cc,v 1.35 1997/07/19 07:20:03 wessels Exp $
+ * $Id: mime.cc,v 1.36 1997/07/21 07:20:59 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -431,5 +431,6 @@ mimeLoadIconFile(const char *icon)
     storeTimestampsSet(e);
     BIT_SET(e->flag, ENTRY_SPECIAL);
     debug(25, 1) ("Loaded icon %s\n", url);
+    storeUnlockObject(e);
     put_free_4k_page(buf);
 }
index e37ca338fec9b4ac433c1e47de07ff2a2ff80ff8..7e1af68986077d70c0935a13ef36879c98de85ff 100644 (file)
@@ -384,10 +384,10 @@ extern void shut_down _PARAMS((int));
 
 
 extern void start_announce _PARAMS((void *unused));
-extern void sslStart _PARAMS((int fd, const char *, request_t *, int *sz));
+extern void sslStart _PARAMS((int fd, const char *, request_t *, size_t *sz));
 extern void waisStart _PARAMS((request_t *, StoreEntry *));
 extern void storeDirClean _PARAMS((void *unused));
-extern void passStart _PARAMS((int, const char *, request_t *, int *));
+extern void passStart _PARAMS((int, const char *, request_t *, size_t *));
 extern void identStart _PARAMS((int, ConnStateData *, IDCB * callback));
 extern int httpAnonAllowed _PARAMS((const char *line));
 extern int httpAnonDenied _PARAMS((const char *line));
index 44b55bcf12b5e607773f531b19264e01dbd5e474..8bc28fea508584d722929a165f04e24036c22768 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.58 1997/07/16 20:32:17 wessels Exp $
+ * $Id: ssl.cc,v 1.59 1997/07/21 07:21:01 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -360,7 +360,7 @@ sslConnectDone(int fd, int status, void *data)
 }
 
 void
-sslStart(int fd, const char *url, request_t * request, int *size_ptr)
+sslStart(int fd, const char *url, request_t * request, size_t *size_ptr)
 {
     /* Create state structure. */
     SslStateData *sslState = NULL;
index 5205f52737d5b9281e3ee8c69ae0684f57eb0203..07d976d25dcdbfbaf43f94d059e219331b7f4609 100644 (file)
@@ -208,6 +208,7 @@ struct _SquidConfig {
        int client_db;
        int query_icmp;
        int icp_hit_stale;
+       int buffered_logs;
     } Options;
     struct _acl *aclList;
     struct {
@@ -267,8 +268,8 @@ struct _dnsserver_t {
     int inpipe;
     int outpipe;
     time_t answer;
-    unsigned int offset;
-    unsigned int size;
+    off_t offset;
+    size_t size;
     char *ip_inbuf;
     struct timeval dispatch_time;
     void *data;
@@ -283,7 +284,7 @@ struct _dnsStatData {
 struct _dwrite_q {
     char *buf;
     int len;
-    int cur_offset;
+    off_t cur_offset;
     struct _dwrite_q *next;
     void (*free) (void *);
 };
@@ -444,8 +445,8 @@ struct _clientHttpRequest {
     char *log_url;
     struct {
        char *buf;
-       int offset;
-       int size;
+       off_t offset;
+       size_t size;
     } out;
     size_t req_sz;
     StoreEntry *entry;
@@ -465,8 +466,8 @@ struct _ConnStateData {
     int fd;
     struct {
        char *buf;
-       int offset;
-       int size;
+       off_t offset;
+       size_t size;
     } in;
     clientHttpRequest *chr;
     struct sockaddr_in peer;
@@ -705,7 +706,7 @@ struct _mem_hdr {
 struct _stmem_stats {
     int max_pages;
     int total_pages_allocated;
-    int page_size;
+    size_t page_size;
     int n_pages_in_use;
     Stack free_page_stack;
 };
@@ -733,10 +734,10 @@ struct _MemObject {
     char *e_abort_msg;
     log_type abort_code;
     int e_current_len;
-    int e_lowest_offset;
+    off_t e_lowest_offset;
     struct _store_client *clients;
     int nclients;
-    u_num32 swap_offset;
+    off_t swap_offset;
     short swapin_fd;
     short swapout_fd;
     struct _http_reply *reply;
index 10bf072700f9a8289c76733809f363609e1817be..abf0fbb9d8c06c388489ed845c3568ca2fc9bde6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.58 1997/07/16 20:32:17 wessels Exp $
+ * $Id: tunnel.cc,v 1.59 1997/07/21 07:21:01 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -360,7 +360,7 @@ sslConnectDone(int fd, int status, void *data)
 }
 
 void
-sslStart(int fd, const char *url, request_t * request, int *size_ptr)
+sslStart(int fd, const char *url, request_t * request, size_t *size_ptr)
 {
     /* Create state structure. */
     SslStateData *sslState = NULL;
index cf15aa92671d9cb7d93fa87fe97e8de68f93d90a..b02a002daa469a1097f780898fb118a5044ace06 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: useragent.cc,v 1.8 1997/07/15 05:34:14 wessels Exp $
+ * $Id: useragent.cc,v 1.9 1997/07/21 07:21:02 wessels Exp $
  *
  * DEBUG: section 40    User-Agent logging
  * AUTHOR: Joe Ramey <ramey@csc.ti.com>
@@ -112,7 +112,7 @@ logUserAgent(const char *client, const char *agent)
        client,
        time_str,
        agent);
-    if (unbuffered_logs)
+    if (!Config.Options.buffered_logs)
        fflush(cache_useragent_log);
 #endif
 }