0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 07:00:59 +01:00

bug fix: recving raw data was incorrect.

This commit is contained in:
Ryan 2009-04-22 13:59:28 +02:00
parent 5f902a61e1
commit 3095861199

View File

@ -442,7 +442,7 @@ Socket::Write (const Arguments& args)
oi_buf *buf = oi_buf_new2(length);
for (int i = 0; i < length; i++) {
Local<Value> int_value = array->Get(Integer::New(i));
buf->base[i] = int_value->Int32Value();
buf->base[i] = int_value->IntegerValue();
}
oi_socket_write(&socket->socket_, buf);
@ -499,7 +499,7 @@ Socket::OnRead (oi_socket *s, const void *buf, size_t count)
// raw encoding
Local<Array> array = Array::New(count);
for (int i = 0; i < count; i++) {
int val = static_cast<const int*>(buf)[i];
char val = static_cast<const char*>(buf)[i];
array->Set(Integer::New(i), Integer::New(val));
}
argv[0] = array;