Revision bc1ddc15

View differences:

output.c
140 140
    if (buff[c->id % buff_size].data) {
141 141
      if (buff[c->id % buff_size].id == c->id) {
142 142
        /* Duplicate of a stored chunk */
143
	fprintf(stderr,"Duplicate! chunkID: %d\n", c->id); // ENST
143 144
        dprintf("\tDuplicate!\n");
144 145
        reg_chunk_duplicate();
145 146
        return;
streaming.c
4 4
 *
5 5
 *  This is free software; see gpl-3.0.txt
6 6
 */
7
#include <sys/time.h> //ENST
7 8
#include <stdlib.h>
8 9
#include <stdio.h>
9 10
#include <stdint.h>
......
38 39
  uint16_t hopcount;
39 40
} __attribute__((packed));
40 41

  
42
//___________ENST_____________
43
struct timeval what_time; //to store the epoch time
44
uint64_t time_now; //to evaluate system time in us precision
45
int hc; //variable for storing the hopcount
46
//____________________________
47

  
41 48
struct chunk_buffer *cb;
42 49
static struct input_desc *input;
43 50
static int cb_size;
......
250 257
    reg_chunk_receive(c.id, c.timestamp, chunk_get_hopcount(&c));
251 258
    chunk_unlock(c.id);
252 259
    dprintf("Received chunk %d from peer: %s\n", c.id, node_addr(from));
260
    //____________ENST__________________________
261
    gettimeofday(&what_time, NULL);	
262
    time_now= what_time.tv_sec * 1000000ULL + what_time.tv_usec;
263
    hc = chunk_get_hopcount(&c);
264
    fprintf(stderr, "TEO: Received chunk %d from peer: %s at: %lld hopcount: %i\n", c.id, node_addr(from), time_now, hc);
265
    //_________________________________________	    
253 266
    output_deliver(&c);
254 267
    res = cb_add_chunk(cb, &c);
255 268
    cb_print();
256 269
    if (res < 0) {
257 270
      dprintf("\tchunk too old, buffer full with newer chunks\n");
271
      fprintf(stderr, "TEO: Received chunk: %d too old (buffer full with newer chunks) from peer: %s at: %lld\n", c.id, node_addr(from), time_now); //ENST
258 272
      free(c.data);
259 273
      free(c.attributes);
260 274
    }
......
403 417
        chunkID_set_add_chunk(to->bmap, c->id); //don't send twice ... assuming that it will actually arrive
404 418
        d++;
405 419
        reg_chunk_send(c->id);
420
	//___________________ENST__________________________________
421
        gettimeofday(&what_time, NULL);	
422
        time_now = what_time.tv_sec * 1000000ULL + what_time.tv_usec;	
423
	fprintf(stderr, "TEO: Sending chunk %d to peer: %s at: %lld Result: %d\n", c->id, node_addr(to->id), time_now, res);
424
	//________________________________________________________
425

  
406 426
      } else {
407 427
        fprintf(stderr,"ERROR sending chunk %d\n",c->id);
408 428
      }
......
511 531
      dprintf("%s\n", node_addr(p->id));
512 532

  
513 533
      send_bmap(p);
534
      //______________ENST_______________________
535
      gettimeofday(&what_time, NULL);	 	 
536
      time_now = what_time.tv_sec * 1000000ULL + what_time.tv_usec;
537
      fprintf(stderr, "TEO: Sending chunk %d to peer: %s at: %lld ", c->id, node_addr(p->id), time_now);
538
      //________________________________________
539

  
514 540
      chunk_attributes_update_sending(c);
515 541
      res = sendChunk(p->id, c);
542
      fprintf(stderr, "Result: %d Size: %d bytes\n", res, c->size); //ENST
516 543
      dprintf("\tResult: %d\n", res);
517 544
      if (res>=0) {
518 545
        chunkID_set_add_chunk(p->bmap,c->id); //don't send twice ... assuming that it will actually arrive

Also available in: Unified diff