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

Function query_param

app/server/runtime.cpp:39–55  ·  view source on GitHub ↗

Minimal application/x-www-form-urlencoded query string lookup, e.g. query_param("model=pocket-tts&foo=bar", "model") -> "pocket-tts".

Source from the content-addressed store, hash-verified

37// configured ceiling"; a value is clamped to that ceiling by resolve_busy_timeout_ms
38// so a client can shorten its own wait but never weaken the guard.
39std::optional<int> parse_busy_timeout_override(const Value & body) {
40 const auto * value = body.find("busy_timeout_ms");
41 if (value == nullptr) {
42 return std::nullopt;
43 }
44 const auto requested = engine::io::json::optional_i32(body, "busy_timeout_ms", 0);
45 if (requested < 0) {
46 throw std::runtime_error("busy_timeout_ms must be >= 0 (0 means no client-side bound)");
47 }
48 return requested;
49}
50
51std::string json_quote(std::string_view value) {
52 return engine::io::json::stringify_string(value);
53}
54
55std::filesystem::path resolve_path(const std::filesystem::path & base, const std::filesystem::path & path) {
56 return path.is_absolute() ? path : base / path;
57}
58

Callers 1

handle_voicesMethod · 0.85

Calls 2

sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected