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

Re: [PATCH] pack-protocol.txt: accept error packets in any context

From
Stefan Beller <sbeller@google.com>
Date
Dec 3, 2018, 23:59 UTC
Message-ID
<CAGZ79karTiSh94qwgrL76qOQ_W_bEK=2y3UvSsdz+cHpUXXqeQ@mail.gmail.com>
In-Reply-To
<20181127045301.103807-1-masayasuzuki@google.com>
Show 12 quoted lines
> diff --git a/pkt-line.c b/pkt-line.c
> index 04d10bbd0..ce9e42d10 100644
> --- a/pkt-line.c
> +++ b/pkt-line.c
> @@ -346,6 +346,10 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,
>                 return PACKET_READ_EOF;
>         }
>
> +       if (starts_with(buffer, "ERR ")) {
> +               die(_("remote error: %s"), buffer + 4);
> +       }
> +
Handling any ERR line in the pkt reader is okay, as
* we do not pkt-ize pack files and
* we do not have any other parts of the protocol where user data is in
  the first four bytes, which could randomly match this pattern and
* the rest of the pkt-ized part of the protocol never sends
  ERR lines.
Makes sense.
Previous: Junio C Hamano
Message 7 of 7 in “pack-protocol.txt: accept error packets in any context”
  1. pack-protocol.txt: accept error packets in any contextMasaya Suzuki, Nov 27, 2018
  2. Junio C HamanoNov 27, 2018
  3. Junio C HamanoNov 29, 2018
  4. Junio C HamanoNov 29, 2018
  5. Masaya SuzukiNov 29, 2018
  6. Junio C HamanoNov 30, 2018
  7. Stefan BellerDec 3, 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.