Revision 03dca3bf loop.c

View differences:

loop.c
28 28
static struct timeval period = {0, 500000};
29 29
static struct timeval tnext;
30 30

  
31
#ifdef HTTPIO
32
extern pthread_mutex_t cb_mutex;
33
#endif
34

  
31 35
void tout_init(struct timeval *tv)
32 36
{
33 37
  struct timeval tnow;
......
77 81
          break;
78 82
        case MSG_TYPE_CHUNK:
79 83
          dprintf("Chunk message received:\n");
84
#ifdef HTTPIO
85
          pthread_mutex_lock(&cb_mutex);
86
#endif
80 87
          received_chunk(remote, buff, len);
88
#ifdef HTTPIO
89
          pthread_mutex_unlock(&cb_mutex);
90
#endif
81 91
          break;
82 92
        case MSG_TYPE_SIGNALLING:
83 93
          sigParseData(remote, buff, len);
......
119 129
    int len, res;
120 130
    struct timeval tv;
121 131

  
132
#ifdef HTTPIO
133
    res = wait4data(s, NULL, NULL);
134
#else
122 135
    tout_init(&tv);
123 136
    res = wait4data(s, &tv, NULL);
137
#endif
124 138
    if (res > 0) {
125 139
      const struct nodeID *remote;
126 140

  

Also available in: Unified diff