Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
d299a7aa
Unverified
Commit
d299a7aa
authored
Feb 08, 2022
by
Edward Thomson
Committed by
GitHub
Feb 08, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6205 from ccstolley/ccs_fix_http_push_timeout
push: Prepare pack before sending pack header.
parents
1e7c8b1f
aceac672
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
src/pack-objects.c
+2
-2
src/pack-objects.h
+2
-0
src/transports/smart_protocol.c
+4
-0
No files found.
src/pack-objects.c
View file @
d299a7aa
...
...
@@ -1308,7 +1308,7 @@ static int ll_find_deltas(git_packbuilder *pb, git_pobject **list,
#define ll_find_deltas(pb, l, ls, w, d) find_deltas(pb, l, &ls, w, d)
#endif
static
int
prepare_pack
(
git_packbuilder
*
pb
)
int
git_packbuilder__prepare
(
git_packbuilder
*
pb
)
{
git_pobject
**
delta_list
;
size_t
i
,
n
=
0
;
...
...
@@ -1353,7 +1353,7 @@ static int prepare_pack(git_packbuilder *pb)
return
0
;
}
#define PREPARE_PACK if (
prepare_pack
(pb) < 0) { return -1; }
#define PREPARE_PACK if (
git_packbuilder__prepare
(pb) < 0) { return -1; }
int
git_packbuilder_foreach
(
git_packbuilder
*
pb
,
int
(
*
cb
)(
void
*
buf
,
size_t
size
,
void
*
payload
),
void
*
payload
)
{
...
...
src/pack-objects.h
View file @
d299a7aa
...
...
@@ -100,5 +100,7 @@ struct git_packbuilder {
};
int
git_packbuilder__write_buf
(
git_str
*
buf
,
git_packbuilder
*
pb
);
int
git_packbuilder__prepare
(
git_packbuilder
*
pb
);
#endif
src/transports/smart_protocol.c
View file @
d299a7aa
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment