git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stan Hu <stanhu@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Stan Hu <stanhu@gmail.com>
Subject: [PATCH] upload-pack: Exit when server finishes sending shallow-update in stateless RPC mode
Date: Mon, 11 Apr 2016 21:55:40 -0700	[thread overview]
Message-ID: <1460436940-16165-1-git-send-email-stanhu@gmail.com> (raw)

In the stateless RPC case, the server should respond to the client's depth
request with the set of commits which are no deeper than the desired
depth. Once this finishes, the server should terminate and receive the reply
in another POST request.

Previously the server would sit idle and die when it detected the client
closed the connection.

Signed-off-by: Stan Hu <stanhu@gmail.com>
---
 upload-pack.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/upload-pack.c b/upload-pack.c
index b3f6653..4fb1e60 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -676,6 +676,8 @@ static void receive_needs(void)
 			register_shallow(object->oid.hash);
 		}
 		packet_flush(1);
+		if (stateless_rpc)
+			exit(0);
 	} else
 		if (shallows.nr > 0) {
 			int i;
-- 
2.7.3

             reply	other threads:[~2016-04-12  4:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12  4:55 Stan Hu [this message]
2016-04-12  5:39 ` [PATCH] upload-pack: Exit when server finishes sending shallow-update in stateless RPC mode Torsten Bögershausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460436940-16165-1-git-send-email-stanhu@gmail.com \
    --to=stanhu@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).