More blobs.get. Finally replicated again to manyverse.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4102 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		@@ -36,18 +36,23 @@ static void _tf_ssb_rpc_blobs_get(tf_ssb_connection_t* connection, uint8_t flags
 | 
			
		||||
	for (int i = 0; i < length; i++)
 | 
			
		||||
	{
 | 
			
		||||
		JSValue arg = JS_GetPropertyUint32(context, ids, i);
 | 
			
		||||
		if (!JS_IsString(arg))
 | 
			
		||||
		const char* id = NULL;
 | 
			
		||||
		if (JS_IsString(arg))
 | 
			
		||||
		{
 | 
			
		||||
			id = JS_ToCString(context, arg);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			JSValue key = JS_GetPropertyStr(context, arg, "key");
 | 
			
		||||
			JS_FreeValue(context, arg);
 | 
			
		||||
			arg = key;
 | 
			
		||||
			id = JS_ToCString(context, key);
 | 
			
		||||
			JS_FreeValue(context, key);
 | 
			
		||||
		}
 | 
			
		||||
		const char* id = JS_ToCString(context, arg);
 | 
			
		||||
		uint8_t* blob = NULL;
 | 
			
		||||
		size_t size = 0;
 | 
			
		||||
		const int k_send_max = 4096;
 | 
			
		||||
		const int k_send_max = 8192;
 | 
			
		||||
		if (tf_ssb_db_blob_get(ssb, id, &blob, &size))
 | 
			
		||||
		{
 | 
			
		||||
			printf("sending %s (%zd)\n", id, size);
 | 
			
		||||
			for (size_t offset = 0; offset < size; offset += k_send_max)
 | 
			
		||||
			{
 | 
			
		||||
				tf_ssb_connection_rpc_send(
 | 
			
		||||
@@ -69,7 +74,7 @@ static void _tf_ssb_rpc_blobs_get(tf_ssb_connection_t* connection, uint8_t flags
 | 
			
		||||
	JS_FreeValue(context, ids);
 | 
			
		||||
	tf_ssb_connection_rpc_send(
 | 
			
		||||
		connection,
 | 
			
		||||
		k_ssb_rpc_flag_json | k_ssb_rpc_flag_end_error,
 | 
			
		||||
		k_ssb_rpc_flag_json | k_ssb_rpc_flag_end_error | k_ssb_rpc_flag_stream,
 | 
			
		||||
		-request_number,
 | 
			
		||||
		(const uint8_t*)(success ? "true" : "false"),
 | 
			
		||||
		strlen(success ? "true" : "false"),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user