mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-09 11:05:24 +00:00
[engine] [cocos2d-x] [jsb-adapter] 适配引擎 v2.4.12 版本
This commit is contained in:
@@ -30,6 +30,7 @@ THE SOFTWARE.
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
|
||||
#include "base/ccMacros.h"
|
||||
|
||||
|
@@ -174,11 +174,11 @@ static bool configureCURL(HttpClient* client, HttpRequest* request, CURL* handle
|
||||
if (code != CURLE_OK) {
|
||||
return false;
|
||||
}
|
||||
code = curl_easy_setopt(handle, CURLOPT_TIMEOUT, request->getTimeout());
|
||||
code = curl_easy_setopt(handle, CURLOPT_TIMEOUT, static_cast<long>(request->getTimeout()));
|
||||
if (code != CURLE_OK) {
|
||||
return false;
|
||||
}
|
||||
code = curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, request->getTimeout());
|
||||
code = curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, static_cast<long>(request->getTimeout()));
|
||||
if (code != CURLE_OK) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -263,7 +263,7 @@ static std::mutex __instanceMutex;
|
||||
static struct lws_context* __wsContext = nullptr;
|
||||
static WsThreadHelper* __wsHelper = nullptr;
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
|
||||
static std::string getFileNameForPath(const std::string& filePath)
|
||||
{
|
||||
std::string fileName = filePath;
|
||||
@@ -852,7 +852,7 @@ void WebSocketImpl::close()
|
||||
}
|
||||
|
||||
void WebSocketImpl::closeAsync(int code, const std::string &reason)
|
||||
{
|
||||
{
|
||||
if (_wsInstance)
|
||||
{
|
||||
lws_close_reason(_wsInstance, (lws_close_status)code, (unsigned char*)const_cast<char*>(reason.c_str()), reason.length());
|
||||
@@ -917,7 +917,7 @@ struct lws_vhost* WebSocketImpl::createVhost(struct lws_protocols* protocols, in
|
||||
{
|
||||
if (isCAFileExist)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
|
||||
// if ca file is in the apk, try to extract it to writable path
|
||||
std::string writablePath = fileUtils->getWritablePath();
|
||||
std::string caFileName = getFileNameForPath(_caFilePath);
|
||||
|
Reference in New Issue
Block a user