aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-10-17 02:21:19 +0200
committerPřemysl Janouch <p@janouch.name>2018-10-17 02:21:19 +0200
commit272145ace2d7d4bd0342cce1890410d20d861e37 (patch)
tree9e1266aa05f84d9f849ab4d1accffd8b4f713872
parent4c54bc42b9fdb83d439dc974953f06f5def3ae5b (diff)
downloadjson-rpc-shell-272145ace2d7d4bd0342cce1890410d20d861e37.tar.gz
json-rpc-shell-272145ace2d7d4bd0342cce1890410d20d861e37.tar.xz
json-rpc-shell-272145ace2d7d4bd0342cce1890410d20d861e37.zip
Clarify EOF behaviour
-rw-r--r--demo-json-rpc-server.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/demo-json-rpc-server.c b/demo-json-rpc-server.c
index d461691..c886364 100644
--- a/demo-json-rpc-server.c
+++ b/demo-json-rpc-server.c
@@ -413,6 +413,7 @@ fcgi_muxer_on_stdin (struct fcgi_muxer *self, const struct fcgi_parser *parser)
return;
}
+ // At the end of the stream, a zero-length record is received
fcgi_request_push_stdin (request,
parser->content.str, parser->content.len);
}
@@ -1092,7 +1093,7 @@ ws_handler_start (struct ws_handler *self)
ev_timer_start (EV_DEFAULT_ &self->handshake_timeout_watcher);
}
-/// Push data to the WebSocket handler; "len == 0" means EOF
+/// Push data to the WebSocket handler. "len == 0" means EOF.
static bool
ws_handler_push (struct ws_handler *self, const void *data, size_t len)
{
@@ -1488,7 +1489,7 @@ struct request_handler
bool (*try_handle) (struct request *request,
struct str_map *headers, bool *continue_);
- /// Handle incoming data.
+ /// Handle incoming data. "len == 0" means EOF.
/// Returns false if there is no more processing to be done.
bool (*push_cb) (struct request *request, const void *data, size_t len);
@@ -1768,10 +1769,10 @@ request_handler_static_push
{
(void) request;
(void) data;
- (void) len;
- // Ignoring all content; we shouldn't receive any (GET)
- return false;
+ // Aborting on content; we shouldn't receive any (GET)
+ // FIXME: there should at least be some indication of this happening
+ return len == 0;
}
static void