]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merged fdstat.c into fd.c
authorwessels <>
Wed, 11 Feb 1998 04:44:30 +0000 (04:44 +0000)
committerwessels <>
Wed, 11 Feb 1998 04:44:30 +0000 (04:44 +0000)
src/Makefile.in
src/client_side.cc
src/comm.cc
src/fd.cc
src/globals.h
src/main.cc
src/protos.h
src/stat.cc

index 70372baaef864b17549bd6e096c961e93bff7587..75fa4b54338ee7872f36e8b71ac0ecc678f30b6f 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.120 1998/02/05 21:37:49 wessels Exp $
+#  $Id: Makefile.in,v 1.121 1998/02/10 21:44:30 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -81,7 +81,6 @@ OBJS          = \
                errorpage.o \
                event.o \
                fd.o \
-               fdstat.o \
                filemap.o \
                fqdncache.o \
                ftp.o \
index ac8360c548f9312dbcc677f4692e0cb3628622bd..caa628a42a5463bd63203ae576d8ae797d1280e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.205 1998/02/04 23:33:37 wessels Exp $
+ * $Id: client_side.cc,v 1.206 1998/02/10 21:44:30 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1792,7 +1792,7 @@ requestTimeout(int fd, void *data)
 int
 httpAcceptDefer(int fdnotused, void *notused)
 {
-    return !fdstat_are_n_free_fd(RESERVED_FD);
+    return fdNFree() < RESERVED_FD;
 }
 
 /* Handle a new connection on HTTP socket. */
index f3185971e97714f01ad4b79cb5f384a5c3878e24..e32cba87393bb3a28a80e9efb9e67a201033e000 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.226 1998/02/06 17:30:51 wessels Exp $
+ * $Id: comm.cc,v 1.227 1998/02/10 21:44:31 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -961,7 +961,7 @@ comm_poll(time_t sec)
                close_handler *ch;
                fde *F = &fd_table[fd];
                debug(5, 0) ("WARNING: FD %d has handlers, but it's invalid.\n", fd);
-               debug(5, 0) ("FD %d is a %s\n", fd, fdstatTypeStr[fd_table[fd].type]);
+               debug(5, 0) ("FD %d is a %s\n", fd, fdTypeStr[fd_table[fd].type]);
                debug(5, 0) ("--> %s\n", fd_table[fd].desc);
                debug(5, 0) ("tmout:%p read:%p write:%p\n",
                    F->timeout_handler,
@@ -1302,7 +1302,7 @@ examine_select(fd_set * readfds, fd_set * writefds)
        debug(5, 0) ("WARNING: FD %d has handlers, but it's invalid.\n", fd);
        debug(5, 0) ("FD %d is a %s called '%s'\n",
            fd,
-           fdstatTypeStr[fd_table[fd].type],
+           fdTypeStr[fd_table[fd].type],
            F->desc);
        debug(5, 0) ("tmout:%p read:%p write:%p\n",
            F->timeout_handler,
index 7f2c5287ee1b282f44c45227ecac20d5cbb148d9..1096b29e49c01e81ecf32eb8bb673b2f32233324 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fd.cc,v 1.19 1998/02/02 21:16:24 wessels Exp $
+ * $Id: fd.cc,v 1.20 1998/02/10 21:44:33 wessels Exp $
  *
  * DEBUG: section 51    Filedescriptor Functions
  * AUTHOR: Duane Wessels
 
 #include "squid.h"
 
+const char *fdTypeStr[] =
+{
+    "None",
+    "Log",
+    "File",
+    "Socket",
+    "Pipe",
+    "Unknown"
+};
+
 static void fdUpdateBiggest(int fd, unsigned int status);
 
 static void
@@ -124,3 +134,9 @@ fdDumpOpen(void)
        debug(51, 1) ("Open FD %4d %s\n", i, F->desc);
     }
 }
+
+int
+fdNFree(void)
+{
+    return Squid_MaxFD - Number_FD;
+}
index 20d693245022d625d09f1bd32580840b00587e50..f182a7211119fefae64cc2a9d4a367aebdaac8e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.35 1998/02/07 08:13:37 wessels Exp $
+ * $Id: globals.h,v 1.36 1998/02/10 21:44:33 wessels Exp $
  */
 
 extern FILE *debug_log;                /* NULL */
@@ -27,7 +27,7 @@ extern const char *const localhost;   /* "127.0.0.1" */
 extern const char *const null_string;  /* "" */
 extern const char *const version_string;       /* SQUID_VERSION */
 extern const char *const w_space;      /* " \t\n\r" */
-extern const char *fdstatTypeStr[];
+extern const char *fdTypeStr[];
 extern const char *hier_strings[];
 extern const char *memStatusStr[];
 extern const char *pingStatusStr[];
index 6ccd5042fb351e00107a2beae56a5fc841035221..397ff690e16ba37834f7cc57dbac08d1302c5b78 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.215 1998/02/06 23:58:04 wessels Exp $
+ * $Id: main.cc,v 1.216 1998/02/10 21:44:34 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -558,7 +558,6 @@ main(int argc, char **argv)
     comm_init();
 
     /* we have to init fdstat here. */
-    fdstat_init();
     fd_open(0, FD_LOG, "stdin");
     fd_open(1, FD_LOG, "stdout");
     fd_open(2, FD_LOG, "stderr");
index 1a2d0e047de4944e9591e262366721214cf2016e..b4e7ebc8335a4aed3a78455250a4d2bb37fcd6ed 100644 (file)
@@ -147,9 +147,7 @@ extern void fd_note(int fd, const char *);
 extern void fd_bytes(int fd, int len, unsigned int type);
 extern void fdFreeMemory(void);
 extern void fdDumpOpen(void);
-
-extern void fdstat_init(void);
-extern int fdstat_are_n_free_fd(int);
+extern int fdNFree(void);
 
 extern fileMap *file_map_create(int);
 extern int file_map_allocate(fileMap *, int);
index 645cdaeaff93985c7c313f37187fdc32e565afdb..eba57cb5017db842a9204351df9c31a6ea6da462 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.194 1998/02/07 08:13:41 wessels Exp $
+ * $Id: stat.cc,v 1.195 1998/02/10 21:44:35 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -429,7 +429,7 @@ statFiledescriptors(StoreEntry * sentry)
            continue;
        storeAppendPrintf(sentry, "%4d %-6.6s %4d %7d %7d %-21s %s\n",
            i,
-           fdstatTypeStr[f->type],
+           fdTypeStr[f->type],
            f->timeout_handler ? (f->timeout - squid_curtime) / 60 : 0,
            f->bytes_read,
            f->bytes_written,