Revision 80f4c362 td.c

View differences:

td.c
8 8
#include "td.h"
9 9

  
10 10
FILE *resfile;
11
FILE *delayfile;
11 12
FILE *statusfile;
12 13
static int ts;
13 14
static struct peer *peers;
......
67 68
        peers[p].recv_chunks[idx] = NULL;
68 69
        chunks[peers[p].chunks[idx]->chunk].avg_delay += t - peers[p].chunks[idx]->chunk;
69 70
        chunks[peers[p].chunks[idx]->chunk].max_delay = max(chunks[peers[p].chunks[idx]->chunk].max_delay, t - peers[p].chunks[idx]->chunk);
71
        if (delayfile) {
72
            fprintf(delayfile, "%d,%d,%d,%d\n", t, p, peers[p].chunks[idx]->chunk,  t - peers[p].chunks[idx]->chunk);
73
            fflush(delayfile);
74
	}
70 75
        if (chunks[peers[p].chunks[idx]->chunk].received == num_peers) {
71 76
          if (resfile) {
72 77
            fprintf(resfile, "Chunk %d received at %d in %d\n", peers[p].chunks[idx]->chunk, t, t - peers[p].chunks[idx]->chunk);

Also available in: Unified diff