/*
- * $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
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. */
/*
- * $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
/* 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 {
/*
- * $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
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;
}
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;
+}