284 Commits

Author SHA1 Message Date
Andrew Kelley
ac8f757cb3 Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering 2025-07-14 23:49:34 -07:00
Andrew Kelley
9a1f4cb011 std.net: update to new I/O API 2025-07-14 00:16:49 -07:00
Andrew Kelley
6e6c68d889 Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering 2025-07-10 16:11:10 -07:00
Andrew Kelley
bc2cf0c173 eliminate all uses of std.io.Writer.count except for CBE 2025-07-09 09:32:07 -07:00
Andrew Kelley
5378fdb153 std.fmt: fully remove format string from format methods
Introduces `std.fmt.alt` which is a helper for calling alternate format
methods besides one named "format".
2025-07-07 22:43:53 -07:00
Andrew Kelley
0e37ff0d59 std.fmt: breaking API changes
added adapter to AnyWriter and GenericWriter to help bridge the gap
between old and new API

make std.testing.expectFmt work at compile-time

std.fmt no longer has a dependency on std.unicode. Formatted printing
was never properly unicode-aware. Now it no longer pretends to be.

Breakage/deprecations:
* std.fs.File.reader -> std.fs.File.deprecatedReader
* std.fs.File.writer -> std.fs.File.deprecatedWriter
* std.io.GenericReader -> std.io.Reader
* std.io.GenericWriter -> std.io.Writer
* std.io.AnyReader -> std.io.Reader
* std.io.AnyWriter -> std.io.Writer
* std.fmt.format -> std.fmt.deprecatedFormat
* std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape
* std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape
* std.fmt.fmtSliceHexLower -> {x}
* std.fmt.fmtSliceHexUpper -> {X}
* std.fmt.fmtIntSizeDec -> {B}
* std.fmt.fmtIntSizeBin -> {Bi}
* std.fmt.fmtDuration -> {D}
* std.fmt.fmtDurationSigned -> {D}
* {} -> {f} when there is a format method
* format method signature
  - anytype -> *std.io.Writer
  - inferred error set -> error{WriteFailed}
  - options -> (deleted)
* std.fmt.Formatted
  - now takes context type explicitly
  - no fmt string
2025-07-07 22:43:51 -07:00
Andrew Kelley
9f27d770a1 std.io: deprecated Reader/Writer; introduce new API 2025-07-07 22:43:51 -07:00
Andrew Kelley
9f8486170c std.http compiling again 2025-07-01 16:35:30 -07:00
Andrew Kelley
d4545f216a std.io: start removing context from Reader/Writer
rely on the field parent pointer pattern
2025-07-01 16:35:30 -07:00
Andrew Kelley
837f2bfc69 hello world compiling again 2025-07-01 16:35:30 -07:00
Andrew Kelley
af24e722fb update some stuff to std.io API 2025-07-01 16:35:29 -07:00
Andrew Kelley
1e2aab2f97 std: combine BufferedWriter into Writer 2025-07-01 16:35:29 -07:00
Andrew Kelley
3c98e2c826 std: combine BufferedReader into Reader 2025-07-01 16:35:29 -07:00
Andrew Kelley
3650cd3e8e std.fs.File: update for new writeFile API 2025-07-01 16:35:29 -07:00
Andrew Kelley
74c56376ee std: update http.WebSocket to new API 2025-07-01 16:35:29 -07:00
Andrew Kelley
af4bb996f0 std.http.Client: fix redirects 2025-07-01 16:35:29 -07:00
Andrew Kelley
b3df9d4bf9 std.http.Client: sendBody flush by default; fix flushing
flushing must also flush TLS client if it exists
2025-07-01 16:35:28 -07:00
Andrew Kelley
d0b8392852 std.http fixes 2025-07-01 16:35:28 -07:00
Andrew Kelley
b78e375a2d std.http.Server: flush by default with respond 2025-07-01 16:35:28 -07:00
Andrew Kelley
2abbcb6d2a std.http: fix chunked transfer flushing and end-of-stream handling 2025-07-01 16:35:28 -07:00
Andrew Kelley
d9aa84de28 std.http.Client: fix alignment when freeing memory 2025-07-01 16:35:28 -07:00
Andrew Kelley
e4126aa213 std.http.Server: remove the 25 header limit
no longer makes sense when there is an output buffer
2025-07-01 16:35:28 -07:00
Andrew Kelley
4716c00366 std.http.Server: don't try to discard nonexistent body 2025-07-01 16:35:28 -07:00
Andrew Kelley
9ed20386bb std.http.Reader: simplify states 2025-07-01 16:35:28 -07:00
Andrew Kelley
bb7af21d6f std.crypto.tls.Client: update to new reader/writer API 2025-07-01 16:35:28 -07:00
Andrew Kelley
25ac70f973 std: WIP update more to new reader/writer
delete some bad readers/writers

