Browse Source

Don't look for bkeys with messages slated for the node since they've already been extracted

master
Con Kolivas 9 years ago
parent
commit
7ee668e50d
  1. 25
      src/connector.c

25
src/connector.c

@ -916,30 +916,21 @@ static void send_client(cdata_t *cdata, const int64_t id, char *buf, int slen, i
char *bkey = NULL; char *bkey = NULL;
json_t *val; json_t *val;
if (unlikely(len > slen)) { /* Node messages will have come from the generator which will have
bkey = strstr(buf + slen - 4 - 1, "bkey"); * already extracted any bkeys */
if (bkey)
blen = len - (bkey - buf);
}
if (unlikely(ckp->node && !id)) { if (unlikely(ckp->node && !id)) {
if (bkey) {
val = json_loads(buf, JSON_DISABLE_EOF_CHECK, NULL);
if (unlikely(!val)) {
LOGWARNING("No json in bkey appended message %s", buf);
free(buf);
return;
}
json_append_bkeys(val, bkey, blen);
free(buf);
buf = json_dumps(val, JSON_COMPACT);
json_decref(val);
}
LOGDEBUG("Message for node: %s", buf); LOGDEBUG("Message for node: %s", buf);
send_proc(ckp->stratifier, buf); send_proc(ckp->stratifier, buf);
free(buf); free(buf);
return; return;
} }
if (unlikely(len > slen)) {
bkey = strstr(buf + slen - 4 - 1, "bkey");
if (bkey)
blen = len - (bkey - buf);
}
/* Grab a reference to this client until the sender_send has /* Grab a reference to this client until the sender_send has
* completed processing. Is this a passthrough subclient ? */ * completed processing. Is this a passthrough subclient ? */
if (id > 0xffffffffll) { if (id > 0xffffffffll) {

Loading…
Cancel
Save