summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2023-07-31 17:34:24 +0200
committerVincent Douillet <vincent@vdouillet.fr>2023-08-01 18:14:47 +0200
commit62b01654da4f1ae1a9aaeab106cea5e7bb9d77e3 (patch)
tree275b99f1fe4d12777f389045d6cd8411d5e6f324 /main.c
parent89a76cdd3fa168902d83f4c043d2cc6629b40024 (diff)
handle kcgi errors
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/main.c b/main.c
index 6abcbc5..6b54a5e 100644
--- a/main.c
+++ b/main.c
@@ -29,10 +29,10 @@
*/
#include <stdlib.h>
-#include <kcgi.h>
#include <unistd.h>
#include "browse.h"
+#include "cgi.h"
#include "http.h"
enum page {
@@ -47,14 +47,10 @@ static const char *const pages[PAGE__MAX] = {
int
main(void)
{
- enum kcgi_err err;
- int page_ret_val;
- struct kreq r;
+ int page_ret_val;
+ struct kreq r;
- err = khttp_parse(&r, NULL, 0, pages, PAGE__MAX, PAGE_BROWSE);
-
- if (KCGI_OK != err)
- return EXIT_FAILURE;
+ K_OK(khttp_parse(&r, NULL, 0, pages, PAGE__MAX, PAGE_BROWSE));
/*
* Make sure basic request parameters are as expected : GET or POST,