git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] smart-http: document flush after "# service" line

From
Jeff King <peff@peff.net>
Date
Mar 3, 2018, 05:27 UTC
Message-ID
<20180303052708.GF27689@sigill.intra.peff.net>
In-Reply-To
<01B07AA7-B2A4-4A81-B1F0-E2EC3D6BFBF9@gmail.com>
On Thu, Feb 22, 2018 at 12:12:54PM -0800, Dorian Taylor wrote:
Show 7 quoted lines
> This patch exists because I was asked to write it. I don’t know squat
> about this protocol other than the fact that I followed the spec and
> it didn’t work. I traced a known-good protocol endpoint and found it
> contained content that didn’t agree with the spec. I then obliged the
> request to submit a patch with *what I knew to be true* about the
> sample that actually worked. I then followed the recommendations
> *advertised on GitHub* for submitting the patch.
I take it that a revised patch is not forthcoming, then. :-/

Let's wrap up this topic with this, then, which adds a commit message and fixes the flush/version-1 ordering issue.

-- >8 --
Subject: smart-http: document flush after "# service" line

The http-protocol.txt spec fails to mention that a flush packet comes in the smart server response after sending any the "service" header.

Technically the client code is actually ready to receive an arbitrary number of headers here, but since we haven't introduced any other headers in the past decade (and the client would just throw them away), let's not mention it in the spec.

This fixes both BNF and the example. While we're fixing the latter, let's also add the missing flush after the ref list.

Reported-by: Dorian Taylor <dorian.taylor.lists@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/technical/http-protocol.txt | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/Documentation/technical/http-protocol.txt b/Documentation/technical/http-protocol.txt
index a0e45f2889..64f49d0bbb 100644
--- a/Documentation/technical/http-protocol.txt
+++ b/Documentation/technical/http-protocol.txt
@@ -214,10 +214,12 @@ smart server reply:
    S: Cache-Control: no-cache
    S:
    S: 001e# service=git-upload-pack\n
+   S: 0000
    S: 004895dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint\0multi_ack\n
    S: 0042d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master\n
    S: 003c2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0\n
    S: 003fa3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}\n
+   S: 0000
 
 The client may send Extra Parameters (see
 Documentation/technical/pack-protocol.txt) as a colon-separated string
@@ -277,6 +279,7 @@ The returned response contains "version 1" if "version=1" was sent as an
 Extra Parameter.
 
   smart_reply     =  PKT-LINE("# service=$servicename" LF)
+		     "0000"
 		     *1("version 1")
 		     ref_list
 		     "0000"
-- 
2.16.2.708.g0b2ed7f536
Previous: Dorian TaylorNext: Eric Sunshine
Message 10 of 13 in “bug in HTTP protocol spec”
  1. Dorian TaylorFeb 21, 2018
  2. Jeff KingFeb 21, 2018
  3. Dorian TaylorFeb 21, 2018
  4. Jonathan NiederFeb 22, 2018
  5. Dorian TaylorFeb 22, 2018
  6. Jeff KingFeb 22, 2018
  7. Dorian TaylorFeb 22, 2018
  8. Junio C HamanoFeb 22, 2018
  9. Dorian TaylorFeb 22, 2018
  10. smart-http: document flush after "# service" lineJeff King, Mar 3, 2018
  11. Eric SunshineMar 3, 2018
  12. Jeff KingMar 3, 2018
  13. Brandon WilliamsFeb 22, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.