summaryrefslogtreecommitdiff
path: root/src/transports/smart_protocol.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-02-08 20:42:45 -0500
committerGitHub <noreply@github.com>2022-02-08 20:42:45 -0500
commitd299a7aad66e8e32135d801f47d46fecf9042b9f (patch)
treeeb9d80886fa0e0c476b9fc26abafa91a472f0f15 /src/transports/smart_protocol.c
parent1e7c8b1f644e44de881a3c15b743bb558c3a71e6 (diff)
parentaceac672fd0431ec55d4efe3f037c596700ad46c (diff)
downloadlibgit2-d299a7aad66e8e32135d801f47d46fecf9042b9f.tar.gz
Merge pull request #6205 from ccstolley/ccs_fix_http_push_timeout
push: Prepare pack before sending pack header.
Diffstat (limited to 'src/transports/smart_protocol.c')
-rw-r--r--src/transports/smart_protocol.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index 06102817d..adfc30466 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -1036,6 +1036,10 @@ int git_smart__push(git_transport *transport, git_push *push)
}
}
+ /* prepare pack before sending pack header to avoid timeouts */
+ if (need_pack && ((error = git_packbuilder__prepare(push->pb))) < 0)
+ goto done;
+
if ((error = git_smart__get_push_stream(t, &packbuilder_payload.stream)) < 0 ||
(error = gen_pktline(&pktline, push)) < 0 ||
(error = packbuilder_payload.stream->write(packbuilder_payload.stream, git_str_cstr(&pktline), git_str_len(&pktline))) < 0)