summaryrefslogtreecommitdiff
path: root/snac.c
diff options
context:
space:
mode:
authorGravatar default2022-09-26 11:19:45 +0200
committerGravatar default2022-09-26 11:19:45 +0200
commitfd6f71bfe36331d046e4183c2c133c6f01c9af2d (patch)
tree2523108550567f4f20d0b3e3d8ec703f09a05c4d /snac.c
parentNew function msg_admiration(). (diff)
downloadsnac2-fd6f71bfe36331d046e4183c2c133c6f01c9af2d.tar.gz
snac2-fd6f71bfe36331d046e4183c2c133c6f01c9af2d.tar.xz
snac2-fd6f71bfe36331d046e4183c2c133c6f01c9af2d.zip
More work but signatures seem to still fail.
Diffstat (limited to 'snac.c')
-rw-r--r--snac.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/snac.c b/snac.c
index 52ac7d3..2c350bb 100644
--- a/snac.c
+++ b/snac.c
@@ -142,7 +142,7 @@ void srv_archive(char *direction, char *req, char *payload, int p_size,
142/* archives a connection */ 142/* archives a connection */
143{ 143{
144 /* obsessive archiving */ 144 /* obsessive archiving */
145 xs *date = xs_local_time("%Y%m%d%H%M%S"); 145 xs *date = tid(0);
146 xs *dir = xs_fmt("%s/archive/%s", srv_basedir, date); 146 xs *dir = xs_fmt("%s/archive/%s", srv_basedir, date);
147 FILE *f; 147 FILE *f;
148 148
@@ -172,7 +172,10 @@ void srv_archive(char *direction, char *req, char *payload, int p_size,
172 172
173 if ((f = fopen(payload_fn, "w")) != NULL) { 173 if ((f = fopen(payload_fn, "w")) != NULL) {
174 xs *v1 = xs_json_loads(payload); 174 xs *v1 = xs_json_loads(payload);
175 xs *j1 = xs_json_dumps_pp(v1, 4); 175 xs *j1 = NULL;
176
177 if (v1 != NULL)
178 j1 = xs_json_dumps_pp(v1, 4);
176 179
177 if (j1 != NULL) 180 if (j1 != NULL)
178 fwrite(j1, strlen(j1), 1, f); 181 fwrite(j1, strlen(j1), 1, f);
@@ -200,7 +203,10 @@ void srv_archive(char *direction, char *req, char *payload, int p_size,
200 203
201 if ((f = fopen(body_fn, "w")) != NULL) { 204 if ((f = fopen(body_fn, "w")) != NULL) {
202 xs *v1 = xs_json_loads(body); 205 xs *v1 = xs_json_loads(body);
203 xs *j1 = xs_json_dumps_pp(v1, 4); 206 xs *j1 = NULL;
207
208 if (v1 != NULL)
209 j1 = xs_json_dumps_pp(v1, 4);
204 210
205 if (j1 != NULL) 211 if (j1 != NULL)
206 fwrite(j1, strlen(j1), 1, f); 212 fwrite(j1, strlen(j1), 1, f);