BUG: Protocol 3.0: that's just odd, needing to add the number of bytes the length field occupies

Started by Eugen Konkovalmost 18 years ago3 messagesbugs
Jump to latest
#1Eugen Konkov
Eugen.Konkov@aldec.com

server side: writeInt32( length($message)+4 ); writeString( $message );
client side: $length= readInt32(); readString( $length -4 )

that's just odd, needing to add the number of bytes the length field occupies

This is simpler:
server side: writeInt32( length($message)); writeString( $message );
client side: $length= readInt32(); readString( $length )

Will you plan to correct that in Protocol 3.1?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Eugen Konkov (#1)
Re: BUG: Protocol 3.0: that's just odd, needing to add the number of bytes the length field occupies

<Eugen.Konkov@aldec.com> writes:

Will you plan to correct that in Protocol 3.1?

No.

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Eugen Konkov (#1)
Re: BUG: Protocol 3.0: that's just odd, needing to add the number of bytes the length field occupies

Eugen.Konkov@aldec.com wrote:

server side: writeInt32( length($message)+4 ); writeString( $message );
client side: $length= readInt32(); readString( $length -4 )

that's just odd, needing to add the number of bytes the length field occupies

This is simpler:
server side: writeInt32( length($message)); writeString( $message );
client side: $length= readInt32(); readString( $length )

Will you plan to correct that in Protocol 3.1?

Agreed, no plans to change that. TCP does the same:

http://www.ysn.ru/docs/cie/Course/Section4/8.htm

+--------+--------+--------+--------+
| Source Address |
+--------+--------+--------+--------+
| Destination Address |
+--------+--------+--------+--------+
| zero | PTCL | TCP Length |
+--------+--------+--------+--------+

The TCP Length is the TCP header length plus the data length in
-----------------
octets (this is not an explicitly transmitted quantity, but is
computed), and it does not count the 12 octets of the pseudo
header.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +