From: "Shawn O. Pearce" <spearce@spearce.org>
To: Yiyi Sun <yiyisun@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: git-receive-pack --stateless-rpc
Date: Thu, 17 Jun 2010 08:25:27 -0700 [thread overview]
Message-ID: <20100617152527.GA14847@spearce.org> (raw)
In-Reply-To: <AANLkTinJadUb48CBKMy1cMlXb2yUvm9uY0nUAQuslrfo@mail.gmail.com>
Yiyi Sun <yiyisun@gmail.com> wrote:
> Thanks Shawn for you quick reply. Now I have the answer to question #1.
>
> You are so good that spotted the space between 0030 and 000e. It is a
> byte of value 0x1. I can reproduce the issue using the attached file
> w/o goimg through my program:
>
> --save the file (named input) to and goto the directory
> git init --bare test
> cd test
> cat ../input | git receive-pack .
>
> It returns message below, where you can see a funny char there.
>
> 00700000000000000000000000000000000000000000 capabilities^{} report-status dele
> te-refs side-band-64k ofs-delta
> Unpacking objects: 100% (6/6), done.
> 0030☺000eunpack ok
> 0019ok refs/heads/master
> 00000000
>
>
> For the "003" error. I tired to grab the HTTP output w/o using msysGit. It is
>
> HTTP/1.1 200 OK
> Server: ASP.NET Development Server/10.0.0.0
> Date: Thu, 17 Jun 2010 13:18:44 GMT
> X-AspNet-Version: 4.0.30319
> Cache-Control: private
> Content-Type: application/x-git-receive-pack-result
> Content-Length: 52
> Connection: Close
>
> 0030\x01000eunpack ok
> 0019ok refs/heads/master
> 00000000
>
> It looks normal. Besides msysGit can candle the output of 'git
> receive-pack --stateless-rpc
> --advertise-refs' via HTTP GET the same way my program returns the result.
>
> Regards,
>
> yysun
>
> On Thu, Jun 17, 2010 at 10:00 AM, Shawn Pearce <spearce@spearce.org> wrote:
> >
> > On Thu, Jun 17, 2010 at 6:45 AM, Yiyi Sun <yiyisun@gmail.com> wrote:
> > > I am creating a Git smart HTTP protocol wrapper and run into two
> > > problem. I tried the msysGit mailing list and was told to ask them to
> > > the main git mailing list.
> > >
> > > Here is the story. During 'git push', I successfully processed the
> > > initial GET request of '/info/refs?service=git-receive-pack' by
> > > sending back the output of 'git receive-pack --stateless-rpc
> > > --advertise-refs'. Then msysGit did a the POST request. I
> > > invoked 'git receive-pack --stateless-rpc', which returned:
> > >
> > > 0030 000eunpack ok
> > > 0019ok refs/heads/master
> > > 00000000
> >
> > That doesn't look right to me. There appears to be a space at the
> > start of the packet (between 0030 and 000e), which would confuse the
> > protocol. Otherwise, that appears to be a valid response from
> > receive-pack assuming the client asked for side-band-64k in the
> > request, and it pushed only refs/heads/master.
> >
> > > Question #1, Is the result supposed to be something below instead?
> > >
> > > 000eunpack ok
> > > 0019ok refs/heads/master
> > > 0000
> >
> > Depends on whether or not the client asked for side-band-64k. If it
> > did, we wrap it up in a another pkt-line framing like above, and end
> > with another flush-pkt. If the client didn't ask for side-band-64k,
> > then the above would be the correct response.
> >
> > > Question #2, msysGit cannot parse the result, it displays error message:
> > >
> > > fatal: protocol error: bad line length character:
> > > 003
> > > fatal: The remote end hung up unexpectedly
> >
> > This is weird. "003" isn't valid, its not 4 bytes long. What was
> > that trailing final 4th byte right there? If its a space like it is
> > above (though then its really in the wrong spot, isn't it?) that would
> > throw it all off.
> >
> > It sounds to me like your wrapper is mangling the data that is passing
> > through it on the way back to the client.
Oh, yea. That byte 0x01 is the sideband stream number. I forgot
about that needing to be there. :-)
I think your wrapper program is dropping the data there or isn't
being 8 bit clean and is mangling the value. That's part of
the stream.
--
Shawn.
prev parent reply other threads:[~2010-06-17 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTikwu4iKnG-DzclRPFNF7djNKZ31xR82aO0ryVJ3@mail.gmail.com>
2010-06-17 13:45 ` Fwd: git-receive-pack --stateless-rpc Yiyi Sun
2010-06-17 14:00 ` Shawn Pearce
[not found] ` <AANLkTinJadUb48CBKMy1cMlXb2yUvm9uY0nUAQuslrfo@mail.gmail.com>
2010-06-17 15:25 ` Shawn O. Pearce [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100617152527.GA14847@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=yiyisun@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).