Commit Graph

376 Commits

Author SHA1 Message Date
Patricio Whittingslow 98f104f67c remove backoff from form parsing 2026-07-27 18:10:22 -03:00
Patricio Whittingslow 659e7c7ba9 expose rawsock as experimental package (will use for external benchmarks) 2026-07-27 17:45:43 -03:00
Patricio Whittingslow ccb2762fc2 run go fix 2026-07-27 12:28:52 -03:00
Patricio Whittingslow a97959739e fix examples 2026-07-27 12:24:57 -03:00
Patricio Whittingslow 0d1f50fc48 fix tests after excplicit header alloc change 2026-07-27 12:22:20 -03:00
Patricio Whittingslow 0e2f487e9f explicit header key/value alloc and add ExchangeConfig 2026-07-27 11:51:02 -03:00
Patricio Whittingslow 75d2c0c46d add a pattern argument to Mux 2026-07-26 22:55:50 -03:00
Patricio Whittingslow e46e45238d apply go fix 2026-07-26 22:12:57 -03:00
Patricio Whittingslow 33ed289d30 simplify clanker slop 2026-07-26 22:08:57 -03:00
Patricio Whittingslow ebfd80c80c ai insists with backoffs 2026-07-26 21:29:02 -03:00
Patricio Whittingslow 0b6a71efa8 add Exchange.ReadMultiparts reimagining of clanker slop 2026-07-26 20:19:46 -03:00
Patricio Whittingslow 0c1a51150d begin adding readMultiPart 2026-07-26 18:04:34 -03:00
Patricio Whittingslow 4f1a178f29 first Multipart approach 2026-07-26 17:22:09 -03:00
Patricio Whittingslow dd7c4bb037 remove status type 2026-07-26 13:57:18 -03:00
Patricio Whittingslow cc7ecc0c19 finish rounding up multipart form parsing 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 4976cdf38e begin adding multipart form logic 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 92cf46e570 add streaming API distinct from Exchange 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 6d88506541 add raw buffer access 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 229acd3e68 fail on incomplete staging 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 69640a6235 minor doc nit 2026-07-26 13:57:18 -03:00
Patricio Whittingslow b79e58b812 add MethodFrom 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 10932ebf34 rework Mux interface to receive a string request path 2026-07-26 13:57:18 -03:00
Patricio Whittingslow c19fd2093c run go fix 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 5937070cc5 Router.Handle returns error after being torn down 2026-07-26 13:57:18 -03:00
Patricio Whittingslow dab5095a49 massive documentation push and code reordering in files 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 9faa0c2722 remove ForEach pattern, allocates in TinyGo 2026-07-26 13:57:18 -03:00
Patricio Whittingslow d83da243a0 add query handling 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 99f848f93f add benchmarks 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 6e332e7833 small nit 2026-07-26 13:57:18 -03:00
Patricio Whittingslow a7f598f975 several bugfixes, add internal.IntLen, round up http-linux example with new router API 2026-07-26 13:57:18 -03:00
Patricio Whittingslow d4666630f7 improve locking and acquisition of Exchanges in reconfiguring 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 962f6864be add Hijacker-like functionality 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 5b83b18da0 more tests, run go generate 2026-07-26 13:57:18 -03:00
Patricio Whittingslow e0dd19416c add low level Handle function and more tests 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 9397caf144 claude found neat bugs 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 0fd0ad8cbf begin adding httphi tests 2026-07-26 13:57:18 -03:00
Patricio Whittingslow 6e7cd94040 add http/httphi 2026-07-26 13:57:18 -03:00
Pat Whittingslow a3f2742abf DHCPv4+Debug (#170)
* DHCPv4+Debug: add RawData method and improve Logging semantics with configured logger instead of default

* add xnet.LogAllocs
2026-07-26 13:55:48 -03:00
Marvin 马维 Drees 8873b55e5d feat(tcp): add RFC 6298 RTO as a LossRecovery implementation (#169)
Provide a concrete packet-loss recovery algorithm for the LossRecovery
interface added in #168: the RFC 6298 round-trip-time estimator and single
retransmission timer.

RTO is a pure, reactive state machine. It derives RTT estimates and
retransmission decisions solely from the segments observed through the
LossRecovery hooks and the monotonic time handed in at each boundary, so it
holds no clock and allocates nothing (issue #140). It tracks a shadow of the
send sequence space (snd.UNA/snd.NXT) purely from observed segments, which is
how it manages the timer without reaching into the ControlBlock and how it
distinguishes retransmissions for Karn's algorithm.

Covered:
  - §2.2/§2.3 SRTT/RTTVAR/RTO smoothing (integer-shift form)
  - §3 Karn's algorithm: one sample in flight, never sample a retransmit
  - §5.1-§5.3 timer arm/restart/stop as data is sent and acknowledged
  - §5.4-§5.6 timeout response: exponential backoff + go-back-N retransmit
  - §5.7 backoff collapse on a valid RTT sample
  - RTO clamped to [rtoMin, rtoMax]

RTT introspection (SmoothedRTT, CurrentRTO, Running) lives on the concrete type,
not the interface, per the LossRecovery design. Install with new(RTO) on
ConnConfig.LossRecovery; the connection calls Reset on open so the zero value is
ready to use.

Generated with LLM assistance.

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
2026-07-22 13:44:31 -03:00
Pat Whittingslow 41c7e3c445 add loss.go (#168) 2026-07-22 13:09:12 -03:00
Pat Whittingslow 1bbfd5eac3 @MDr164 trick to ignore no-extension files (#162)
* @MDr164 trick to ignore no-extension files

* catch changes to LICENSE
2026-07-21 16:14:53 -03:00
Pat Whittingslow 1a474154cb more httpraw bug fixes (#160)
* more httpraw bug fixes

* add http-linux example and add httpraw.Header.SetInt

* finish http-linux example

* fix CI vet
2026-07-19 11:09:09 -03:00
Patricio Whittingslow 347cef9ba5 README: update binary benchmark table v0.2.1 2026-07-17 12:03:28 -03:00
Pat Whittingslow 157a8537a2 testing.B.Loop() standardization and StackAsync.Debug improvement (#156)
* testing.B.Loop() standardization and StackAsync.Debug heap debugging improvement

* apply @MDr164 fixes

* @MDr164 great suggestions to prevent panic and print correct mallocs
2026-07-17 11:59:27 -03:00
Pat Whittingslow 766e03e90e httpraw: fix overrwrite/empty val bugs in Header.Set/SetBytes (#159) 2026-07-17 11:07:59 -03:00
Marvin Drees ab1a0c735a Add out-of-order segment reassembly (#148)
* feat(tcp): add out-of-order segment reassembly

Add an opt-in, bounded out-of-order reassembly buffer so a single lost
segment can be recovered by retransmitting the gap while later segments
are held and delivered once the gap fills.

The receiver also subtracts buffered out-of-order bytes from the
advertised receive window and avoids challenge-ACK aborts for in-window
future data. Reassembly is disabled by default.

Generated with LLM assistance.

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>

* implement review feedback around rx buffer reuse

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>

---------

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
2026-07-10 10:36:15 -03:00
Marvin Drees 3c1f0e0281 Handle IA_NA/IA_PD requests and config options in DHCPv6 (#147)
* feat(dhcpv6): handle IA_NA/IA_PD requests and config options

Adds the DHCPv6 client request exchange with IA_NA/IA_PD handling,
reconfigure-renew (RFC 8415), DNS server and domain search options
(RFC 3646) and NTP server suboptions (RFC 5908).

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>

* fix(dhcpv6): bound server-supplied option counts to prevent OOM

A DHCPv6 server may place arbitrarily many DNS servers, search domains,
NTP entries and delegated prefixes in a single message (RFC 8415). The
client appended every entry into growable slices with no upper bound, so
a malicious or misconfigured server could drive unbounded allocation.

Add a configurable Limits to RequestConfig (with safe defaults) capping
each repeated option. The backing arrays are sized to their caps once in
BeginRequest and reused across resets, so parsing a server message now
performs no allocation and stored entries stay bounded.

Add tests asserting the caps are enforced against a flooded Reply and that
option parsing is allocation-free after BeginRequest.

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>

---------

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
2026-07-09 14:12:30 -03:00
Pat Whittingslow 99e9d90a60 Netdev revamp (#145)
* begin working on netdev solution

* need to roll back some assumptions in next commit

* dual poll/async mode for netdev.Runner

* add wake on rx semantics

* remove TODO

* more reworking of Runner

* work on applying @MDr164 suggestions and a couple extra revamps

* add newline to end of test file
2026-07-09 14:04:10 -03:00
Marvin Drees 4fc53a84cd fix: make github action comment work right (#153)
It was previously just commenting the file name instead of the content,
this change attempts to fix it using json instead of the raw file

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
2026-07-09 14:01:53 -03:00
Marvin Drees 104a2b0b26 feat(ci): add benchci for better visualization (#149)
This adds a small in-repo tool and updates the ci.yml file in order
to make benchmark and most importantly allocation results visible in a
PR. It also drops the 3rdparty action we had commented out.

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
2026-07-02 20:21:49 -03:00