Name |
Last commit
|
Last update |
---|---|---|
.. | ||
auth.c | ||
auth.h | ||
auth_negotiate.c | ||
auth_negotiate.h | ||
cred.c | ||
cred.h | ||
cred_helpers.c | ||
git.c | ||
http.c | ||
http.h | ||
local.c | ||
smart.c | ||
smart.h | ||
smart_pkt.c | ||
smart_protocol.c | ||
ssh.c | ||
ssh.h | ||
winhttp.c |
Similar to the write(3) function, implementations of `git_stream_write` do not guarantee that all bytes are written. Instead, they return the number of bytes that actually have been written, which may be smaller than the total number of bytes. Furthermore, due to an interface design issue, we cannot ever write more than `SSIZE_MAX` bytes at once, as otherwise we cannot represent the number of bytes written to the caller. Unfortunately, no caller of `git_stream_write` ever checks the return value, except to verify that no error occurred. Due to this, they are susceptible to the case where only partial data has been written. Fix this by introducing a new function `git_stream__write_full`. In contrast to `git_stream_write`, it will always return either success or failure, without returning the number of bytes written. Thus, it is able to write all `SIZE_MAX` bytes and loop around `git_stream_write` until all data has been written. Adjust all callers except the BIO callbacks in our mbedtls and OpenSSL streams, which already do the right thing and require the amount of bytes written.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
auth.c | Loading commit data... | |
auth.h | Loading commit data... | |
auth_negotiate.c | Loading commit data... | |
auth_negotiate.h | Loading commit data... | |
cred.c | Loading commit data... | |
cred.h | Loading commit data... | |
cred_helpers.c | Loading commit data... | |
git.c | Loading commit data... | |
http.c | Loading commit data... | |
http.h | Loading commit data... | |
local.c | Loading commit data... | |
smart.c | Loading commit data... | |
smart.h | Loading commit data... | |
smart_pkt.c | Loading commit data... | |
smart_protocol.c | Loading commit data... | |
ssh.c | Loading commit data... | |
ssh.h | Loading commit data... | |
winhttp.c | Loading commit data... |