]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Replaced entry->fd_of_first_client with storeFirstClientFD().
authorwessels <>
Thu, 14 Nov 1996 10:00:52 +0000 (10:00 +0000)
committerwessels <>
Thu, 14 Nov 1996 10:00:52 +0000 (10:00 +0000)
src/client_side.cc
src/http.cc
src/store.cc

index ed0118da3190b145b43b49ff4777e01cee22a19a..ed9336e1c3d44f02374dc7ecada0fa0d62a92a03 100644 (file)
@@ -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. */
index c90bf22a20eb879019970b87e0dae95304607cf9..39a3e69442e81a7f13d6f3413c73e78dc742a6b1 100644 (file)
@@ -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 {
index 7e5150bade759a9857a7f43589f5675c67a123ca..3ef16a4955d8390ea125c06bb9a9b2d27a135bac 100644 (file)
@@ -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;
+}