• Masaya Suzuki's avatar
    pack-protocol.txt: accept error packets in any context · 2d103c31
    Masaya Suzuki authored
    In the Git pack protocol definition, an error packet may appear only in
    a certain context. However, servers can face a runtime error (e.g. I/O
    error) at an arbitrary timing. This patch changes the protocol to allow
    an error packet to be sent instead of any packet.
    
    Without this protocol spec change, when a server cannot process a
    request, there's no way to tell that to a client. Since the server
    cannot produce a valid response, it would be forced to cut a connection
    without telling why. With this protocol spec change, the server can be
    more gentle in this situation. An old client may see these error packets
    as an unexpected packet, but this is not worse than having an unexpected
    EOF.
    
    Following this protocol spec change, the error packet handling code is
    moved to pkt-line.c. Implementation wise, this implementation uses
    pkt-line to communicate with a subprocess. Since this is not a part of
    Git protocol, it's possible that a packet that is not supposed to be an
    error packet is mistakenly parsed as an error packet. This error packet
    handling is enabled only for the Git pack protocol parsing code
    considering this.
    Signed-off-by: 's avatarMasaya Suzuki <masayasuzuki@google.com>
    Signed-off-by: 's avatarJunio C Hamano <gitster@pobox.com>
    2d103c31
serve.c 6.23 KB