]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed struct _fde->flags to int:1 list.
authorwessels <>
Thu, 21 May 1998 04:07:08 +0000 (04:07 +0000)
committerwessels <>
Thu, 21 May 1998 04:07:08 +0000 (04:07 +0000)
src/client_side.cc
src/comm.cc
src/enums.h
src/structs.h

index df182f44f978fa8e70d33d12f1d52d540d10a0c2..be8d1a03cebb6bd6059ac9225bf01e7572bc1fad 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.308 1998/05/18 21:14:31 wessels Exp $
+ * $Id: client_side.cc,v 1.309 1998/05/20 22:07:08 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1903,7 +1903,7 @@ clientReadRequest(int fd, void *data)
        }
        /* It might be half-closed, we can't tell */
        debug(33, 5) ("clientReadRequest: FD %d closed?\n", fd);
-       EBIT_SET(F->flags, FD_SOCKET_EOF);
+       F->flags.socket_eof = 1;
        conn->defer.until = squid_curtime + 1;
        conn->defer.n++;
        fd_note(fd, "half-closed");
index 8d217b7fa309af3d696dd5f34a44a429980e37fc..35a6267aad41c65c9ed9a450a5465eb8a2fa64a6 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: comm.cc,v 1.257 1998/05/20 21:47:44 wessels Exp $
+ * $Id: comm.cc,v 1.258 1998/05/20 22:07:10 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -671,18 +671,17 @@ comm_close(int fd)
     assert(fd >= 0);
     assert(fd < Squid_MaxFD);
     F = &fd_table[fd];
-    if (EBIT_TEST(F->flags, FD_CLOSING))
+    if (F->flags.closing)
        return;
     if (shutting_down && (!F->open || F->type == FD_FILE))
        return;
     assert(F->open);
     assert(F->type != FD_FILE);
 #ifdef USE_ASYNC_IO
-    if (EBIT_TEST(F->flags, FD_NOLINGER))
-       if (EBIT_TEST(F->flags, FD_NONBLOCKING))
-           doaioclose = 0;
+    if (F->flags.nolinger && F->flags.nonblocking)
+       doaioclose = 0;
 #endif
-    EBIT_SET(F->flags, FD_CLOSING);
+    F->flags.closing = 1;
     CommWriteStateCallbackAndFree(fd, COMM_ERR_CLOSING);
     commCallCloseHandlers(fd);
     if (F->uses)               /* assume persistent connect count */
@@ -1237,7 +1236,7 @@ commSetNoLinger(int fd)
     L.l_linger = 0;
     if (setsockopt(fd, SOL_SOCKET, SO_LINGER, (char *) &L, sizeof(L)) < 0)
        debug(50, 0) ("commSetNoLinger: FD %d: %s\n", fd, xstrerror());
-    EBIT_SET(fd_table[fd].flags, FD_NOLINGER);
+    fd_table[fd].flags.nolinger = 1;
 }
 
 static void
@@ -1269,7 +1268,7 @@ commSetNonBlocking(int fd)
        debug(50, 0) ("commSetNonBlocking: FD %d: %s\n", fd, xstrerror());
        return COMM_ERROR;
     }
-    EBIT_SET(fd_table[fd].flags, FD_NONBLOCKING);
+    fd_table[fd].flags.nonblocking = 1;
     return 0;
 }
 
index 9812698affaee8813b1655535c13430ce7d0736d..240799ab2409a2a1ccf2b733697dc5917554dad2 100644 (file)
@@ -459,15 +459,6 @@ enum {
     REQ_REDIRECTED
 };
 
-enum {
-    FD_CLOSE_REQUEST,
-    FD_WRITE_DAEMON,
-    FD_CLOSING,
-    FD_SOCKET_EOF,
-    FD_NOLINGER,
-    FD_NONBLOCKING
-};
-
 enum {
     HELPER_ALIVE,
     HELPER_BUSY,
@@ -641,8 +632,8 @@ enum {
  * These are field indicators for raw cache-cache netdb transfers
  */
 enum {
-       NETDB_EX_NONE,
-       NETDB_EX_NETWORK,
-       NETDB_EX_RTT,
-       NETDB_EX_HOPS
+    NETDB_EX_NONE,
+    NETDB_EX_NETWORK,
+    NETDB_EX_RTT,
+    NETDB_EX_HOPS
 };
index 3a1bc03edbe44e353a9892f254de93d7b91408b6..04ad0c5b7744d02a3eb02303bc541d5186e401dc 100644 (file)
@@ -414,7 +414,14 @@ struct _fde {
     u_short remote_port;
     char ipaddr[16];           /* dotted decimal address of peer */
     char desc[FD_DESC_SZ];
-    int flags;
+    struct {
+       int close_request:1;
+       int write_daemon:1;
+       int closing:1;
+       int socket_eof:1;
+       int nolinger:1;
+       int nonblocking:1;
+    } flags;
     int bytes_read;
     int bytes_written;
     int uses;                  /* ie # req's over persistent conn */
@@ -1003,7 +1010,7 @@ struct _store_client {
     StoreEntry *entry;         /* ptr to the parent StoreEntry, argh! */
     int swapin_fd;
     struct {
-       int disk_io_pending:1;
+       int disk_io_pending:1;
        int store_copying:1;
        int copy_event_pending:1;
     } flags;