mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
The headers of signature errors are archived in the ~/error directory (if exists).
This commit is contained in:
parent
384cb7418a
commit
448c4ad7a2
1 changed files with 14 additions and 0 deletions
14
http.c
14
http.c
|
@ -7,6 +7,7 @@
|
||||||
#include "xs_openssl.h"
|
#include "xs_openssl.h"
|
||||||
#include "xs_curl.h"
|
#include "xs_curl.h"
|
||||||
#include "xs_time.h"
|
#include "xs_time.h"
|
||||||
|
#include "xs_json.h"
|
||||||
|
|
||||||
#include "snac.h"
|
#include "snac.h"
|
||||||
|
|
||||||
|
@ -210,5 +211,18 @@ int check_signature(snac *snac, char *req)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
|
xs *ntid = tid(0);
|
||||||
|
xs *fn = xs_fmt("%s/error/check_signature_%s.json", snac->basedir, ntid);
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
|
if ((f = fopen(fn, "w")) != NULL) {
|
||||||
|
xs *j = xs_json_dumps_pp(req, 4);
|
||||||
|
|
||||||
|
fwrite(j, strlen(j), 1, f);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue