Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .agents/docs/2026-12-04-bump-tinyhttps-0.3.7-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Design doc: bump `mcpplibs.tinyhttps` to 0.3.7

Date: 2026-12-04

This follows the 0.3.6 bump (mcpplibs/mcpp-index#936). Upstream published `0.3.7`
([#29](https://github.com/mcpplibs/tinyhttps/pull/29), which closes
[#28](https://github.com/mcpplibs/tinyhttps/issues/28)). This change adds `0.3.7` to
`pkgs/t/tinyhttps.lua` on the three platforms and moves the consumer to it. gitany needs this
release: its stalled reads (`kal_stream_read`) were the defect that #28 describes, and its streamed
upload is built on `BodySource`.

## Source and versions

| | `0.3.7` |
|---|---|
| Upstream | `https://github.com/mcpplibs/tinyhttps` |
| Tag | `0.3.7` (annotated, commit `7d2be50`) |
| Tarball | `archive/refs/tags/0.3.7.tar.gz` |
| sha256 (downloaded twice, and the mirror's copy downloaded twice) | `b8585bc7e94f85acff0f55e30b22680f152489f622b3db270aba71fd468c9f0f` |
| Wrap directory | `tinyhttps-0.3.7/` (the `archive/refs/tags` form, as in every earlier entry) |
| CN mirror | `https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.7/tinyhttps-0.3.7.tar.gz`, the same tarball |
| License | Apache-2.0 (unchanged) |

## What changed upstream

- `readTimeoutMs` bounds every `recv` and `send`, including the `recv` that completes a TLS record.
Before this, a peer that stopped inside a record held a request indefinitely: with
`readTimeoutMs = 5000` a request was still waiting after 40 s. `Socket::set_idle_timeout`,
`wait_before_send` and `SO_SNDTIMEO` carry the bound, and `write_all` now bounds the time without
progress instead of the whole write.
- `BodySource` is a size plus a reader by offset, and `HttpRequest::bodySource` streams a request body
with `Content-Length`. `BodySource::file(path)` reads a file. A request that sets both `body` and
`bodySource` is refused before anything is sent.

This is a patch release: a dependency written as `tinyhttps = "^0.3.1"` resolves to it. The module
interface is `mcpplibs.tinyhttps`, as before (Form A, the tarball's own `mcpp.toml`).

## Descriptor and workspace changes

- `pkgs/t/tinyhttps.lua`: `["0.3.7"]` is added to `xpm.linux`, `xpm.macosx` and `xpm.windows`
(GLOBAL and CN, one sha256). Every earlier entry is unchanged.
- `tests/examples/tinyhttps/mcpp.toml`: `mcpplibs.tinyhttps = "0.3.7"`.
- `tests/examples/tinyhttps/tests/api.cpp`: a 0.3.7 check that needs no network. It sends a request
with both bodies and expects the refusal, expects `BodySource::file` on a missing path to be empty,
and expects a fresh socket's idle flag to be unset.

## Verification

- `mcpp xpkg parse pkgs/t/tinyhttps.lua` succeeds and shows `0.3.7` on the three platforms.
- The GitHub archive was downloaded twice; the mirror asset, uploaded with gitany and checked with
`mirror --verify`, was downloaded back twice. All four copies have the sha256 above.
- Upstream CI for the release commit (mcpplibs/tinyhttps#29) passed 10 of 10 jobs: gcc and llvm on
Linux, macOS, and Windows (msvc and llvm), plus the OpenKal images.
- `tests/examples/tinyhttps`: `mcpp test` resolves `0.3.7` from this tree, downloads it, builds it and passes on Linux (gcc 16.1.0); macOS and Windows are this pull request's workspace jobs.

Authorship: ai-and-human
21 changes: 21 additions & 0 deletions pkgs/t/tinyhttps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ package = {
},
sha256 = "a9d72f53a8ad88daff573657fdf3d90e8f0f877866ebbe7878cfd124894950a5",
},
["0.3.7"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.7.tar.gz",
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.7/tinyhttps-0.3.7.tar.gz",
},
sha256 = "b8585bc7e94f85acff0f55e30b22680f152489f622b3db270aba71fd468c9f0f",
},
},
macosx = {
["0.2.1"] = {
Expand Down Expand Up @@ -252,6 +259,13 @@ package = {
},
sha256 = "a9d72f53a8ad88daff573657fdf3d90e8f0f877866ebbe7878cfd124894950a5",
},
["0.3.7"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.7.tar.gz",
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.7/tinyhttps-0.3.7.tar.gz",
},
sha256 = "b8585bc7e94f85acff0f55e30b22680f152489f622b3db270aba71fd468c9f0f",
},
},
windows = {
["0.2.1"] = {
Expand Down Expand Up @@ -373,6 +387,13 @@ package = {
},
sha256 = "a9d72f53a8ad88daff573657fdf3d90e8f0f877866ebbe7878cfd124894950a5",
},
["0.3.7"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.7.tar.gz",
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.7/tinyhttps-0.3.7.tar.gz",
},
sha256 = "b8585bc7e94f85acff0f55e30b22680f152489f622b3db270aba71fd468c9f0f",
},
},
},
}
2 changes: 1 addition & 1 deletion tests/examples/tinyhttps/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ name = "tinyhttps-tests"
version = "0.1.0"

[dependencies]
mcpplibs.tinyhttps = "0.3.6"
mcpplibs.tinyhttps = "0.3.7"
26 changes: 25 additions & 1 deletion tests/examples/tinyhttps/tests/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,26 @@ int main() {
extra.extraCaFile = "/etc/corp/root-ca.pem";
HttpClient withExtra(extra);
bool (TlsSocket::*connectOver)(Socket&&, const char*, bool, int) = &TlsSocket::connect_over;
// 0.3.7: a request body streamed from a source of known length, read by
// offset; one that is set beside `body` is refused before anything is sent,
// so this needs no network either. The idle bound is the socket's own.
BodySource source;
source.size = 3;
source.read = [](std::int64_t offset, std::span<char> out) -> std::int64_t {
const std::string_view bytes = "abc";
const auto n = std::min<std::int64_t>(static_cast<std::int64_t>(bytes.size()) - offset, static_cast<std::int64_t>(out.size()));
std::copy_n(bytes.data() + offset, n, out.data());
return n;
};
HttpRequest both;
both.method = Method::PUT;
both.url = "https://example.invalid/upload";
both.body = "inline";
both.bodySource = source;
const auto refused = client.send(both);
const bool noFile = !BodySource::file("tinyhttps-no-such-file").has_value();
Socket idle;
idle.set_idle_timeout(500);
const bool ok = request.method == Method::POST
&& request.url == "https://example.invalid/data"
&& request.body == "{\"ok\":true}"
Expand All @@ -72,6 +92,10 @@ int main() {
&& extra.extraCaFile == "/etc/corp/root-ca.pem"
&& connectOver != nullptr
&& notStarted // 0.3.6
&& started;
&& started
&& refused.statusCode == 0 // 0.3.7
&& refused.statusText == "A request has a body or a body source, not both"
&& noFile
&& !idle.idle_timeout_hit();
return ok ? 0 : 1;
}
Loading