mirror of
https://github.com/uNetworking/uWebSockets.js.git
synced 2026-04-06 20:00:24 -04:00
Hand copies of ArrayBuffers where we have to
This commit is contained in:
@@ -106,8 +106,7 @@ struct HttpResponseWrapper {
|
||||
if (res) {
|
||||
std::string_view ip = res->getRemoteAddress();
|
||||
|
||||
/* Todo: we need to pass a copy here */
|
||||
args.GetReturnValue().Set(ArrayBuffer_New(isolate, (void *) ip.data(), ip.length()/*, ArrayBufferCreationMode::kInternalized*/));
|
||||
args.GetReturnValue().Set(ArrayBuffer_NewCopy(isolate, (void *) ip.data(), ip.length()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,8 +118,7 @@ struct HttpResponseWrapper {
|
||||
if (res) {
|
||||
std::string_view ip = res->getRemoteAddressAsText();
|
||||
|
||||
/* Todo: we need to pass a copy here */
|
||||
args.GetReturnValue().Set(ArrayBuffer_New(isolate, (void *) ip.data(), ip.length()/*, ArrayBufferCreationMode::kInternalized*/));
|
||||
args.GetReturnValue().Set(ArrayBuffer_NewCopy(isolate, (void *) ip.data(), ip.length()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,8 +130,7 @@ struct HttpResponseWrapper {
|
||||
if (res) {
|
||||
std::string_view ip = res->getProxiedRemoteAddress();
|
||||
|
||||
/* Todo: we need to pass a copy here */
|
||||
args.GetReturnValue().Set(ArrayBuffer_New(isolate, (void *) ip.data(), ip.length()/*, ArrayBufferCreationMode::kInternalized*/));
|
||||
args.GetReturnValue().Set(ArrayBuffer_NewCopy(isolate, (void *) ip.data(), ip.length()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,8 +142,7 @@ struct HttpResponseWrapper {
|
||||
if (res) {
|
||||
std::string_view ip = res->getProxiedRemoteAddressAsText();
|
||||
|
||||
/* Todo: we need to pass a copy here */
|
||||
args.GetReturnValue().Set(ArrayBuffer_New(isolate, (void *) ip.data(), ip.length()/*, ArrayBufferCreationMode::kInternalized*/));
|
||||
args.GetReturnValue().Set(ArrayBuffer_NewCopy(isolate, (void *) ip.data(), ip.length()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user