logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Postgres-pr error "invalid length of startup packet": msg#00012

Subject: Re: Postgres-pr error "invalid length of startup packet"
On Mon, Mar 21, 2005 at 04:29:28PM +0100, Michael Neumann wrote:
> >Are you saying that the byte order for the Postgres protocol is dependent 
> >on
> >the endianness of the server you're talking to?
> 
> No ;-)
> 
> The problem is only that there's no easy way to unpack a signed 4-byte 
> network byteordered integer in Ruby. So what I do is, reverse if we are 
> on a little endian machine (to get a big endian value as native), then 
> unpack the value as signed, 4 byte integer is native byte-order.

OK. unpack('N') would have got an unsigned 4 byte integer, and I just
thought it was unlikely that a length would be negative, so couldn't work
out why you had changed it.

Regards,

Brian.


<Prev in Thread] Current Thread [Next in Thread>