diff options
author | Edward Thomson <ethomson@vercel.com> | 2023-03-21 09:34:09 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@vercel.com> | 2023-03-21 09:36:37 +0000 |
commit | 4fe577247ab3dd5b9e74ffaaddf24027824b6a9d (patch) | |
tree | 917bea00bb89f37abe87b7ef4b351352b0705880 /include/git2/errors.h | |
parent | da0454e1440d72609df85fb77a7b3866d668e082 (diff) | |
download | libgit2-ethomson/nonblocking.tar.gz |
streams: sockets are non-blocking and can timeoutethomson/nonblocking
Make socket I/O non-blocking and add optional timeouts.
Users may now set `GIT_OPT_SET_SERVER_CONNECT_TIMEOUT` to set a shorter
connection timeout. (The connect timeout cannot be longer than the
operating system default.) Users may also now configure the socket read
and write timeouts with `GIT_OPT_SET_SERVER_TIMEOUT`.
By default, connects still timeout based on the operating system
defaults (typically 75 seconds) and socket read and writes block.
Add a test against our custom testing git server that ensures that we
can timeout reads against a slow server.
Diffstat (limited to 'include/git2/errors.h')
-rw-r--r-- | include/git2/errors.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h index a61964bbb..98c2efbd4 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -58,7 +58,8 @@ typedef enum { GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */ GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */ GIT_EAPPLYFAIL = -35, /**< Patch application failed */ - GIT_EOWNER = -36 /**< The object is not owned by the current user */ + GIT_EOWNER = -36, /**< The object is not owned by the current user */ + GIT_TIMEOUT = -37 /**< The operation timed out */ } git_error_code; /** |