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
5587a9c9
Commit
5587a9c9
authored
May 01, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #658 from schu/remote-disconnect
remote: don't free transport on disconnect
parents
52877c89
42ea35c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
examples/network/fetch.c
+3
-0
src/remote.c
+10
-8
No files found.
examples/network/fetch.c
View file @
5587a9c9
...
...
@@ -93,6 +93,9 @@ int fetch(git_repository *repo, int argc, char **argv)
}
while
(
!
data
.
finished
);
printf
(
"
\r
Received %d/%d objects in %d bytes
\n
"
,
stats
.
processed
,
stats
.
total
,
bytes
);
// Disconnect the underlying connection to prevent from idling.
git_remote_disconnect
(
remote
);
// Update the references in the remote's namespace to point to the
// right commits. This may be needed even if there was no packfile
// to download, which can happen e.g. when the branches have been
...
...
src/remote.c
View file @
5587a9c9
...
...
@@ -381,13 +381,8 @@ void git_remote_disconnect(git_remote *remote)
{
assert
(
remote
);
if
(
remote
->
transport
!=
NULL
)
{
if
(
remote
->
transport
->
connected
)
if
(
remote
->
transport
!=
NULL
&&
remote
->
transport
->
connected
)
remote
->
transport
->
close
(
remote
->
transport
);
remote
->
transport
->
free
(
remote
->
transport
);
remote
->
transport
=
NULL
;
}
}
void
git_remote_free
(
git_remote
*
remote
)
...
...
@@ -395,14 +390,21 @@ void git_remote_free(git_remote *remote)
if
(
remote
==
NULL
)
return
;
if
(
remote
->
transport
!=
NULL
)
{
git_remote_disconnect
(
remote
);
remote
->
transport
->
free
(
remote
->
transport
);
remote
->
transport
=
NULL
;
}
git_vector_free
(
&
remote
->
refs
);
git__free
(
remote
->
fetch
.
src
);
git__free
(
remote
->
fetch
.
dst
);
git__free
(
remote
->
push
.
src
);
git__free
(
remote
->
push
.
dst
);
git__free
(
remote
->
url
);
git__free
(
remote
->
name
);
git_vector_free
(
&
remote
->
refs
);
git_remote_disconnect
(
remote
);
git__free
(
remote
);
}
...
...
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