From 6e8e943b1439eafbc9434f3949c5d8073b32cf97 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 26 Jan 2024 18:46:59 +0100 Subject: Some tweaks to retry timeouts. --- activitypub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activitypub.c b/activitypub.c index e680e33..698758c 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2220,7 +2220,7 @@ void process_queue_item(xs_dict *q_item) /* deliver (if previous error status was a timeout, try now longer) */ status = send_to_inbox_raw(keyid, seckey, inbox, msg, - &payload, &p_size, p_status == 599 ? 20 : 3); + &payload, &p_size, p_status == 599 ? 8 : 6); if (payload) { if (p_size > 64) { -- cgit v1.2.3 From 60565673776103a0811bf71ac5064b5a50595f01 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 26 Jan 2024 18:48:32 +0100 Subject: Updated RELEASE_NOTES. --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7d3f683..8bf4b80 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -8,6 +8,8 @@ Mastodon API: Added support for editing posts, fixed an error related to the edi Added a handshake emoji next to a user name if it's a mutual relation (follower and followed), because friendship is bliss. +Tweaked some retry timeout values for better behaviour in larger instances (thanks to me@mysmallinstance.homelinux.org for their help). + ## 2.45 Fixed a collision in webfinger caching. This may affect federation with some software, so I recommend an upgrade. -- cgit v1.2.3 From 40076e969c44a4860c82c320893e0ca6f93bf83a Mon Sep 17 00:00:00 2001 From: default Date: Fri, 26 Jan 2024 19:01:59 +0100 Subject: mastoapi: avoid crashing on empty payloads. --- mastoapi.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/mastoapi.c b/mastoapi.c index 9f6c383..d8ec3b3 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -240,8 +240,10 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, char *i_ctype = xs_dict_get(req, "content-type"); xs *args = NULL; - if (i_ctype && xs_startswith(i_ctype, "application/json")) - args = xs_json_loads(payload); + if (i_ctype && xs_startswith(i_ctype, "application/json")) { + if (!xs_is_null(payload)) + args = xs_json_loads(payload); + } else if (i_ctype && xs_startswith(i_ctype, "application/x-www-form-urlencoded") && payload) { xs *upl = xs_url_dec(payload); @@ -250,6 +252,9 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, else args = xs_dup(xs_dict_get(req, "p_vars")); + if (args == NULL) + return 400; + xs *cmd = xs_replace_n(q_path, "/oauth", "", 1); srv_debug(1, xs_fmt("oauth_post_handler %s", q_path)); @@ -1981,8 +1986,10 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, xs *args = NULL; char *i_ctype = xs_dict_get(req, "content-type"); - if (i_ctype && xs_startswith(i_ctype, "application/json")) - args = xs_json_loads(payload); + if (i_ctype && xs_startswith(i_ctype, "application/json")) { + if (!xs_is_null(payload)) + args = xs_json_loads(payload); + } else args = xs_dup(xs_dict_get(req, "p_vars")); @@ -2504,8 +2511,10 @@ int mastoapi_put_handler(const xs_dict *req, const char *q_path, xs *args = NULL; char *i_ctype = xs_dict_get(req, "content-type"); - if (i_ctype && xs_startswith(i_ctype, "application/json")) - args = xs_json_loads(payload); + if (i_ctype && xs_startswith(i_ctype, "application/json")) { + if (!xs_is_null(payload)) + args = xs_json_loads(payload); + } else args = xs_dup(xs_dict_get(req, "p_vars")); -- cgit v1.2.3 From d5c2c442b162da388ae3fa274b44ec676cbca2c4 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 26 Jan 2024 19:05:14 +0100 Subject: Updated RELEASE_NOTES. --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8bf4b80..4614da6 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,7 +4,7 @@ Added support for Peertube videos. -Mastodon API: Added support for editing posts, fixed an error related to the edit date of a post. +Mastodon API: Added support for editing posts, fixed an error related to the edit date of a post, fixed some crashes. Added a handshake emoji next to a user name if it's a mutual relation (follower and followed), because friendship is bliss. -- cgit v1.2.3