mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Always write a raw payload in srv_archive().
This commit is contained in:
parent
bf1ee12da2
commit
64b7b66e3b
12
snac.c
12
snac.c
@ -164,6 +164,7 @@ void srv_archive(char *direction, char *req, char *payload, int p_size,
|
|||||||
|
|
||||||
if (p_size && payload) {
|
if (p_size && payload) {
|
||||||
xs *payload_fn;
|
xs *payload_fn;
|
||||||
|
xs *payload_fn_raw;
|
||||||
char *v = xs_dict_get(req, "content-type");
|
char *v = xs_dict_get(req, "content-type");
|
||||||
|
|
||||||
if (v && xs_str_in(v, "json") != -1) {
|
if (v && xs_str_in(v, "json") != -1) {
|
||||||
@ -181,13 +182,12 @@ void srv_archive(char *direction, char *req, char *payload, int p_size,
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
payload_fn = xs_fmt("%s/payload", dir);
|
|
||||||
|
|
||||||
if ((f = fopen(payload_fn, "w")) != NULL) {
|
payload_fn_raw = xs_fmt("%s/payload", dir);
|
||||||
fwrite(payload, p_size, 1, f);
|
|
||||||
fclose(f);
|
if ((f = fopen(payload_fn_raw, "w")) != NULL) {
|
||||||
}
|
fwrite(payload, p_size, 1, f);
|
||||||
|
fclose(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user