tprint a status header (for httpd/cgi) to be able to signal some errors - vote … | |
git clone git://src.adamsgaard.dk/vote | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit f5592f94b672d1c35cb7e58f1aa1d5104c4331c3 | |
parent bdffc606de2cab60a78349fe387c97a0a0220e38 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Sun, 4 Oct 2020 15:48:09 +0200 | |
print a status header (for httpd/cgi) to be able to signal some errors | |
Signed-off-by: Anders Damsgaard <[email protected]> | |
Diffstat: | |
M vote.c | 2 ++ | |
1 file changed, 2 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/vote.c b/vote.c | |
t@@ -181,6 +181,7 @@ create_poll_file(const char *name, const char *question, c… | |
char *fname; | |
if (!*name || !*question || !*options) { | |
+ http_status(401); | |
puts("<p><b>Error: Could not create poll</b></p>"); | |
puts("<ul>"); | |
if (!*name) | |
t@@ -195,6 +196,7 @@ create_poll_file(const char *name, const char *question, c… | |
fname = pollfile(name, ""); | |
if (stat(fname, &sb) == 0) { | |
+ http_status(401); | |
printf("<p>Poll '%s' already exists</p>", name); | |
return -1; | |
} else { |