comparison http.c @ 74:67b3d13a5035

pasterd: make own HTML code for good
author David Demelier <markand@malikania.fr>
date Wed, 15 Mar 2023 19:34:00 +0100
parents 1a98bc0daa49
children 52029a52a385
comparison
equal deleted inserted replaced
73:6792975da9a0 74:67b3d13a5035
73 assert(req); 73 assert(req);
74 74
75 log_debug("http: accessing page '%s'", req->path); 75 log_debug("http: accessing page '%s'", req->path);
76 76
77 if (req->page == PAGE_LAST) 77 if (req->page == PAGE_LAST)
78 page(req, NULL, KHTTP_404, "pages/404.html", "404"); 78 page_status(req, KHTTP_404);
79 else 79 else
80 handlers[req->page](req); 80 handlers[req->page](req);
81 } 81 }
82 82
83 void 83 void
92 while (khttp_fcgi_parse(fcgi, &req) == KCGI_OK) 92 while (khttp_fcgi_parse(fcgi, &req) == KCGI_OK)
93 process(&req); 93 process(&req);
94 94
95 khttp_fcgi_free(fcgi); 95 khttp_fcgi_free(fcgi);
96 } 96 }
97
98 void
99 http_cgi_run(void)
100 {
101 struct kreq req;
102
103 if (khttp_parse(&req, NULL, 0, pages, PAGE_LAST, 0) == KCGI_OK)
104 process(&req);
105 }