mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 07:28:13 +08:00
Test for Issue#200: Multiple calls to mg_read always return same data.
This commit is contained in:
parent
b452eb1eae
commit
de934641be
@ -54,7 +54,13 @@ static void test_get_var(struct mg_connection *conn,
|
||||
if (!strcmp(ri->request_method, "POST") && cl != NULL) {
|
||||
buf_len = atoi(cl);
|
||||
buf = malloc(buf_len);
|
||||
mg_read(conn, buf, buf_len);
|
||||
/* Read in two pieces, to test continuation */
|
||||
if (buf_len > 2) {
|
||||
mg_read(conn, buf, 2);
|
||||
mg_read(conn, buf + 2, buf_len - 2);
|
||||
} else {
|
||||
mg_read(conn, buf, buf_len);
|
||||
}
|
||||
} else if (ri->query_string != NULL) {
|
||||
buf_len = strlen(ri->query_string);
|
||||
buf = malloc(buf_len + 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user