Revision 21aba08b streamers_interface/input-http.c

View differences:

streamers_interface/input-http.c
31 31
  }
32 32

  
33 33
  res->dummy = 0;
34
printf("BEFORE INIT! %d\n", res->dummy);
34
dprintf("BEFORE INIT! %d\n", res->dummy);
35 35
  pthread_mutex_init(&cb_mutex, NULL);
36 36
  //this daemon will listen the network for incoming chunks from a streaming source
37 37
  //on the following path and port
38 38
  httpd = initChunkPuller(UL_DEFAULT_CHUNKBUFFER_PATH, UL_DEFAULT_CHUNKBUFFER_PORT);
39
printf("AFTER INIT! %d\n", res->dummy);
39
dprintf("AFTER INIT! %d\n", res->dummy);
40 40

  
41 41
  return res;
42 42
}
......
64 64
  decoded_size = decodeChunk(&gchunk, block, block_size);
65 65

  
66 66
  if(decoded_size < 0 || decoded_size != GRAPES_ENCODED_CHUNK_HEADER_SIZE + ExternalChunk_header_size + gchunk.size) {
67
	    printf("chunk %d probably corrupted!\n", gchunk.id);
67
	    fprintf(stderr, "chunk %d probably corrupted!\n", gchunk.id);
68 68
		return -1;
69 69
	}
70 70

  
71
	    printf("BEF LOCK chunk %d\n", gchunk.id);
72 71
  if(cb) {
73 72
  	pthread_mutex_lock(&cb_mutex);
74 73
  	res = cb_add_chunk(cb, &gchunk);
......
77 76
  if (res < 0) { //chunk sequence is older than previous chunk (SHOULD SEND ANYWAY!!!)
78 77
    free(gchunk.data);
79 78
    free(gchunk.attributes);
80
    printf("Chunk %d of %d bytes FAIL res %d\n", gchunk.id, gchunk.size, res);
79
    fprintf(stderr, "Chunk %d of %d bytes FAIL res %d\n", gchunk.id, gchunk.size, res);
81 80
  }
82 81
  else {
83 82
    source_push_chunk(1); //push it one time
84
    printf("Chunk %d of %d bytes PUSHED res %d\n", gchunk.id, gchunk.size, res);
83
    dprintf("Chunk %d of %d bytes PUSHED res %d\n", gchunk.id, gchunk.size, res);
85 84
  }
86 85

  
87 86
  return 0;

Also available in: Unified diff