* [PATCH 2/2] Clean up connection correctly if object fetch wasn't done
@ 2008-02-04 18:26 Daniel Barkalow
2008-02-04 20:23 ` Johannes Schindelin
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Barkalow @ 2008-02-04 18:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Further optimization allowed the fetch_objs call to be skipped if it
isn't necessary. However, this leaves the connection in need of
cleaning up to avoid getting an error message from the remote end when
ssh is used. Fix this.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
builtin-fetch.c | 2 ++
transport.c | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 320e235..ac335f2 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -557,6 +557,8 @@ static int do_fetch(struct transport *transport,
free_refs(fetch_map);
+ transport_disconnect(transport);
+
return 0;
}
diff --git a/transport.c b/transport.c
index 53fb2ec..199e9e6 100644
--- a/transport.c
+++ b/transport.c
@@ -677,7 +677,15 @@ static int git_transport_push(struct transport *transport, int refspec_nr, const
static int disconnect_git(struct transport *transport)
{
- free(transport->data);
+ struct git_transport_data *data = transport->data;
+ if (data->conn) {
+ packet_flush(data->fd[1]);
+ close(data->fd[0]);
+ close(data->fd[1]);
+ finish_connect(data->conn);
+ }
+
+ free(data);
return 0;
}
--
1.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Clean up connection correctly if object fetch wasn't done
2008-02-04 18:26 [PATCH 2/2] Clean up connection correctly if object fetch wasn't done Daniel Barkalow
@ 2008-02-04 20:23 ` Johannes Schindelin
2008-02-04 21:06 ` Daniel Barkalow
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2008-02-04 20:23 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Junio C Hamano, git
Hi,
On Mon, 4 Feb 2008, Daniel Barkalow wrote:
> Further optimization allowed the fetch_objs call to be skipped if it
> isn't necessary. However, this leaves the connection in need of cleaning
> up to avoid getting an error message from the remote end when ssh is
> used. Fix this.
I _think_ something similar is necessary for ls-remote, too (at least it
showed the same symptoms today, but I have not had time to investigate
yet).
Ciao,
Dscho
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Clean up connection correctly if object fetch wasn't done
2008-02-04 20:23 ` Johannes Schindelin
@ 2008-02-04 21:06 ` Daniel Barkalow
2008-02-04 21:21 ` Johannes Schindelin
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Barkalow @ 2008-02-04 21:06 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
On Mon, 4 Feb 2008, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 4 Feb 2008, Daniel Barkalow wrote:
>
> > Further optimization allowed the fetch_objs call to be skipped if it
> > isn't necessary. However, this leaves the connection in need of cleaning
> > up to avoid getting an error message from the remote end when ssh is
> > used. Fix this.
>
> I _think_ something similar is necessary for ls-remote, too (at least it
> showed the same symptoms today, but I have not had time to investigate
> yet).
Yup, exactly the same change to builtin-ls-remote that builtin-fetch
needed.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c
index 6dd31d1..0237549 100644
--- a/builtin-ls-remote.c
+++ b/builtin-ls-remote.c
@@ -94,6 +94,7 @@ int cmd_ls_remote(int argc, const char **argv, const
char *prefix)
transport_set_option(transport, TRANS_OPT_UPLOADPACK,
uploadpack);
ref = transport_get_remote_refs(transport);
+ transport_disconnect(transport);
if (!ref)
return 1;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Clean up connection correctly if object fetch wasn't done
2008-02-04 21:06 ` Daniel Barkalow
@ 2008-02-04 21:21 ` Johannes Schindelin
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2008-02-04 21:21 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Junio C Hamano, git
Hi,
On Mon, 4 Feb 2008, Daniel Barkalow wrote:
> On Mon, 4 Feb 2008, Johannes Schindelin wrote:
>
> > On Mon, 4 Feb 2008, Daniel Barkalow wrote:
> >
> > > Further optimization allowed the fetch_objs call to be skipped if it
> > > isn't necessary. However, this leaves the connection in need of
> > > cleaning up to avoid getting an error message from the remote end
> > > when ssh is used. Fix this.
> >
> > I _think_ something similar is necessary for ls-remote, too (at least
> > it showed the same symptoms today, but I have not had time to
> > investigate yet).
>
> Yup, exactly the same change to builtin-ls-remote that builtin-fetch
> needed.
Thanks, works here.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-04 21:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 18:26 [PATCH 2/2] Clean up connection correctly if object fetch wasn't done Daniel Barkalow
2008-02-04 20:23 ` Johannes Schindelin
2008-02-04 21:06 ` Daniel Barkalow
2008-02-04 21:21 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox