Created
September 10, 2010 08:34
-
-
Save bpot/573317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/msgpack.cc b/src/msgpack.cc | |
index 5374c3b..6bf6c36 100644 | |
--- a/src/msgpack.cc | |
+++ b/src/msgpack.cc | |
@@ -233,8 +233,11 @@ msgpack_to_v8(msgpack_object *mo) { | |
return a; | |
} | |
- case MSGPACK_OBJECT_RAW: | |
- return String::New(mo->via.raw.ptr, mo->via.raw.size); | |
+ case MSGPACK_OBJECT_RAW: { | |
+ Buffer *bp = Buffer::New(mo->via.raw.size); | |
+ memcpy(bp->data(), mo->via.raw.ptr, mo->via.raw.size); | |
+ return bp->handle_; | |
+ } | |
case MSGPACK_OBJECT_MAP: { | |
Local<Object> o = Object::New(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment