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:
@@ -17,6 +17,7 @@
|
||||
#include "file_receiver.h"
|
||||
#include "sha256.h"
|
||||
#include "platform/console.h"
|
||||
#include "platform/counted_client.h"
|
||||
#include "sd_fault.h"
|
||||
#include "version.h"
|
||||
|
||||
@@ -110,7 +111,7 @@ void DebugConsole::listen() {
|
||||
listening = false;
|
||||
}
|
||||
if (listening) {
|
||||
NetworkClient client = server.accept();
|
||||
Counted<NetworkClient> client(server.accept(), net::User::DebugConsole);
|
||||
if (client) {
|
||||
client.setNoDelay(true);
|
||||
if (authenticate(client)) serve(client);
|
||||
|
||||
Reference in New Issue
Block a user