Make http.auth_query async and get its DB work off the main thread.

This commit is contained in:
2024-06-10 20:22:28 -04:00
parent c5140ee8e8
commit 58bb86ebe1
5 changed files with 67 additions and 40 deletions

View File

@ -280,8 +280,7 @@ static JSValue _tf_ssb_getIdentities(JSContext* context, JSValueConst this_val,
size_t user_length = 0;
const char* user = JS_ToCStringLen(context, &user_length, argv[0]);
identities_visit_t* work = tf_malloc(sizeof(identities_visit_t) + user_length + 1);
*work = (identities_visit_t)
{
*work = (identities_visit_t) {
.context = context,
};
memcpy(work->user, user, user_length + 1);
@ -331,8 +330,7 @@ static JSValue _tf_ssb_getAllIdentities(JSContext* context, JSValueConst this_va
if (ssb)
{
identities_visit_t* work = tf_malloc(sizeof(identities_visit_t));
*work = (identities_visit_t)
{
*work = (identities_visit_t) {
.context = context,
};