From c750931ac7ef5e90a64c7aee20f251665e06ea43 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sat, 19 Dec 2020 17:04:24 +0100 Subject: [PATCH] Update uWS, fix warnings --- src/AppWrapper.h | 4 ++-- src/addon.cpp | 12 ++++++------ uWebSockets | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/AppWrapper.h b/src/AppWrapper.h index 4e2f4a0..7c0ebe2 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -353,10 +353,10 @@ void uWS_App_publish(const FunctionCallbackInfo &args) { } /* This one modified per-thread static strings temporarily */ -std::pair readOptionsObject(const FunctionCallbackInfo &args, int index) { +std::pair readOptionsObject(const FunctionCallbackInfo &args, int index) { Isolate *isolate = args.GetIsolate(); /* Read the options object if any */ - us_socket_context_options_t options = {}; + uWS::SocketContextOptions options = {}; thread_local std::string keyFileName, certFileName, passphrase, dhParamsFileName, caFileName; if (args.Length() > index) { diff --git a/src/addon.cpp b/src/addon.cpp index 0740592..690dcf0 100644 --- a/src/addon.cpp +++ b/src/addon.cpp @@ -101,12 +101,12 @@ void uWS_getParts(const FunctionCallbackInfo &args) { Local partArrayBuffer = ArrayBuffer::New(isolate, (void *) part.data(), part.length()); /* Map is 30% faster in this case, but a static Object could be faster still */ Local 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++) { /* We care about content-type and content-disposition */ 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") { /* Parse the parameters */ uWS::ParameterParser pp(headers[i].second); @@ -118,13 +118,13 @@ void uWS_getParts(const FunctionCallbackInfo &args) { // really anything that has both key and value and is not type or data? 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); @@ -259,7 +259,7 @@ void uWS_getStringKeys(const FunctionCallbackInfo &args) { int offset = 0; 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); @@ -277,7 +277,7 @@ void uWS_getIntegerKeys(const FunctionCallbackInfo &args) { int offset = 0; 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); diff --git a/uWebSockets b/uWebSockets index 59a38b3..62ea463 160000 --- a/uWebSockets +++ b/uWebSockets @@ -1 +1 @@ -Subproject commit 59a38b3a1316eba2a0dd986f6ae6834f6260aa07 +Subproject commit 62ea46321d5fe93f4f52a96a27a836ae7bda75f3