Update uWS, fix warnings

This commit is contained in:
Alex Hultman 2020-12-19 17:04:24 +01:00
parent 7b8534ee40
commit c750931ac7
3 changed files with 9 additions and 9 deletions

View File

@ -353,10 +353,10 @@ void uWS_App_publish(const FunctionCallbackInfo<Value> &args) {
} }
/* This one modified per-thread static strings temporarily */ /* This one modified per-thread static strings temporarily */
std::pair<struct us_socket_context_options_t, bool> readOptionsObject(const FunctionCallbackInfo<Value> &args, int index) { std::pair<uWS::SocketContextOptions, bool> readOptionsObject(const FunctionCallbackInfo<Value> &args, int index) {
Isolate *isolate = args.GetIsolate(); Isolate *isolate = args.GetIsolate();
/* Read the options object if any */ /* Read the options object if any */
us_socket_context_options_t options = {}; uWS::SocketContextOptions options = {};
thread_local std::string keyFileName, certFileName, passphrase, dhParamsFileName, caFileName; thread_local std::string keyFileName, certFileName, passphrase, dhParamsFileName, caFileName;
if (args.Length() > index) { if (args.Length() > index) {

View File

@ -101,12 +101,12 @@ void uWS_getParts(const FunctionCallbackInfo<Value> &args) {
Local<ArrayBuffer> partArrayBuffer = ArrayBuffer::New(isolate, (void *) part.data(), part.length()); Local<ArrayBuffer> partArrayBuffer = ArrayBuffer::New(isolate, (void *) part.data(), part.length());
/* Map is 30% faster in this case, but a static Object could be faster still */ /* Map is 30% faster in this case, but a static Object could be faster still */
Local<Object> partMap = Object::New(isolate); Local<Object> partMap = Object::New(isolate);
partMap->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "data", NewStringType::kNormal).ToLocalChecked(), partArrayBuffer); partMap->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "data", NewStringType::kNormal).ToLocalChecked(), partArrayBuffer).IsNothing();
for (int i = 0; headers[i].first.length(); i++) { for (int i = 0; headers[i].first.length(); i++) {
/* We care about content-type and content-disposition */ /* We care about content-type and content-disposition */
if (headers[i].first == "content-type") { if (headers[i].first == "content-type") {
partMap->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "type", NewStringType::kNormal).ToLocalChecked(), String::NewFromUtf8(isolate, headers[i].second.data(), NewStringType::kNormal, headers[i].second.length()).ToLocalChecked()); partMap->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "type", NewStringType::kNormal).ToLocalChecked(), String::NewFromUtf8(isolate, headers[i].second.data(), NewStringType::kNormal, headers[i].second.length()).ToLocalChecked()).IsNothing();
} else if (headers[i].first == "content-disposition") { } else if (headers[i].first == "content-disposition") {
/* Parse the parameters */ /* Parse the parameters */
uWS::ParameterParser pp(headers[i].second); uWS::ParameterParser pp(headers[i].second);
@ -118,13 +118,13 @@ void uWS_getParts(const FunctionCallbackInfo<Value> &args) {
// really anything that has both key and value and is not type or data? // really anything that has both key and value and is not type or data?
if (key == "name" || key == "filename") { if (key == "name" || key == "filename") {
partMap->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, key.data(), NewStringType::kNormal, key.length()).ToLocalChecked(), String::NewFromUtf8(isolate, value.data(), NewStringType::kNormal, value.length()).ToLocalChecked()); partMap->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, key.data(), NewStringType::kNormal, key.length()).ToLocalChecked(), String::NewFromUtf8(isolate, value.data(), NewStringType::kNormal, value.length()).ToLocalChecked()).IsNothing();
} }
} }
} }
} }
parts->Set(isolate->GetCurrentContext(), parts->Length(), partMap); parts->Set(isolate->GetCurrentContext(), parts->Length(), partMap).IsNothing();
} }
args.GetReturnValue().Set(parts); args.GetReturnValue().Set(parts);
@ -259,7 +259,7 @@ void uWS_getStringKeys(const FunctionCallbackInfo<Value> &args) {
int offset = 0; int offset = 0;
for (auto p : kvStoreString[std::string(collection.getString())]) { for (auto p : kvStoreString[std::string(collection.getString())]) {
stringKeys->Set(args.GetIsolate()->GetCurrentContext(), offset++, String::NewFromUtf8(args.GetIsolate(), p.first.data(), NewStringType::kNormal, p.first.length()).ToLocalChecked()); stringKeys->Set(args.GetIsolate()->GetCurrentContext(), offset++, String::NewFromUtf8(args.GetIsolate(), p.first.data(), NewStringType::kNormal, p.first.length()).ToLocalChecked()).IsNothing();
} }
args.GetReturnValue().Set(stringKeys); args.GetReturnValue().Set(stringKeys);
@ -277,7 +277,7 @@ void uWS_getIntegerKeys(const FunctionCallbackInfo<Value> &args) {
int offset = 0; int offset = 0;
for (auto p : kvStoreInteger[std::string(collection.getString())]) { for (auto p : kvStoreInteger[std::string(collection.getString())]) {
integerKeys->Set(args.GetIsolate()->GetCurrentContext(), offset++, String::NewFromUtf8(args.GetIsolate(), p.first.data(), NewStringType::kNormal, p.first.length()).ToLocalChecked()); integerKeys->Set(args.GetIsolate()->GetCurrentContext(), offset++, String::NewFromUtf8(args.GetIsolate(), p.first.data(), NewStringType::kNormal, p.first.length()).ToLocalChecked()).IsNothing();
} }
args.GetReturnValue().Set(integerKeys); args.GetReturnValue().Set(integerKeys);

@ -1 +1 @@
Subproject commit 59a38b3a1316eba2a0dd986f6ae6834f6260aa07 Subproject commit 62ea46321d5fe93f4f52a96a27a836ae7bda75f3