Also log an error when the input buffer contains more than MAXBUFSIZE bytes
already, instead of silently claiming the other side closed the connection.
- If not, keep stuff in buffer and exit.
*/
- If not, keep stuff in buffer and exit.
*/
+ buffer_compact(&c->inbuf);
+
+ if(sizeof inbuf <= c->inbuf.len) {
+ logger(LOG_ERR, "Input buffer full for %s (%s)\n");
+ return false;
+ }
+
inlen = recv(c->socket, inbuf, sizeof inbuf - c->inbuf.len, 0);
if(inlen <= 0) {
inlen = recv(c->socket, inbuf, sizeof inbuf - c->inbuf.len, 0);
if(inlen <= 0) {
- buffer_compact(&c->inbuf);
-