Jeff King <[email protected]> writes:
> After making initial contact with an http server, we have to decide if
> the server supports smart-http, and if so, which version. Our rules are
> a bit inconsistent:
> ...
>
> - we now predicate the smart/dumb decision entirely on the presence of
> the correct content-type
>
> - we do a real pkt-line parse before deciding how to proceed (and die
> if it isn't valid)
>
> - use skip_prefix() for comparing service strings, instead of
> constructing expected output in a strbuf; this avoids dealing with
> memory cleanup
>
> Note that this _is_ tightening what the client will allow. It's all
> according to the spec, but it's possible that other implementations
> might violate these. However, violating these particular rules seems
> like an odd choice for a server to make.
>
> [1] Documentation/technical/http-protocol.txt, l. 166-167
> [2] Documentation/technical/protocol-v2.txt, l. 63-64
> [3] Documentation/technical/http-protocol.txt, l. 247
>
> Helped-by: Josh Steadmon <[email protected]>
> Signed-off-by: Jeff King <[email protected]>
> ---
> remote-curl.c | 93 ++++++++++++++++++++++++++++++++-------------------
> 1 file changed, 59 insertions(+), 34 deletions(-)
It turns out that this has interactions with 01f9ec64 ("Use
packet_reader instead of packet_read_line", 2018-12-29) on the
ms/packet-err-check branch. Can we get this rebased on top of
a more recent 'master'?
Thanks.