Re: [PATCH 1/6] fetch-pack: buffer object-format with other args
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Apr 9, 2021, 16:24 UTC
- Message-ID
- <20210409162417.2558134-1-jonathantanmy@google.com>
- In-Reply-To
- <xmqqy2dsnjuf.fsf@gitster.g>
Show 14 quoted lines
> Jonathan Tan <jonathantanmy@google.com> writes:
>
> > In send_fetch_request(), "object-format" is written directly to the file
> > descriptor, as opposed to the other arguments, which are buffered.
> > Buffer "object-format" as well. "object-format" must be buffered; in
> > particular, it must appear after "command=fetch" in the request.
> >
> > This divergence was introduced in 4b831208bb ("fetch-pack: parse and
> > advertise the object-format capability", 2020-05-27), perhaps as an
> > oversight (the surrounding code at the point of this commit has already
> > been using a request buffer.)
>
> Good find. Did this actually resulted in a data corruption and that
> was how you discovered it?No, I did not see any data corruption. I discovered it because I was looking at this function, thinking that I needed to refactor it.