mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
fix fuzzer
This commit is contained in:
1 parent
b86f255407
commit
17a25373db
1 file changed
+4
-1
+4
-1
@@ -356,8 +356,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
#endif
|
#endif
|
||||||
mg_tcpip_rx(&mif, pkt, size);
|
mg_tcpip_rx(&mif, pkt, size);
|
||||||
|
|
||||||
|
// prior actions may have had consequences on link state
|
||||||
|
mif.state = MG_TCPIP_STATE_READY;
|
||||||
// Test HTTP serving (via our built-in TCP/IP stack)
|
// Test HTTP serving (via our built-in TCP/IP stack)
|
||||||
const char *url = "http://localhost:12345";
|
const char *url = "http://localhost:12345"; // internally resolves
|
||||||
|
// creates a connection and sends SYN via the router, unless OOM
|
||||||
struct mg_connection *c = mg_http_connect(&mgr, url, fn, NULL);
|
struct mg_connection *c = mg_http_connect(&mgr, url, fn, NULL);
|
||||||
mg_iobuf_add(&c->recv, 0, data, size);
|
mg_iobuf_add(&c->recv, 0, data, size);
|
||||||
c->pfn(c, MG_EV_READ, NULL); // manually invoke protocol event handler
|
c->pfn(c, MG_EV_READ, NULL); // manually invoke protocol event handler
|
||||||
|
|||||||
Reference in new issue
Block a user