From 58a6c18695f2c186cf6ce45f1130a81dfee0f2ff Mon Sep 17 00:00:00 2001 From: wessels <> Date: Thu, 21 May 1998 04:07:08 +0000 Subject: [PATCH] Changed struct _fde->flags to int:1 list. --- src/client_side.cc | 4 ++-- src/comm.cc | 15 +++++++-------- src/enums.h | 17 ++++------------- src/structs.h | 11 +++++++++-- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/client_side.cc b/src/client_side.cc index df182f44f9..be8d1a03ce 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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"); diff --git a/src/comm.cc b/src/comm.cc index 8d217b7fa3..35a6267aad 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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; } diff --git a/src/enums.h b/src/enums.h index 9812698aff..240799ab24 100644 --- a/src/enums.h +++ b/src/enums.h @@ -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 }; diff --git a/src/structs.h b/src/structs.h index 3a1bc03edb..04ad0c5b77 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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; -- 2.47.3