Browse Source

Correctly handle node messages

master
Con Kolivas 9 years ago
parent
commit
76561b4a63
  1. 11
      src/stratifier.c

11
src/stratifier.c

@ -3972,13 +3972,12 @@ retry:
} while (!umsg); } while (!umsg);
buf = umsg->buf; buf = umsg->buf;
if (likely(buf[0] == '{')) { if (buf[0] == '{') {
/* The bulk of the messages will be received json from the json_t *val = json_loads(buf, JSON_DISABLE_EOF_CHECK, NULL);
* connector so look for this first. The srecv_process frees
* the buf heap ram */ /* This is a message for a node */
Close(umsg->sockd); Close(umsg->sockd);
ckmsgq_add(sdata->srecvs, umsg->buf); ckmsgq_add(sdata->srecvs, val);
umsg->buf = NULL;
goto retry; goto retry;
} }
if (cmdmatch(buf, "ping")) { if (cmdmatch(buf, "ping")) {

Loading…
Cancel
Save