Commit ec15f2da authored by valenok's avatar valenok

Fixed assert() in mg_read()

parent d1de5f01
...@@ -1367,7 +1367,8 @@ int mg_read(struct mg_connection *conn, void *buf, size_t len) { ...@@ -1367,7 +1367,8 @@ int mg_read(struct mg_connection *conn, void *buf, size_t len) {
int n, buffered_len, nread; int n, buffered_len, nread;
const char *buffered; const char *buffered;
assert(conn->content_len >= conn->consumed_content); assert((conn->content_len == -1 && conn->consumed_content == 0) ||
conn->consumed_content <= conn->content_len);
DEBUG_TRACE(("%p %zu %lld %lld", buf, len, DEBUG_TRACE(("%p %zu %lld %lld", buf, len,
conn->content_len, conn->consumed_content)); conn->content_len, conn->consumed_content));
nread = 0; nread = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment