mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 22:35:51 +00:00
smart: send a flush when we disconnect
The git server wants to hear a flush from us when we disconnect, particularly when we want to perform a fetch but are up to date.
This commit is contained in:
parent
588a43af54
commit
ac11219b80
@ -272,6 +272,18 @@ static int git_smart__close(git_transport *transport)
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
git_pkt *p;
|
git_pkt *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
git_smart_subtransport_stream *stream;
|
||||||
|
const char flush[] = "0000";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we're still connected at this point and not using RPC,
|
||||||
|
* we should say goodbye by sending a flush, or git-daemon
|
||||||
|
* will complain that we disconnected unexpectedly.
|
||||||
|
*/
|
||||||
|
if (t->connected && !t->rpc &&
|
||||||
|
!t->wrapped->action(&stream, t->wrapped, t->url, GIT_SERVICE_UPLOADPACK)) {
|
||||||
|
t->current_stream->write(t->current_stream, flush, 4);
|
||||||
|
}
|
||||||
|
|
||||||
ret = git_smart__reset_stream(t, true);
|
ret = git_smart__reset_stream(t, true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user