mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Some tweaks to connection reply logging.
This commit is contained in:
parent
7e27ccfde8
commit
f832e6a508
1 changed files with 6 additions and 6 deletions
|
@ -1180,19 +1180,19 @@ void process_queue_item(xs_dict *q_item)
|
|||
/* deliver */
|
||||
status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8);
|
||||
|
||||
if (payload && !valid_status(status)) {
|
||||
/* in case of error, print a part of the payload,
|
||||
as it may be informative */
|
||||
if (payload) {
|
||||
if (p_size > 24) {
|
||||
/* trim the message */
|
||||
payload[24] = '\0';
|
||||
payload = xs_str_cat(payload, "...");
|
||||
}
|
||||
|
||||
payload = xs_str_wrap_i(" (", payload, ")");
|
||||
}
|
||||
payload = xs_replace_i(payload, "\n", "\\n");
|
||||
|
||||
if (payload == NULL)
|
||||
if (*payload)
|
||||
payload = xs_str_wrap_i(" [", payload, "]");
|
||||
}
|
||||
else
|
||||
payload = xs_str_new(NULL);
|
||||
|
||||
srv_log(xs_fmt("output message: sent to inbox %s %d%s", inbox, status, payload));
|
||||
|
|
Loading…
Reference in a new issue