summaryrefslogtreecommitdiffhomepage
path: root/plop.c
diff options
context:
space:
mode:
Diffstat (limited to 'plop.c')
-rw-r--r--plop.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plop.c b/plop.c
index e90c3b0..1485aa7 100644
--- a/plop.c
+++ b/plop.c
@@ -100,6 +100,7 @@ int handle_client(lua_State * L, struct pollfd * pfd, char ** data, const int sh
if (-1 == collect_request(pfd->fd, data))
{
+ respond_only_status(pfd->fd, STATUS_BAD_REQUEST);
return -1; // TODO: Handle errors properly
}
@@ -114,6 +115,10 @@ int handle_client(lua_State * L, struct pollfd * pfd, char ** data, const int sh
{
respond_with_body(pfd->fd, STATUS_OK, body, (int) length);
}
+ else
+ {
+ respond_only_status(pfd->fd, STATUS_INTERNAL_SERVER_ERROR);
+ }
close(pfd->fd);
(pfd - shift_by)->fd = -1;