summaryrefslogtreecommitdiffhomepage
path: root/plop.c
diff options
context:
space:
mode:
Diffstat (limited to 'plop.c')
-rw-r--r--plop.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/plop.c b/plop.c
index 0f045f8..da51251 100644
--- a/plop.c
+++ b/plop.c
@@ -137,17 +137,7 @@ int handle_client(lua_State * L, struct epoll_event * event)
lua_insert((*request)->lua, 1);
lua_call((*request)->lua, 5, 1);
- size_t length;
- const char * body = lua_tolstring((*request)->lua, -1, &length);
-
- if (NULL != body)
- {
- respond_with_body((*request)->fd, STATUS_OK, body, (int) length);
- }
- else
- {
- respond_only_status((*request)->fd, STATUS_INTERNAL_SERVER_ERROR);
- }
+ int result = response_send((*request)->lua, (*request)->fd);
close((*request)->fd);
@@ -157,7 +147,7 @@ int handle_client(lua_State * L, struct epoll_event * event)
*request = NULL;
}
- return 0;
+ return result;
}
/// Accepts awaiting connections if any.