fix error handling ig
This commit is contained in:
parent
755c47b481
commit
5a1d8a7199
1 changed files with 1 additions and 26 deletions
27
htpipe.c
27
htpipe.c
|
|
@ -3,36 +3,11 @@
|
|||
#include <libowfat/errmsg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#undef die
|
||||
#undef diesys
|
||||
#define die(n,...) \
|
||||
do { \
|
||||
carp(__VA_ARGS__,(char*)0); \
|
||||
dieservererr(n,__VA_ARGS__,(char*)0); \
|
||||
} while(0)
|
||||
#define diesys(n,...) \
|
||||
do { \
|
||||
carpsys(__VA_ARGS__,(char*)0); \
|
||||
dieservererr(n,__VA_ARGS__,(char*)0); \
|
||||
} while(0)
|
||||
|
||||
static buffer topipe;
|
||||
|
||||
static void dieservererr(int n,char *args,...)
|
||||
{
|
||||
char *header = "HTTP/1.0 500 Internal Server Error\r\n"
|
||||
"Connection: close\r\n"
|
||||
"\r\n";
|
||||
msg(header,args);
|
||||
exit(n);
|
||||
}
|
||||
|
||||
static void dienodata(void)
|
||||
{
|
||||
char *header = "HTTP/1.0 400 Bad Request\r\n"
|
||||
"Connection: close\r\n"
|
||||
"\r\n";
|
||||
msg(header,"HTTP multipart/form-data field expected.");
|
||||
msg("HTTP multipart/form-data field expected.");
|
||||
exit(100);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue