aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-12-28 16:37:22 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-01-02 16:57:16 -0700
commit940d368e7ea95d2bb8185e71af3d1ec0328917dc (patch)
treea2338ec0d47f74c0badfe0a22d2e77e5044e3082 /src/zig_llvm.cpp
parent21ab99174eabc9ae8efa2b19890d9cab51773b35 (diff)
downloadzig-940d368e7ea95d2bb8185e71af3d1ec0328917dc.tar.gz
zig-940d368e7ea95d2bb8185e71af3d1ec0328917dc.zip
std.crypto.tls.Client: fix the read function
The read function has been renamed to readAdvanced since it has slightly different semantics than typical read functions, specifically regarding the end-of-file. A higher level read function is implemented on top. Now, API users may pass small buffers to the read function and everything will work fine. This is done by re-decrypting the same ciphertext record with each call to read() until the record is finished being transmitted. If the buffer supplied to read() is large enough, then any given ciphertext record will only be decrypted once, since it decrypts directly to the read() buffer and therefore does not need any memcpy. On the other hand, if the buffer supplied to read() is small, then the ciphertext is decrypted into a stack buffer, a subset is copied to the read() buffer, and then the entire ciphertext record is saved for the next call to read().
Diffstat (limited to 'src/zig_llvm.cpp')
0 files changed, 0 insertions, 0 deletions