postwait/node-amqp — pull request #206 by gyllstromk (2013-06-17 14:50:37+00:00)
Title: Address bug in which delivery tag returns as buffer, preventing lookups from _unAcked table.

We were unable to get `publish` methods to return callbacks. Examination
of the code revealed that the `deliveryTag` is returned as a buffer,
while the `_unAcked` table is keyed by a string representing
`_sequence`. This caused `_unAcked` callbacks to be unretrievable when
the publication event was acknowledged.

The "fix" in this code at least identifies the error. The approach is to
read the last 4 bytes of the buffer. Note that the buffer is 8 bytes,
meaning we are ignoring the first 4 bytes. However, this is seeded with
the `_sequence` value (an integer) at send time, and therefore will
never be larger than 4 bytes anyway.