Commit Graph
18 Commits
Author SHA1 Message Date
Karl Seguin decedca6e7 chore: Network cleanup
Network has accumulated a bit of bagged. It knows a lot about certificates, it
knows a lot of the cache. I have plans to expand Network, and wanted to clean it
up.

1 - certificate logic moved to dedicated Certificates.zig
2 - Removed CurlDebugAllocator
    - this makes setup easier, to Updater can just init libcurl directly
3 - Change Updater to be a single function
4 - Cache initialization is don in the Cache
5 - ?Cache => Cache{.kind = .noop}
2026-08-22 07:04:58 +08:00
Karl Seguin fd2e6a8512 refactor: rework how httpclient headers work
Adding headers to an HTTP request was a bit awkward due to my desire to avoid
having an intermediate representation (e.g. an ArrayList(Header)). Going
straight to a curl slist avoids double-copying the headers (first to Zig, then
to curl).

But the CORS work (https://github.com/lightpanda-io/browser/pull/3002) showcases
that this micro-optimization simply isn't worth it, since it needs that
intermediate representation anyways.

And, this change isn't just for CORS. Headers have been a silly pain in the past
like unclear ownership, and messy APIs used in _a lot_ of places (WebBotAuth,
WebSocket, Fetch, ...)

This new approach stores headers on the transfer in an ArrayList. The API is:

```
const transfer = try client.newRequest(.{...}, owner);
{
    errdefer transfer.deinit();
    try transfer.addHeader("Over", "9000", .{});
}
try transfer.submit();
```

This:
1 - Eliminates ambiguity about errdefer cleanup responsibility
2 - Eliminates a bunch of stringZ concat that Frame, Config, CDP were doing
3 - Transfer.arena is now available for headers
2026-08-03 18:26:32 +08:00
Karl Seguin a67fe9f90a chore: remove unused imports 2026-07-28 09:39:02 +08:00
Halil Durak f18d958135 Network: rework how CA stores are created 2026-07-22 18:29:32 +03:00
Halil Durak 1429202de3 update createX509Store in all call sites 2026-07-22 18:29:30 +03:00
Halil Durak 73558b380e Updater.inform: fix broken function signature 2026-07-08 13:07:37 +03:00
Halil Durak 9488a74b50 Updater.inform: always receive information from remote 2026-07-08 13:06:58 +03:00
Halil Durak 847c28657d Updater.inform: flush no matter the result 2026-07-08 13:06:12 +03:00
Halil Durak 78aa2a12aa Updater: remove arena, stream received bytes directly to stdout 2026-07-08 13:00:31 +03:00
Halil Durak 7a4e21cc82 Updater: gracefully handle known status codes 2026-07-08 13:00:31 +03:00
Halil Durak 3b73a5e0e7 Updater: free X509_STORE in deinitializer 2026-07-08 13:00:31 +03:00
Halil Durak affd1c279a Updater: refactor Updator for new version check endpoint 2026-07-08 13:00:30 +03:00
Halil Durak 94239e123b Updater: finalize inform 2026-07-08 13:00:29 +03:00
Halil Durak 4c62337cfa Updater: prefer JSON structures specific to update channel 2026-07-08 13:00:29 +03:00
Halil Durak 6acb58eff4 Updater: continue on implementing Updater.inform 2026-07-08 13:00:28 +03:00
Halil Durak bbd53e4d83 Updater: prefer arbitrary JSON union for parsing versions.json 2026-07-08 13:00:28 +03:00
Halil Durak 7bea3319e8 Updater: update versions.json URL 2026-07-08 13:00:28 +03:00
Halil Durak a716279e30 Updater: introduce Updater
Updater is a simple interface that does web requests for version comparison without needing `App` instance.
2026-07-08 13:00:27 +03:00