diff options
Diffstat (limited to 'http.c')
| -rw-r--r-- | http.c | 14 |
1 files changed, 14 insertions, 0 deletions
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "xs_openssl.h" | 7 | #include "xs_openssl.h" |
| 8 | #include "xs_curl.h" | 8 | #include "xs_curl.h" |
| 9 | #include "xs_time.h" | 9 | #include "xs_time.h" |
| 10 | #include "xs_json.h" | ||
| 10 | 11 | ||
| 11 | #include "snac.h" | 12 | #include "snac.h" |
| 12 | 13 | ||
| @@ -210,5 +211,18 @@ int check_signature(snac *snac, char *req) | |||
| 210 | return 1; | 211 | return 1; |
| 211 | 212 | ||
| 212 | error: | 213 | error: |
| 214 | { | ||
| 215 | xs *ntid = tid(0); | ||
| 216 | xs *fn = xs_fmt("%s/error/check_signature_%s.json", snac->basedir, ntid); | ||
| 217 | FILE *f; | ||
| 218 | |||
| 219 | if ((f = fopen(fn, "w")) != NULL) { | ||
| 220 | xs *j = xs_json_dumps_pp(req, 4); | ||
| 221 | |||
| 222 | fwrite(j, strlen(j), 1, f); | ||
| 223 | fclose(f); | ||
| 224 | } | ||
| 225 | } | ||
| 226 | |||
| 213 | return 0; | 227 | return 0; |
| 214 | } | 228 | } |