diff options
| author | 2023-02-14 08:26:39 +0100 | |
|---|---|---|
| committer | 2023-02-14 08:26:39 +0100 | |
| commit | f832e6a508c7d98b7d23e2494db946be69231261 (patch) | |
| tree | 892fb357dee14c85666e25a8c5caf9ac24610801 | |
| parent | Try to show a piece of the error after connecting. (diff) | |
| download | snac2-f832e6a508c7d98b7d23e2494db946be69231261.tar.gz snac2-f832e6a508c7d98b7d23e2494db946be69231261.tar.xz snac2-f832e6a508c7d98b7d23e2494db946be69231261.zip | |
Some tweaks to connection reply logging.
| -rw-r--r-- | activitypub.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activitypub.c b/activitypub.c index 75b84ec..64db1d9 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1180,19 +1180,19 @@ void process_queue_item(xs_dict *q_item) | |||
| 1180 | /* deliver */ | 1180 | /* deliver */ |
| 1181 | status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8); | 1181 | status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8); |
| 1182 | 1182 | ||
| 1183 | if (payload && !valid_status(status)) { | 1183 | if (payload) { |
| 1184 | /* in case of error, print a part of the payload, | ||
| 1185 | as it may be informative */ | ||
| 1186 | if (p_size > 24) { | 1184 | if (p_size > 24) { |
| 1187 | /* trim the message */ | 1185 | /* trim the message */ |
| 1188 | payload[24] = '\0'; | 1186 | payload[24] = '\0'; |
| 1189 | payload = xs_str_cat(payload, "..."); | 1187 | payload = xs_str_cat(payload, "..."); |
| 1190 | } | 1188 | } |
| 1191 | 1189 | ||
| 1192 | payload = xs_str_wrap_i(" (", payload, ")"); | 1190 | payload = xs_replace_i(payload, "\n", "\\n"); |
| 1193 | } | ||
| 1194 | 1191 | ||
| 1195 | if (payload == NULL) | 1192 | if (*payload) |
| 1193 | payload = xs_str_wrap_i(" [", payload, "]"); | ||
| 1194 | } | ||
| 1195 | else | ||
| 1196 | payload = xs_str_new(NULL); | 1196 | payload = xs_str_new(NULL); |
| 1197 | 1197 | ||
| 1198 | srv_log(xs_fmt("output message: sent to inbox %s %d%s", inbox, status, payload)); | 1198 | srv_log(xs_fmt("output message: sent to inbox %s %d%s", inbox, status, payload)); |