ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
file_serving.cpp File Reference

Filesystem-backed static file serving for PC (GET/HEAD of an fs::FS path). More...

#include "network_drivers/transport/tcp.h"
#include "protocore.h"
#include "server/http_range.h"
#include "server/protocore_internal.h"
#include "shared_primitives/mime.h"
#include "shared_primitives/strbuf.h"
#include "shared_primitives/time_compat.h"
#include <stdio.h>
#include <string.h>
#include <time.h>

Go to the source code of this file.

Detailed Description

Filesystem-backed static file serving for PC (GET/HEAD of an fs::FS path).

Split out of protocore.cpp (single-purpose server files). Covers the conditional-GET validators (ETag / Last-Modified / If-None-Match / If-Modified-Since), byte-range requests (RFC 7233), pre-compressed .gz variants, and the cross-loop file-send pump that pages a large body out without truncating or blocking the worker. The shared RFC 1123 date helper (http_rfc1123) lives here because WEBDAV requires FILE_SERVING, so this TU is its single always-present home. Behavior is identical to the pre-split code - a pure move.

Definition in file file_serving.cpp.