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
438906e1
Commit
438906e1
authored
Nov 02, 2012
by
Philip Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bytes_received in fetch tests - we weren't calling the callback
parent
473a7a1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
src/transports/smart_protocol.c
+15
-8
No files found.
src/transports/smart_protocol.c
View file @
438906e1
...
...
@@ -371,7 +371,7 @@ struct network_packetsize_payload
git_transfer_progress_callback
callback
;
void
*
payload
;
git_transfer_progress
*
stats
;
git_off
_t
last_fired_bytes
;
size
_t
last_fired_bytes
;
};
static
void
network_packetsize
(
int
received
,
void
*
payload
)
...
...
@@ -402,12 +402,18 @@ int git_smart__download_pack(
int
error
=
-
1
;
struct
network_packetsize_payload
npp
=
{
0
};
memset
(
stats
,
0
,
sizeof
(
git_transfer_progress
));
if
(
progress_cb
)
{
npp
.
callback
=
progress_cb
;
npp
.
payload
=
progress_payload
;
npp
.
stats
=
stats
;
t
->
packetsize_cb
=
&
network_packetsize
;
t
->
packetsize_payload
=
&
npp
;
/* We might have something in the buffer already from negotiate_fetch */
if
(
t
->
buffer
.
offset
>
0
)
t
->
packetsize_cb
(
t
->
buffer
.
offset
,
t
->
packetsize_payload
);
}
if
(
git_buf_joinpath
(
&
path
,
git_repository_path
(
repo
),
"objects/pack"
)
<
0
)
...
...
@@ -416,9 +422,6 @@ int git_smart__download_pack(
if
(
git_indexer_stream_new
(
&
idx
,
git_buf_cstr
(
&
path
),
progress_cb
,
progress_payload
)
<
0
)
goto
on_error
;
git_buf_free
(
&
path
);
memset
(
stats
,
0
,
sizeof
(
git_transfer_progress
));
/*
* If the remote doesn't support the side-band, we can feed
* the data directly to the indexer. Otherwise, we need to
...
...
@@ -428,8 +431,7 @@ int git_smart__download_pack(
if
(
no_sideband
(
t
,
idx
,
buf
,
stats
)
<
0
)
goto
on_error
;
git_indexer_stream_free
(
idx
);
return
0
;
goto
on_success
;
}
do
{
...
...
@@ -466,11 +468,16 @@ int git_smart__download_pack(
if
(
git_indexer_stream_finalize
(
idx
,
stats
)
<
0
)
goto
on_error
;
git_indexer_stream_free
(
idx
);
return
0
;
on_success:
error
=
0
;
on_error:
git_buf_free
(
&
path
);
git_indexer_stream_free
(
idx
);
/* Trailing execution of progress_cb, if necessary */
if
(
npp
.
callback
&&
npp
.
stats
->
received_bytes
>
npp
.
last_fired_bytes
)
npp
.
callback
(
npp
.
stats
,
npp
.
payload
);
return
error
;
}
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