Public Access
S1 #11: bytes read and written, counted per network service
A Counted<> wrapper around the network clients adds what goes through their buffer read and write to a per-service counter (IRC, Gemini, Debug Console, Updates); the single-byte calls and print() end up there, so each byte counts once. `net` prints the totals. For TLS it's the plain text the service sees. Checked on the device: a Gemini fetch counts 164,986 in (a 164,970-byte page and its 16-byte header) and 42 out (the URL and CRLF). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "gemtext.h"
|
||||
#include "platform/console.h"
|
||||
#include "sha256.h"
|
||||
#include "platform/counted_client.h"
|
||||
#include "storage_paths.h"
|
||||
|
||||
namespace roro {
|
||||
@@ -544,7 +545,7 @@ void GeminiService::fetchOne(const std::string& url, GeminiPage& page, bool load
|
||||
auto track = [this]() { lowest_ = std::min<size_t>(lowest_, esp_get_free_heap_size()); };
|
||||
|
||||
size_t freeBefore = esp_get_free_heap_size(); // what's left once the connection closes again
|
||||
NetworkClientSecure tls;
|
||||
Counted<NetworkClientSecure> tls(net::User::Gemini);
|
||||
tls.setInsecure(); // trust on first use: the pinned fingerprint is what counts (Q71)
|
||||
tls.setTimeout(15);
|
||||
if (!tls.connect(u.host.c_str(), u.portOrDefault())) {
|
||||
|
||||
Reference in New Issue
Block a user