ssb: Pub blobs in the idle queue, too. I'm confused why things aren't moving like I'd expect. This seems more fair.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 31m10s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 31m10s
This commit is contained in:
parent
3671051d0e
commit
862d172ca8
@ -671,6 +671,22 @@ static void _tf_ssb_rpc_connection_blobs_create_wants_after_work(tf_ssb_connecti
|
||||
tf_free(work);
|
||||
}
|
||||
|
||||
typedef struct _blob_get_t
|
||||
{
|
||||
char id[k_blob_id_len];
|
||||
size_t size;
|
||||
} blob_get_t;
|
||||
|
||||
static void _tf_ssb_rpc_connection_blobs_get_idle(tf_ssb_connection_t* connection, bool skip, void* user_data)
|
||||
{
|
||||
blob_get_t* get = user_data;
|
||||
if (!skip)
|
||||
{
|
||||
_tf_ssb_rpc_connection_blobs_get(connection, get->id, get->size);
|
||||
}
|
||||
tf_free(get);
|
||||
}
|
||||
|
||||
static void _tf_ssb_rpc_connection_blobs_createWants_callback(
|
||||
tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue args, const uint8_t* message, size_t size, void* user_data)
|
||||
{
|
||||
@ -725,7 +741,10 @@ static void _tf_ssb_rpc_connection_blobs_createWants_callback(
|
||||
}
|
||||
else
|
||||
{
|
||||
_tf_ssb_rpc_connection_blobs_get(connection, blob_id, size);
|
||||
blob_get_t* get = tf_malloc(sizeof(blob_get_t));
|
||||
*get = (blob_get_t) { .size = size };
|
||||
snprintf(get->id, sizeof(get->id), "%s", blob_id);
|
||||
tf_ssb_connection_schedule_idle(connection, blob_id, _tf_ssb_rpc_connection_blobs_get_idle, get);
|
||||
}
|
||||
JS_FreeCString(context, blob_id);
|
||||
JS_FreeValue(context, key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user