mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-12 20:59:03 +08:00
Added comments in read_request()
This commit is contained in:
parent
d7e6492fac
commit
9378946e7d
@ -2714,6 +2714,8 @@ static int read_request(FILE *fp, struct mg_connection *conn,
|
|||||||
(n = pull(fp, conn, buf + *nread, bufsiz - *nread)) > 0) {
|
(n = pull(fp, conn, buf + *nread, bufsiz - *nread)) > 0) {
|
||||||
*nread += n;
|
*nread += n;
|
||||||
}
|
}
|
||||||
|
// *nread <= bufsiz check is crucial. If client fills up the whole buffer
|
||||||
|
// in one go, we still need to make an iteration and calculate request_len
|
||||||
} while (*nread <= bufsiz && request_len == 0 && n > 0);
|
} while (*nread <= bufsiz && request_len == 0 && n > 0);
|
||||||
|
|
||||||
return n < 0 ? -1 : request_len;
|
return n < 0 ? -1 : request_len;
|
||||||
|
Loading…
Reference in New Issue
Block a user