thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Geyer <jensge...@hotmail.com>
Subject AW: Crazy TBinaryProtocol
Date Fri, 12 Jan 2018 08:09:39 GMT
Agree with Ben.

Could you give an idea what server you are using? Some of them imply framed.

Sent from mobile device, please ignore spelling mistakes.
________________________________
Von: Ben Craig
Gesendet: 11.01.2018 18:20
An: user@thrift.apache.org
Betreff: Re: Crazy TBinaryProtocol

This kind of issue usually arises when one side is using a framed message
and the other side is not.

On Thu, Jan 11, 2018 at 10:40 AM, André Lemos <alemos@plux.info> wrote:

> On Thu, Jan 11, 2018 at 4:34 PM, Kevin Clark <kevin.clark@gmail.com>
> wrote:
>
> > On Thu, Jan 11, 2018 at 8:19 AM André Lemos <alemos@plux.info> wrote:
> >
> > > On Thu, Jan 11, 2018 at 4:13 PM, Kevin Clark <kevin.clark@gmail.com>
> > > wrote:
> > >
> > > > On Thu, Jan 11, 2018 at 7:40 AM André Lemos <alemos@plux.info>
> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > >
> > > > > When parsing through a TBinaryProtocol, trying to get the
> > > > readMessageBegin,
> > > > > readI32, returns 16777216, which will raise an EOFError, because
> it's
> > > > just
> > > > > a too big of a value. If I use something like 25, I do get
> something
> > > > pretty
> > > > > closer to what I am trying to get, although I still get the initial
> > bit
> > > > of
> > > > > the protocol, and not just the name I am trying to get.
> > > > >
> > > > > Any hints as to where I should be looking?
> > > >
> > > >
> > > >
> > > > Providing the language of the lib you’re using, the code, and the
> > message
> > > > you expect to be on the wire would make it easier for someone to help
> > > you.
> > >
> > >
> > >
> > > I am using Python 2, I've sent the code. The message I am trying to
> > parse,
> > > looks like this:
> > >
> > >
> > > \x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
> > x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
> > x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
> > x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
> > > Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
> > > Observer XT
> > >
> > > 14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
> > x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
> > x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
> > x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
> > x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
> > x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
> > x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
> > x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
> > x00\x00\x00\x00\x00\x00\x00
> >
> >
> > Well the number you’ve pasted looks like it’s 1 << 24, so it should fit
> in
> > a 32 bit int just fine. I’m not seeing actual code anywhere, just
> > descriptions of method calls. I suspect this is a simple oversight but
> it’s
> > hard to tell you more without the actual code and the precise error
> > message.
> >
>
>
>
> here's the code (Python 2):
>
>     trans1 = TTransport.TMemoryBuffer()
>     trans1.open()
>     trans = TTransport.TMemoryBuffer(body)
>     trans.open()
>     iprot = TBinaryProtocol.TBinaryProtocol(trans)
>     oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
>     tr = Processor(CommonService.CommonService.Iface())
>     tr.process(iprot, oprot)
>
>
> issue is that readI32() gets me a EOFError as it tries to read way past the
> full message.
>
>
>
> > > --
> > Kevin Clark
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message