diff options
| author | 2024-01-10 19:16:05 +0100 | |
|---|---|---|
| committer | 2024-01-10 19:16:05 +0100 | |
| commit | 7f6a79314634fa089718ec0f99e4231295e03d5b (patch) | |
| tree | 20c134b6c225e853986ec47f8f8d656b29afc0bb /webfinger.c | |
| parent | Call srv_archive_error() on input q_item errors. (diff) | |
| download | penes-snac2-7f6a79314634fa089718ec0f99e4231295e03d5b.tar.gz penes-snac2-7f6a79314634fa089718ec0f99e4231295e03d5b.tar.xz penes-snac2-7f6a79314634fa089718ec0f99e4231295e03d5b.zip | |
Fixed minor collision in webfinger caching.
Diffstat (limited to 'webfinger.c')
| -rw-r--r-- | webfinger.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/webfinger.c b/webfinger.c index 2184097..3f28b81 100644 --- a/webfinger.c +++ b/webfinger.c | |||
| @@ -48,8 +48,10 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us | |||
| 48 | 48 | ||
| 49 | xs *obj = NULL; | 49 | xs *obj = NULL; |
| 50 | 50 | ||
| 51 | xs *cached_qs = xs_fmt("webfinger:%s", qs); | ||
| 52 | |||
| 51 | /* is it cached? */ | 53 | /* is it cached? */ |
| 52 | if (valid_status(status = object_get(qs, &obj))) { | 54 | if (valid_status(status = object_get(cached_qs, &obj))) { |
| 53 | /* nothing more to do */ | 55 | /* nothing more to do */ |
| 54 | } | 56 | } |
| 55 | else | 57 | else |
| @@ -77,7 +79,7 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us | |||
| 77 | 79 | ||
| 78 | if (obj == NULL && valid_status(status) && payload) { | 80 | if (obj == NULL && valid_status(status) && payload) { |
| 79 | obj = xs_json_loads(payload); | 81 | obj = xs_json_loads(payload); |
| 80 | object_add(qs, obj); | 82 | object_add(cached_qs, obj); |
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | if (obj) { | 85 | if (obj) { |