| Age | Commit message (Collapse) | Author |
|
std: rework HTTP and TLS for new I/O API
|
|
|
|
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.
|
|
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.
|
|
* 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
|
|
respect the case when there is existing buffer
|
|
let's see if anybody notices it missing
|
|
thank you everybody
|
|
and fix bad unit test API usage that it finds
|
|
Just enough to get things working correctly again
|
|
|
|
|
|
|
|
I never liked how this data structure took its API as a parameter.
This use case is now served by std.Io buffering.
|
|
|
|
|
|
Now it avoids mutating `r` unnecessarily, allowing the `ending` Reader
to work.
|
|
it's not quite finished because I need to make it not copy the Resource
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
zig fmt: canonicalize nested cast builtin order
|
|
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.
|
|
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`.
|
|
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
|
|
|
|
Co-authored-by: massi <git@massi.world>
|
|
`n` is wanted number of bits to toss
`buffered_n` is actual number of bytes in `next_int`
|
|
remove RingBuffer; remove BoundedArray; use `@memmove`
|
|
Closes #24666.
|
|
Progress towards #19231
|
|
this function is wacky, should not have been merged
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
Closes #24686
As a bonus, this commit also makes the `git.zig` "testing `main`" compile again.
|
|
`std.Target`: require libc for Android API levels prior to 29
|
|
build runner: fix FTBFS on targets without `--watch` implementation
|
|
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
|
|
|
|
|
|
|