add limited reader

update TLS

about to do something drastic to compress
2025-07-01 16:35:28 -07:00
Andrew Kelley
c7040171fb std.http: mostly finish the rewrite 2025-07-01 16:35:28 -07:00
Andrew Kelley
d8cea03245 std.http: more update 2025-07-01 16:35:28 -07:00
Andrew Kelley
ab3a947bef get build runner compiling again 2025-07-01 16:35:28 -07:00
Andrew Kelley
81b0d14e2b std.http: rewrite
WIP
2025-07-01 16:35:28 -07:00
Andrew Kelley
396464ee6b update std.net and nail down delimiter APIs
"exclusive" functions still need to report EndOfStream after the last
returned slice
2025-07-01 16:35:28 -07:00
Andrew Kelley
1bb75f9d62 stabilize readRemainingArrayList and readRemainingAlloc API 2025-07-01 16:35:28 -07:00
Andrew Kelley
d9b9e3c272 std: update some http to new reader/writer 2025-07-01 16:35:28 -07:00
Andrew Kelley
19b82ca7ab std.http.Server: implement chunked request parsing 2025-07-01 16:35:27 -07:00
Jacob Young
6a0f2227e8 build_runner: port to std.io.BufferedReader API changes 2025-07-01 16:35:27 -07:00
Andrew Kelley
7b0d826849 std.http.Server: fix BufferedReader API usage 2025-07-01 16:35:27 -07:00
Andrew Kelley
9fe0ce377c std.http.Server: update end methods 2025-07-01 16:35:27 -07:00
Andrew Kelley
f333267782 update std.http.Server to new API
and rename std.io.BufferedWriter.writableSlice to writableSliceGreedy

and make writableSlice and writableArray advance the buffer end position

introduce std.io.BufferedWriter.writeSplatLimit but it's unimplemented
2025-07-01 16:35:27 -07:00
Andrew Kelley
98f463ad59 revert introduction of @errorCast in this branch 2025-07-01 16:35:27 -07:00
Jacob Young
ffb0e283d7 build_runner: fix compile errors 2025-07-01 16:35:27 -07:00
Andrew Kelley
a4fdda6ae0 std.io: redo Reader and Writer yet again
explicit error sets ahoy matey

delete some sus APIs from File that need to be reworked
2025-07-01 16:35:27 -07:00
Andrew Kelley
20a784f713 std: start converting networking stuff to new reader/writer 2025-07-01 16:35:27 -07:00
Jacob Young
a21e7ab64f build_runner: port to new std.io.BufferedWriter API 2025-07-01 16:35:26 -07:00
Andrew Kelley
646454beb5 maybe it's better to track bytes written in BufferedWriter 2025-07-01 16:35:26 -07:00
Andrew Kelley
57e1fc29d2 reader interface vecs and bufferedwriter arraylist 2025-07-01 16:35:26 -07:00
Andrew Kelley
4aed226e07 zig fmt compiling 2025-07-01 16:35:26 -07:00
Andrew Kelley
5ada2e3937 std.http tests passing with updated writer API
fix splat implementation in std.fs.File

update http.Client, with caveats:
 * TODO: only 1 underlying write call
 * TODO: don't rely on max_buffers_len exceeding the caller
 * TODO: handle splat

update net.Stream API. also make it use WSASend on windows
2025-07-01 16:35:26 -07:00
Andrew Kelley
716b4489be update more of the std lib to new API 2025-07-01 16:35:26 -07:00
Andrew Kelley
fced9467e8 std ArrayList unit tests passing 2025-07-01 16:35:26 -07:00
Jacob Young
1f6f8b0ffe x86_64: implement integer @reduce(.Add) 2025-05-28 15:10:22 -04:00