From: wessels <> Date: Thu, 14 Nov 1996 10:00:52 +0000 (+0000) Subject: Replaced entry->fd_of_first_client with storeFirstClientFD(). X-Git-Tag: SQUID_3_0_PRE1~5469 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=626632741ba864c29b73ea9df9bac09cf389aabe;p=thirdparty%2Fsquid.git Replaced entry->fd_of_first_client with storeFirstClientFD(). --- diff --git a/src/client_side.cc b/src/client_side.cc index ed0118da31..ed9336e1c3 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.63 1996/11/12 22:37:03 wessels Exp $ + * $Id: client_side.cc,v 1.64 1996/11/14 03:00:52 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -394,7 +394,6 @@ icpProcessExpired(int fd, void *data) entry->lastmod); entry->refcount++; /* EXPIRED CASE */ - entry->mem_obj->fd_of_first_client = fd; icpState->entry = entry; icpState->offset = 0; /* Register with storage manager to receive updates when data comes in. */ diff --git a/src/http.cc b/src/http.cc index c90bf22a20..39a3e69442 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.102 1996/11/12 22:37:05 wessels Exp $ + * $Id: http.cc,v 1.103 1996/11/14 03:00:53 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -670,7 +670,7 @@ httpSendRequest(int fd, void *data) /* Add Forwarded: header */ ybuf = get_free_4k_page(); if (entry->mem_obj) - cfd = entry->mem_obj->fd_of_first_client; + cfd = storeFirstClientFD(entry->mem_obj); if (cfd > -1 && opt_forwarded_for) { sprintf(ybuf, "%s for %s\r\n", ForwardedBy, fd_table[cfd].ipaddr); } else { diff --git a/src/store.cc b/src/store.cc index 7e5150bade..3ef16a4955 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.162 1996/11/13 18:12:10 wessels Exp $ + * $Id: store.cc,v 1.163 1996/11/14 03:00:55 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -872,8 +872,6 @@ storeUnregister(StoreEntry * e, int fd) mem->clients[i].last_offset = 0; mem->clients[i].callback = NULL; mem->clients[i].callback_data = NULL; - if (mem->fd_of_first_client == fd) - mem->fd_of_first_client = -1; debug(20, 9, "storeUnregister: returning 1\n"); return 1; } @@ -2833,3 +2831,18 @@ storeEntryValidToSend(StoreEntry * e) return 0; return 1; } + +int +storeFirstClientFD(MemObject *mem) +{ + int i; + if (mem == NULL) + return -1; + if (mem->clients == NULL) + return -1; + for (i = 0; i < mem->nclients; i++) { + if (mem->clients[i].fd > -1) + return mem->clients[i].fd; + } + return -1; +}