SlowBuffer not accepted as Buffer #79

cynic opened this Issue Mar 17, 2012 · 0 comments


None yet
1 participant

cynic commented Mar 17, 2012

The Protobuf C++ module for node generates SlowBuffers, rather than Buffers (I believe that most modules with a native component will do the same ... Buffers appear to be more difficult to manipulate from C++). These can't be passed along to AMQP, because of the check on amqp.js line 1135 for body instanceof Buffer. That check should probably be Buffer.isBuffer(body) instead, otherwise the check fails and AMQP regards the SlowBuffer as JSON and tries to encode it. There are a few more cases in the source where instanceof Buffer is used, and most of them should probably be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment