json-rpc-test-server: add a simple co-process mode

A disgusting copy-paste but it will have to do for now.

Closes #6
This commit is contained in:
2020-10-15 02:11:51 +02:00
parent b3c377afdb
commit 75b2094cdd
3 changed files with 179 additions and 7 deletions

View File

@@ -2623,7 +2623,7 @@ static const http_parser_settings backend_co_http_settings =
};
static bool
backend_co_write_starter (struct co_context *self, struct error **e)
backend_co_inject_starter (struct co_context *self, struct error **e)
{
// The default "Connection: keep-alive" maps well here.
// We cannot feed this line into the parser from within callbacks.
@@ -2653,7 +2653,7 @@ backend_co_parse (struct co_context *self, const char *data, size_t len,
if (self->pending_fake_starter)
{
self->pending_fake_starter = false;
if (!backend_co_write_starter (self, e))
if (!backend_co_inject_starter (self, e))
return false;
}