Skip to content

[merge] v0.5.0 from phase-5 - #7

Merged
gavinhsmith merged 1 commit into
mainfrom
phase-5
Sep 24, 2026
Merged

gavinhsmith merged 1 commit into
mainfrom
phase-5

Conversation

@gavinhsmith

Copy link
Copy Markdown
Owner

Moves tinclib to protocol v0.5: request bodies, more methods and response headers.

  • Pins tinclib-protocol v0.5 (8e25875). Upstream has no v0.5.0 tag yet, though its CHANGELOG says releases are tagged vMAJOR.MINOR.0.
  • Version 0.5.0.
  • Methods: GET, POST, PUT, PATCH, DELETE and HEAD. TINC_ERR_UNSUPPORTED_METHOD is now only for values outside tinc_method_t.
  • Uploads: tinc_poll() streams the body with BODY_WRITE straight from the app's pointer, as much as the board takes per write. As the protocol intends, these writes are also the connect poll, so there's no REQ_STATUS until the upload is done.
    • New state TINC_SENDING once the board starts taking bytes. An https upload shows TINC_CONNECTING, never TINC_SECURING.
    • RESPONDED (the server answered early, e.g. 413) stops the upload, and the response is read as usual.
  • Headers: new tinc_header(name, out, cap) over HDR_GET. It pages through long values and returns the full length, or -1. The reply lands in the shared frame buffer, so a pending body chunk is fetched again (the same offset re-delivers it): one extra round trip mid-body.
  • C++: tinc::header, the new methods and State::Sending.
  • Tests: a golden POST checked byte for byte against the protocol's vectors, a slow upload, an early 413, every method, and header paging with the body intact afterwards. The fake board handles BODY_WRITE and HDR_GET.
  • Size: size-check min 4,047 / full 9,791 bytes (the full example now uses POST and tinc_header). size_cpp is 9,844 bytes.

Not used: INFO (display only, TINCLIBC's job), HDR_GET's index (always 0) and TRUNC flag, and upload progress beyond TINC_SENDING.

Not yet run against a board: it needs firmware on protocol 0.5.

- Pin tinclib-protocol v0.5 (8e25875); version 0.5.0
- POST/PUT/PATCH/DELETE/HEAD; the body is streamed by BODY_WRITE from
  the app's pointer, and the write loop is the connect poll
- New TINC_SENDING state; RESPONDED ends the upload early
- tinc_header() over HDR_GET, paging long values and re-fetching a
  pending body chunk; tinc::header and the new enums in tinclib.hpp
- Fake board handles BODY_WRITE and HDR_GET; golden POST test, upload,
  early-response, method and header tests
- README, AGENTS.md and the size example updated
@gavinhsmith
gavinhsmith merged commit bdbedbe into main Sep 24, 2026
4 checks passed
@gavinhsmith
gavinhsmith deleted the phase-5 branch September 24, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant