Revision 8afbc263

View differences:

src/PeerSampler/ncast.c
182 182
  if (time_to_send(context)) {
183 183
    int ret = INT_MIN;
184 184
    int i;
185
    int entries = cache_entries(context->local_cache);
185 186

  
186 187
    context->query_tokens++;
187 188
    if (context->reply_tokens++ > 0) {//on average one reply is sent, if not, do something
188 189
      context->query_tokens += context->reply_tokens;
189 190
      context->reply_tokens = 0;
190 191
    }
192
    if (context->query_tokens > entries) context->query_tokens = entries;	//don't be too aggressive
191 193

  
192 194
    cache_update(context->local_cache);
193 195
    for (i = 0; i < context->query_tokens; i++) {

Also available in: Unified diff