diff options
author | default <nobody@localhost> | 2023-01-08 10:02:31 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-01-08 10:02:31 +0100 |
commit | 448c4ad7a26fbfac3f9bf68861672c4833cf72a2 (patch) | |
tree | 01ed086310881d726cb4e61fe1bf5ad302ac2f0a /http.c | |
parent | 384cb7418ac39bb2cbf06662a0acc03fb717c8aa (diff) |
The headers of signature errors are archived in the ~/error directory (if exists).
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -7,6 +7,7 @@ #include "xs_openssl.h" #include "xs_curl.h" #include "xs_time.h" +#include "xs_json.h" #include "snac.h" @@ -210,5 +211,18 @@ int check_signature(snac *snac, char *req) return 1; 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; } |