/*
- * $Id: delay_pools.cc,v 1.23 2002/04/14 21:51:36 hno Exp $
+ * $Id: delay_pools.cc,v 1.24 2002/04/21 21:54:40 hno Exp $
*
* DEBUG: section 77 Delay Pools
* AUTHOR: David Luyer <david@luyer.net>
{
int i = 0;
int found = 0;
+ int wanted;
store_client *sc;
dlink_node *node;
for (node = mem->clients.head; node; node = node->next) {
sc = (store_client *) node->data;
+ if (sc->callback_data == NULL) /* not waiting for more data */
+ continue;
if (sc->type != STORE_MEM_CLIENT)
continue;
- i = delayBytesWanted(sc->delay_id, i, max);
+ wanted = sc->copy_size;
+ if (wanted > max)
+ wanted = max;
+ i = delayBytesWanted(sc->delay_id, i, wanted);
found = 1;
}
return found ? i : max;
delay_id d = 0;
for (node = mem->clients.head; node; node = node->next) {
sc = (store_client *) node->data;
- if (sc->callback_data == NULL) /* open slot */
+ if (sc->callback_data == NULL) /* not waiting for more data */
continue;
if (sc->type != STORE_MEM_CLIENT)
continue;
- j = delayBytesWanted(sc->delay_id, 0, SQUID_TCP_SO_RCVBUF);
+ j = delayBytesWanted(sc->delay_id, 0, sc->copy_size);
if (j > jmax) {
jmax = j;
d = sc->delay_id;