- inlen = recv(c->socket, inbuf, sizeof inbuf, 0);
+ buffer_compact(&c->inbuf, MAXBUFSIZE);
+
+ if(sizeof inbuf <= c->inbuf.len) {
+ logger(LOG_ERR, "Input buffer full for %s (%s)", c->name, c->hostname);
+ return false;
+ }
+
+ inlen = recv(c->socket, inbuf, sizeof inbuf - c->inbuf.len, 0);