Ooh, that looks wrong. As far as I can understand, the code should be using the first byte (byte 0) of the packet in its bitfield check. The last byte of the packet should indicate the number of ACKs appended to the packet.

On 7/18/06, Austin Jennings <[EMAIL PROTECTED]> wrote:
I'm currently working on an application-level proxy library that sits
between the client and the server and allows applications to register
callbacks that inspect and modify packets as they pass through.  Most
of the code is working, but I'm trying to deal with appended ACKs and
the code in NetworkManager is confusing and potentially broken:

                 private void OnReceivedData(IAsyncResult result)
                        ...
                                 // Retrieve the incoming packet
                                 int numBytes =
Connection.EndReceiveFrom(result, ref endPoint);

                                 if ((Buffer[Buffer.Length - 1] &
Helpers.MSG_APPENDED_ACKS) != 0)
                                 {
                                         // Grab the ACKs that are
appended to this packet
                                         byte numAcks = Buffer
[Buffer.Length - 1];

Why is it looking at the last byte of the buffer instead of the first
byte for MSG_APPENDED_ACKS, and why is it reusing the same byte to
determine how many ACKs there are?  If this is in fact wrong, is
there a way to determine how many ACKs there should be, short of
calculating the expected length of the packet and counting the number
of extra bytes on the end?  Thanks.

-- Era Pixel



_______________________________________________
libsecondlife-dev mailing list
libsecondlife-dev@gna.org
https://mail.gna.org/listinfo/libsecondlife-dev



--
"Anyone that would give up a little liberty for a little security, deserves neither and loses both." -Ben Franklin
_______________________________________________
libsecondlife-dev mailing list
libsecondlife-dev@gna.org
https://mail.gna.org/listinfo/libsecondlife-dev

Reply via email to