From 9e118c8a31d0192ae794812fd344b49e5c0c86ff Mon Sep 17 00:00:00 2001 From: xant Date: Fri, 31 Jan 2014 19:00:34 +0100 Subject: [PATCH] bugfix: set the correct status if we still have pending data --- mongoose.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index 8ee46058..f4ce6c84 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3876,7 +3876,7 @@ unsigned int mg_poll_server(struct mg_server *server, int milliseconds) { if (conn->flags & CONN_LONG_RUNNING) { conn->mg_conn.wsbits = conn->flags & CONN_CLOSE ? 1 : 0; if (call_request_handler(conn) == MG_REQUEST_PROCESSED) { - conn->flags |= CONN_CLOSE; + conn->flags |= conn->remote_iobuf.len == 0 ? CONN_CLOSE : CONN_SPOOL_DONE; } } if (conn->flags & CONN_CLOSE || conn->last_activity_time < expire_time) {