summaryrefslogtreecommitdiff
path: root/src/streams/socket.c
Commit message (Collapse)AuthorAgeFilesLines
* refactor: `src` is now `src/libgit2`Edward Thomson2022-02-221-239/+0
|
* streams: use GIT_ASSERTEdward Thomson2020-11-271-2/+6
|
* errors: use lowercaseethomson/error_messagesEdward Thomson2019-06-231-2/+2
| | | | Use lowercase for our error messages, per our custom.
* streams: handle short writes only in generic streamPatrick Steinhardt2019-01-311-11/+7
| | | | | | | | Now that the function `git_stream__write_full` exists and callers of `git_stream_write` have been adjusted, we can lift logic for short writes out of the stream implementations. Instead, this is now handled either by `git_stream__write_full` or by callers of `git_stream_write` directly.
* streams: make file-local functions staticPatrick Steinhardt2019-01-311-5/+5
| | | | | | The callback functions that implement the `git_stream` structure are only used inside of their respective implementation files, but they are not marked as `static`. Fix this.
* streams: don't write more than SSIZE_MAXEdward Thomson2019-01-251-3/+2
| | | | | | | | | Our streams implementation takes a `size_t` that indicates the length of the data buffer to be written, and returns an `ssize_t` that indicates the length that _was_ written. Clearly no such implementation can write more than `SSIZE_MAX` bytes. Ensure that each TLS stream implementation does not try to write more than `SSIZE_MAX` bytes (or smaller; if the given implementation takes a smaller size).
* Don't use deprecated constantsSven Strickroth2019-01-241-1/+1
| | | | | | Follow up for PR #4917. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* git_error: use new names in internal APIs and usageEdward Thomson2019-01-221-12/+12
| | | | | Move to the `git_error` name in the internal API for error-related functions.
* Fix a bunch of warningslhchavez2019-01-051-1/+1
| | | | | | | | | | | This change fixes a bunch of warnings that were discovered by compiling with `clang -target=i386-pc-linux-gnu`. It turned out that the intrinsics were not necessarily being used in all platforms! Especially in GCC, since it does not support __has_builtin. Some more warnings were gleaned from the Windows build, but I stopped when I saw that some third-party dependencies (e.g. zlib) have warnings of their own, so we might never be able to enable -Werror there.
* stream registration: take an enum typeEdward Thomson2018-11-281-1/+1
| | | | | | Accept an enum (`git_stream_t`) during custom stream registration that indicates whether the registration structure should be used for standard (non-TLS) streams or TLS streams.
* stream: provide generic registration APIEdward Thomson2018-11-281-2/+32
| | | | | | | | | Update the new stream registration API to be `git_stream_register` which takes a registration structure and a TLS boolean. This allows callers to register non-TLS streams as well as TLS streams. Provide `git_stream_register_tls` that takes just the init callback for backward compatibliity.
* stream: Gather streams to src/streamsEtienne Samson2017-10-231-0/+210