Re: [PATCH] Add ERR support to smart HTTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/9/6 Shawn O. Pearce <spearce@xxxxxxxxxxx>:
> Sitaram Chamarty <sitaramc@xxxxxxxxx> wrote:
>> On Mon, Sep 6, 2010 at 8:26 PM, Shawn O. Pearce <spearce@xxxxxxxxxxx> wrote:
>> > That is, the following will trigger a correct error on the client:
>> >
>> >  200 OK
>> >  Content-Type: application/x-git-upload-pack-advertisement
>> >
>> >  001e# service=git-upload-pack
>> >  0022ERR You shall not do this
>>
>> are those counts accurate for the specific example you show or just made up?
>>
>> It seems the first line has a count in hex that includes the newline
>> at the end, and the second one has a count in decimal that does not
>> include the newline nor even the 4-digits plus "ERR"
>
> Feh.  I can't count.  The first count is correct.  The second count
> should also be 001e.  I guess that should be obvious by just looking
> at the two lines, they are equal in length.  :-)

Summary of offline discussion with Shawn, so that others can find it if needed:

The first packet (after the HTTP headers of course) should be

XXXX# service=git-upload-pack\n

(or the same with upload replaced by receive).  These are the service
names passed in the service query parameter (/info/refs?service=...).

The XXXX is a hex length of the whole thing.  For these two specific
cases, they will be 1E and 1F.

This should be followed by "0000" (with no \n at the end).  This is a
special packet that means "this sequence of messages is done".

After this you can send any error messages, as follows:

XXXXERR your message\n

where again the XXXX is a hex count of the whole string (including 4
for the count itself, 4 for "ERR ", and a newline if you add it).

-- 
Sitaram
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]