diff options
| author | default <nobody@localhost> | 2025-02-17 08:13:39 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-02-17 08:13:39 +0100 |
| commit | 349d6603e4cd4a8baff1db718afa83413b0dae5f (patch) | |
| tree | 13fe0fa89900d24993ce0ee3d8ceb77415652146 /activitypub.c | |
| parent | 3844bbf04f9b417ee9fc97f6f43db259a063a1da (diff) | |
Show the POST status also as string.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c index bcb733a..104110d 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2724,6 +2724,12 @@ int process_user_queue(snac *snac) } +xs_str *str_status(int status) +{ + return xs_fmt("%d %s", status, status < 0 ? xs_curl_strerr(status) : http_status_text(status)); +} + + void process_queue_item(xs_dict *q_item) /* processes an item from the global queue */ { @@ -2780,7 +2786,9 @@ void process_queue_item(xs_dict *q_item) else payload = xs_str_new(NULL); - srv_log(xs_fmt("output message: sent to inbox %s %d%s", inbox, status, payload)); + xs *s_status = str_status(status); + + srv_log(xs_fmt("output message: sent to inbox %s (%s)%s", inbox, s_status, payload)); if (!valid_status(status)) { retries++; @@ -2798,10 +2806,10 @@ void process_queue_item(xs_dict *q_item) || status == HTTP_STATUS_UNPROCESSABLE_CONTENT || status < 0) /* explicit error: discard */ - srv_log(xs_fmt("output message: error %s %d", inbox, status)); + srv_log(xs_fmt("output message: error %s (%s)", inbox, s_status)); else if (retries > queue_retry_max) - srv_log(xs_fmt("output message: giving up %s %d", inbox, status)); + srv_log(xs_fmt("output message: giving up %s (%s)", inbox, s_status)); else { /* requeue */ enqueue_output_raw(keyid, seckey, msg, inbox, retries, status); |