Revision bd209760 chunk_puller_nh.c

View differences:

chunk_puller_nh.c
9 9
#define MY_IP "127.0.0.1"
10 10
#define MY_PORT 8888
11 11

  
12
#define BUFFSIZE 512000
12
#define BUFFSIZE 1024000
13 13

  
14 14
static struct nodeID *myID;
15 15

  
......
31 31
    struct nodeID *remote;
32 32
    static uint8_t buff[BUFFSIZE];
33 33

  
34
fprintf(stderr,"calling recv_from_peer\n");
34
//fprintf(stderr,"calling recv_from_peer\n");
35 35
    len = recv_from_peer(myID, &remote, buff, BUFFSIZE);
36
fprintf(stderr,"recv_from_peer returned\n");
36
//fprintf(stderr,"recv_from_peer returned\n");
37 37
    if (len < 0) {
38 38
      fprintf(stderr,"Error receiving message. Maybe larger than %d bytes\n", BUFFSIZE);
39 39
      nodeid_free(remote);
40 40
      continue;
41 41
    }
42 42
    //dprintf("Received message (%c) from %s\n", buff[0], node_addr(remote));
43
fprintf(stderr,"msglen: %d\n", len);
44
fprintf(stderr,"msgtype: %x\n", buff[0]);
43
//fprintf(stderr,"msglen: %d\n", len);
44
//fprintf(stderr,"msgtype: %x\n", buff[0]);
45 45
    switch (buff[0] /* Message Type */) {
46 46
      case MSG_TYPE_CHUNK:
47
if(len>510000) {
48
fprintf(stderr,"warning: big message %d\n", len);
49
}
47 50
        enqueueBlock(buff+1, len-1);
48 51
        break;
49 52
      default:

Also available in: Unified diff