MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / serialize_response

Function serialize_response

app/server/http.cpp:222–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220 request.path != kLiveSpeechPath) {
221 return false;
222 }
223 const auto it = request.headers.find("transfer-encoding");
224 if (it == request.headers.end()) {
225 return false;
226 }
227 return is_chunked_only(it->second);
228}
229
230// De-frames an HTTP/1.1 chunked request body off a live socket into a byte
231// stream. `underflow()` blocks in recv() waiting for the next chunk, which is
232// precisely the contract `AudioChunkReader` documents for a live source — so a
233// streaming task can pull capture-time audio straight through it without the
234// body ever being fully materialized.
235//
236// Bounded on four axes, because this stream is read while a model lock is held:
237// an idle timeout between reads, an absolute deadline for the whole body, a cap on
238// total bytes, and a cap on any single chunk. A client that opens a body and then

Callers 1

handle_clientFunction · 0.85

Calls 3

status_textFunction · 0.85
strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected