Revision e223dc99 loop.c

View differences:

loop.c
10 10
#include <msg_types.h>
11 11
#include <peerset.h>
12 12

  
13
#include "chunk_signaling.h"
13 14
#include "streaming.h"
14 15
#include "loop.h"
15 16

  
......
17 18
static struct timeval period = {0, 500000};
18 19
static struct timeval tnext;
19 20

  
21

  
20 22
void tout_init(struct timeval *tv)
21 23
{
22 24
  struct timeval tnow;
......
53 55
  period.tv_sec = csize / 1000000;
54 56
  period.tv_usec = csize % 1000000;
55 57
  
58
  sigInit(s,pset);
56 59
  update_peers(pset, NULL, 0);
57 60
  stream_init(buff_size, s);
58 61
  while (!done) {
......
72 75
        case MSG_TYPE_CHUNK:
73 76
          received_chunk(pset, remote, buff, len);
74 77
          break;
78
        case MSG_TYPE_SIGNALLING:
79
          sigParseData(buff, len);
80
          break;
75 81
        default:
76 82
          fprintf(stderr, "Unknown Message Type %x\n", buff[0]);
77 83
      }
......
99 105
  period.tv_sec = csize  / 1000000;
100 106
  period.tv_usec = csize % 1000000;
101 107
  
108
  sigInit(s,pset);
102 109
  source_init(fname, s);
103 110
  while (!done) {
104 111
    int len, res;
......
118 125
        case MSG_TYPE_CHUNK:
119 126
          fprintf(stderr, "Some dumb peer pushed a chunk to me!\n");
120 127
          break;
128
        case MSG_TYPE_SIGNALLING:
129
          sigParseData(buff, len);
130
          break;
121 131
        default:
122 132
          fprintf(stderr, "Bad Message Type %x\n", buff[0]);
123 133
      }

Also available in: Unified diff