From 0d202a866a14e17e596ee70b064f8963142d486d Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 27 Mar 2025 21:34:15 +0200 Subject: [PATCH] update ggemini api --- .../window/tab/item/client/driver/gemini.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/browser/window/tab/item/client/driver/gemini.rs b/src/app/browser/window/tab/item/client/driver/gemini.rs index c160f5e6..16876780 100644 --- a/src/app/browser/window/tab/item/client/driver/gemini.rs +++ b/src/app/browser/window/tab/item/client/driver/gemini.rs @@ -295,10 +295,11 @@ fn handle( connection.stream(), Priority::DEFAULT, cancellable.clone(), - ( - 0x400, // 1024 chunk - 0xfffff, // 1M limit - ), + memory_input_stream::Size { + chunk: 0x400, // 1024 bytes chunk + limit: 0xfffff, // 1M limit + total: 0, // initial totals + }, ( |_, _| {}, // on chunk (maybe nothing to count yet @TODO) move |result| match result { // on complete @@ -398,10 +399,11 @@ fn handle( connection.stream(), Priority::DEFAULT, cancellable.clone(), - ( - 0x400, // 1024 bytes per chunk, optional step for images download tracking - 0xA00000 // 10M bytes max to prevent memory overflow if server play with promises - ), + memory_input_stream::Size { + chunk: 0x400, // 1024 bytes chunk + limit: 0xA00000, // 10M limit + total: 0, // initial totals + }, ( move |_, total| status.set_description(Some(&format!("Download: {total} bytes"))), {