mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Allow NULL head in struct mg_rpc
This commit is contained in:
1 parent
2bf25a1406
commit
fee6de6a7f
3 files changed
+15
-2
No files matched your search
@@ -2524,6 +2524,19 @@ static void test_rpc(void) {
|
||||
mg_iobuf_free(&io);
|
||||
}
|
||||
|
||||
{
|
||||
const char *resp =
|
||||
"{\"id\":true,\"error\":{\"code\":-32601,\"message\":\"foo not "
|
||||
"found\"}}";
|
||||
req.frame = mg_str("{\"id\": true,\"method\":\"foo\"}");
|
||||
req.head = NULL;
|
||||
mg_rpc_process(&req);
|
||||
// MG_INFO(("-> %s", io.buf));
|
||||
ASSERT(strcmp((char *) io.buf, resp) == 0);
|
||||
mg_iobuf_free(&io);
|
||||
req.head = &head;
|
||||
}
|
||||
|
||||
{
|
||||
const char *resp = "{\"error\":{\"code\":-32700,\"message\":\"haha\"}}";
|
||||
req.frame = mg_str("haha");
|
||||
|
||||
Reference in new issue
Block a user