[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: MessageID integer problem



At 11:52 PM 4/11/2005, Bos, Jeroen wrote:
>The client that gives me the problem is 2.0.27.

I note that 2.0 is historic, as is 2.1.

>What my routine does is quit simple. Let's take the correct working number: 
>
>02 <- Tag for integer (Message ID) 
>02 <- Length, in this case 2, so the next two bytes are the lenght: 
>80 <- 128 * 256 = 32,768 
>00 <- 0 

Your decoder is off.  The first bit of the value portion
is 1 hence the value is a negative INTEGER.

Note: MessageId should be non-negative, so the above indicates
a broken client.  (If this is a modern version of OpenLDAP,
e.g., 2.2.24, you should report this.)   I note that
most servers, including slapd(8), don't enforce this constraint.

>So the ID number is 32,768. What I am getting right after message ID 32,767 is : 
>
>02 <- Tag again 
>03 <- Length is in next three bytes 
>00 <- 0 
>80 <- 128 * 256 = 32,768 
>ff <- 255 
>
>Thus I calculate 33,023 Which is what I return.

As encoded above?  If not, your encoder is broken.

Kurt