Revision 3656c531 streaming.c

View differences:

streaming.c
377 377
 */
378 378
int needs(struct peer *n, int cid){
379 379
  struct peer * p = n;
380
  uint64_t ts;
380 381

  
381
  if (get_chunk_timestamp(cid) < gettimeofday_in_us() - CB_SIZE_TIME) {
382
  ts = get_chunk_timestamp(cid);
383
  if (ts && (ts < gettimeofday_in_us() - CB_SIZE_TIME)) {	//if we don't know the timestamp, we accept
382 384
    return 0;
383 385
  }
384 386

  
......
391 393
}
392 394

  
393 395
int _needs(struct chunkID_set *cset, int cb_size, int cid){
396
  uint64_t ts;
397

  
394 398
  if (cb_size == 0) { //if it declared it does not needs chunks
395 399
    return 0;
396 400
  }
397 401

  
398
  if (get_chunk_timestamp(cid) < gettimeofday_in_us() - CB_SIZE_TIME) {
402
  ts = get_chunk_timestamp(cid);
403
  if (ts && (ts < gettimeofday_in_us() - CB_SIZE_TIME)) {	//if we don't know the timestamp, we accept
399 404
    return 0;
400 405
  }
401 406

  

Also available in: Unified diff