aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2025-08-07Merge pull request #24698 from ziglang/httpAndrew Kelley
std: rework HTTP and TLS for new I/O API
2025-08-08Fix some libc version checks for BionicTibboddiT
2025-08-07std/zip.zig: perform backslash-to-forward-slash before isBadFilename()Frank Denis
Previously, when extracting a ZIP file, isBadFilename(), which is designed to reject ../ patterns to prevent directory traversal, was called before normalizing backslashes to forward slashes. This allowed path traversal sequences like ..\\..\\..\\etc\\passwd which pass validation but are then converted to ../../../etc/passwd for file extraction.
2025-08-07flate change bit reader Bits to usize (#24719)Igor Anić
Don't see why byte returned from specialPeek needs to be shifted by remaining_needed_bits. I believe that decision in specialPeek should be done on the number of the remaining bits not of the content of that bits. Some test result are changed, but they are now consistent with the original state as found in: https://github.com/ziglang/zig/blame/5f790464b0d5da3c4c1a7252643e7cdd4c4b605e/lib/std/compress/flate/Decompress.zig Changing Bits from usize to u32 or u64 now returns same results. * flate: simplify peekBitsEnding `peekBits` returns at most asked number of bits. Fails with EndOfStream when there are no available bits. If there are less bits available than asked still returns that available bits. Hopefully this change better reflects intention. On first input stream peek error we break the loop.
2025-08-07TLS, HTTP, and package fetching fixesAndrew Kelley
* TLS: add missing assert for output buffer length requirement * TLS: add missing flushes * TLS: add flush implementation * TLS: finish drain implementation * HTTP: correct buffer sizes for TLS * HTTP: expose a getReadError method on Connection * HTTP: add missing flush on sendBodyComplete * Fetch: remove unwanted deinit * Fetch: improve error reporting
2025-08-07std.fs.File.Reader: fix readVec fillAndrew Kelley
respect the case when there is existing buffer
2025-08-07std.http: remove custom method supportAndrew Kelley
let's see if anybody notices it missing
2025-08-07std.http: address review commentsAndrew Kelley
thank you everybody
2025-08-07std.http.Server: add safety for invalidated Head stringsAndrew Kelley
and fix bad unit test API usage that it finds
2025-08-07resinator: a few more updates/fixesRyan Liptak
Just enough to get things working correctly again
2025-08-07resinator: just enough fixes to make it compileAndrew Kelley
2025-08-07std.Io: delete LimitedReaderAndrew Kelley
2025-08-07std.Io: delete BufferedReaderAndrew Kelley
2025-08-07remove std.fifoAndrew Kelley
I never liked how this data structure took its API as a parameter. This use case is now served by std.Io buffering.
2025-08-07std.net: fix windows buildAndrew Kelley
2025-08-07fix 32-bit buildsAndrew Kelley
2025-08-07std.Io.Reader: fix appendRemainingUnlimitedAndrew Kelley
Now it avoids mutating `r` unnecessarily, allowing the `ending` Reader to work.
2025-08-07fetch: update for new http APIAndrew Kelley
it's not quite finished because I need to make it not copy the Resource
2025-08-07update build system to new http.Server APIAndrew Kelley
2025-08-07http fixesAndrew Kelley
2025-08-07std.crypto.tls: rework for new std.Io APIAndrew Kelley
2025-08-07std.http: rework for new std.Io APIAndrew Kelley
2025-08-07Merge pull request #24709 from rootbeer/24380-fstatat-race-fixAlex Rønne Petersen
2025-08-07std: fix std.c._msize signatureMeghan Denny
2025-08-07Add support for both '_' and 'else' prongs at the same time in switch statementsJustus Klausecker
If both are used, 'else' handles named members and '_' handles unnamed members. In this case the 'else' prong will be unrolled to an explicit case containing all remaining named values.
2025-08-07Permit explicit tags with '_' switch prongJustus Klausecker
Mainly affects ZIR representation of switch_block[_ref] and special prong (detection) logic for switch. Adds a new SpecialProng tag 'absorbing_under' that allows specifying additional explicit tags in a '_' prong which are respected when checking that every value is handled during semantic analysis but are not transformed into AIR and instead 'absorbed' by the '_' branch.
2025-08-07Merge pull request #24199 from Justus2308/24106-fmt-castsMatthew Lugg
zig fmt: canonicalize nested cast builtin order
2025-08-06lib/std/posix/test.zig: don't compare blksize in "fstatat"Pat Tullmann
In trying to reproduce the race in #24380, my system tripped over the stat "blocks" field changing in this test. The value was almost always 8 (effectively 4k) or very infrequently 0 (I saw the 0 from both `fstat` and `fstatat`). I believe the underlying filesystem is free to asynchronously change this value. For example, if it migrates a file between some "inline" or maybe journal storage, and actual on-disk blocks. So it seems plausible that its allowed to change between stat calls. Breaking up the struct comparison this way means we also don't compare any of the padding or "reserved" fields, too. And we can narrow down the s390x-linux work-around.
2025-08-06linux/mips.zig: Use `i32` for stat nsec fieldsPat Tullmann
The `atime()`, etc wrappers here expect to create a `std.linux.timespec` (defined in `linux.zig` to have `isize` fields), so the u32 causes errors: error: expected type 'isize', found 'u32' .nsec = self.atim_nsec, Make the nsec fields signed for consistency with all the other structs, with and with `std.linux.timespec`. Also looks like the comment on `__pad1` was copied from `__pad0`, but it only applies to `__pad0`.
2025-08-06std.Io.Reader: use readVec for fill functionsAndrew Kelley
readVec has two updated responsibilities: 1. it must respect any existing already buffered data. 2. it must write to the buffer if data is empty
2025-08-06#24471: add mlock syscalls to std.os.linuxkj4tmp@gmail.com
2025-08-06autodoc: Use the search input's value on load (#24467)massi
Co-authored-by: massi <git@massi.world>
2025-08-05flate zlib fix end of block readingIgor Anić
`n` is wanted number of bits to toss `buffered_n` is actual number of bytes in `next_int`
2025-08-05Merge pull request #24699 from ziglang/boundedAndrew Kelley
remove RingBuffer; remove BoundedArray; use `@memmove`
2025-08-05std.elf: buffer header iterator API (#24691)Giuseppe Cesarano
Closes #24666.
2025-08-05std: delete RingBufferAndrew Kelley
Progress towards #19231
2025-08-05std.base64: delete encodeFromReaderToWriterAndrew Kelley
this function is wacky, should not have been merged
2025-08-05std: remove BoundedArrayAndrew Kelley
This use case is handled by ArrayListUnmanaged via the "...Bounded" method variants, and it's more optimal to share machine code, versus generating multiple versions of each function for differing array lengths.
2025-08-05std.array_list: add bounded methodsAndrew Kelley
2025-08-05std: replace various mem copies with `@memmove`Andrew Kelley
2025-08-05std.c: fix utsname array sizesVeikka Tuominen
2025-08-05crypto: fix typo in ecdsa commentDavid Rubin
2025-08-05std.Target.Query: fix `WindowsVersion` format in `zigTriple()`KNnut
2025-08-04std.compress.flate.Decompress: return correct size for unbuffered decompressionIan Johnson
Closes #24686 As a bonus, this commit also makes the `git.zig` "testing `main`" compile again.
2025-08-04Merge pull request #24629 from alexrp/android-requires-libcAlex Rønne Petersen
`std.Target`: require libc for Android API levels prior to 29
2025-08-04Merge pull request #24689 from mlugg/build-no-watch-regressionMatthew Lugg
build runner: fix FTBFS on targets without `--watch` implementation
2025-08-04build runner: fix FTBFS on targets without `--watch` implementationmlugg
This was a regression in #24588. I have verified that this patch works by confirming that with the downstream patches SerenityOS apply to the Zig source tree (sans the one working around this regression), I can build the build runner for SerenityOS. Resolves: #24682
2025-08-03std.Target: bump watchos min version to 8.0.0Alex Rønne Petersen
2025-08-03std.Target: bump driverkit min version to 20.0.0Alex Rønne Petersen
2025-08-03std.Target: bump max versions for Apple targetsAlex Rønne Petersen