|
|
@@ -709,12 +709,12 @@ int actor_get(snac *snac, char *actor, d_char **data)
|
|
|
}
|
|
|
|
|
|
|
|
|
-void enqueue_input(snac *snac, char *msg)
|
|
|
+void enqueue_input(snac *snac, char *msg, char *req)
|
|
|
/* enqueues an input message */
|
|
|
{
|
|
|
xs *ntid = tid(0);
|
|
|
xs *fn = xs_fmt("%s/queue/%s.json", snac->basedir, ntid);
|
|
|
- xs *tfn = xs_str_cat(fn, ".tmp");
|
|
|
+ xs *tfn = xs_fmt("%s.tmp", fn);
|
|
|
FILE *f;
|
|
|
|
|
|
if ((f = fopen(tfn, "w")) != NULL) {
|
|
|
@@ -723,6 +723,7 @@ void enqueue_input(snac *snac, char *msg)
|
|
|
|
|
|
qmsg = xs_dict_append(qmsg, "type", "input");
|
|
|
qmsg = xs_dict_append(qmsg, "object", msg);
|
|
|
+ qmsg = xs_dict_append(qmsg, "req", req);
|
|
|
|
|
|
j = xs_json_dumps_pp(qmsg, 4);
|
|
|
|
|
|
@@ -736,7 +737,7 @@ void enqueue_input(snac *snac, char *msg)
|
|
|
}
|
|
|
|
|
|
|
|
|
-void enqueue_output(snac *snac, char *actor, char *msg, int retries)
|
|
|
+void enqueue_output(snac *snac, char *msg, char *actor, int retries)
|
|
|
/* enqueues an output message for an actor */
|
|
|
{
|
|
|
if (strcmp(actor, snac->actor) == 0) {
|
|
|
@@ -747,7 +748,7 @@ void enqueue_output(snac *snac, char *actor, char *msg, int retries)
|
|
|
int qrt = xs_number_get(xs_dict_get(srv_config, "query_retry_minutes"));
|
|
|
xs *ntid = tid(retries * 60 * qrt);
|
|
|
xs *fn = xs_fmt("%s/queue/%s.json", snac->basedir, ntid);
|
|
|
- xs *tfn = xs_str_cat(fn, ".tmp");
|
|
|
+ xs *tfn = xs_fmt("%s.tmp", fn);
|
|
|
FILE *f;
|
|
|
|
|
|
if ((f = fopen(tfn, "w")) != NULL) {
|