Commit 2bc36fac by Vicent Marti

Merge pull request #2372 from libgit2/cmn/fetch-terminate

smart: send a flush when we disconnect
parents 58532ed0 ac11219b
......@@ -272,6 +272,18 @@ static int git_smart__close(git_transport *transport)
unsigned int i;
git_pkt *p;
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment