Revision f14985ba streaming.c

View differences:

streaming.c
11 11
#include <stdbool.h>
12 12
#include <math.h>
13 13
#include <assert.h>
14
#include <string.h>
14 15

  
15 16
#include <net_helper.h>
16 17
#include <chunk.h> 
......
107 108

  
108 109
int source_init(const char *fname, struct nodeID *myID, bool loop, int *fds, int fds_size)
109 110
{
110
  input = input_open(fname, loop ? INPUT_LOOP : 0, fds, fds_size);
111
  int flags = 0;
112

  
113
  if (memcmp(fname, "udp:", 4) == 0) {
114
    fname += 4;
115
    flags = INPUT_UDP;
116
  }
117
  if (loop) {
118
    flags |= INPUT_LOOP;
119
  }
120
  input = input_open(fname, flags, fds, fds_size);
111 121
  if (input == NULL) {
112 122
    return -1;
113 123
  }

Also available in: Unified diff