diff --git a/src/ckpool.c b/src/ckpool.c index b8412979..f2e08593 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -759,7 +759,7 @@ int read_socket_line(connsock_t *cs, float *timeout) } ret = eom - cs->buf; - if (unlikely(ret > 5) && (bkey = strstr(cs->buf + ret - 5, "bkey"))) { + if (unlikely(ret > 5 && (bkey = strstr(cs->buf + ret - 5, "bkey\n")))) { eom = bkey_eom(ckp, cs, bkey, timeout); ret = eom - cs->buf; } else diff --git a/src/connector.c b/src/connector.c index 9fe233df..d1ecc2af 100644 --- a/src/connector.c +++ b/src/connector.c @@ -926,7 +926,7 @@ static void send_client(cdata_t *cdata, const int64_t id, char *buf, int slen, i } if (unlikely(len > slen)) { - bkey = strstr(buf + slen - 4 - 1, "bkey"); + bkey = strstr(buf + slen - 5, "bkey\n"); if (bkey) blen = len - (bkey - buf); } @@ -1249,7 +1249,7 @@ static void process_client_msg(cdata_t *cdata, char *buf, uint32_t msglen) slen = strlen(buf); if (likely(slen > 5)) { - bkey = strstr(buf + slen - 5, "bkey"); + bkey = strstr(buf + slen - 5, "bkey\n"); if (bkey) { LOGDEBUG("Bkey found in process_client_msg"); blen = msglen - (bkey - buf);