Compare commits
8
Commits
v0.0.8
...
development
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7649a1ad4c | ||
|
|
3fd46cbbbc | ||
|
|
d99001d6eb | ||
|
|
fae86d2eb5 | ||
|
|
b964ea04df | ||
|
|
e4ca34aa59 | ||
|
|
9ddbfefa41 | ||
|
|
15f08f474f |
@@ -16,18 +16,15 @@ jobs:
|
|||||||
image: git.tesses.org/tesses50/linux-ppc:latest
|
image: git.tesses.org/tesses50/linux-ppc:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
url: https://git.tesses.org/tesses50/tessesframework.git
|
|
||||||
- run: bash build-for-ppc.sh
|
- run: bash build-for-ppc.sh
|
||||||
- uses: akkuman/gitea-release-action@v1
|
- uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
|
||||||
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |-
|
files: |-
|
||||||
artifacts/**
|
artifacts/**
|
||||||
update-tap-and-build-win32:
|
update-tap-and-build-win32:
|
||||||
name: "🔨 Build win32 and update the tap 🍺"
|
name: "🔨 Build win32 and update the tap 🍺"
|
||||||
runs-on: msi-walmart
|
runs-on: asrock
|
||||||
container: git.tesses.org/tesses50/global-containers-mingw:latest
|
container: git.tesses.org/tesses50/global-containers-mingw:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -37,8 +34,6 @@ jobs:
|
|||||||
env -C Packaging/WinToolsIntel bash build.sh
|
env -C Packaging/WinToolsIntel bash build.sh
|
||||||
|
|
||||||
- uses: akkuman/gitea-release-action@v1
|
- uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
|
||||||
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |-
|
files: |-
|
||||||
@@ -61,39 +56,36 @@ jobs:
|
|||||||
build-packages:
|
build-packages:
|
||||||
name: "🔨 Build for everything else"
|
name: "🔨 Build for everything else"
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- container: "git.tesses.org/tesses50/linux-x64:latest"
|
- container: "git.tesses.org/tesses50/linux-x64:latest"
|
||||||
puter: "msi-walmart"
|
puter: "asrock"
|
||||||
nfpmName: "amd64"
|
nfpmName: "amd64"
|
||||||
debianName: "x86_64-linux-gnu"
|
debianName: "x86_64-linux-gnu"
|
||||||
- container: "git.tesses.org/tesses50/linux-x86:latest"
|
- container: "git.tesses.org/tesses50/linux-x86:latest"
|
||||||
puter: "asrock"
|
puter: "msi-walmart"
|
||||||
nfpmName: "386"
|
nfpmName: "386"
|
||||||
debianName: "i386-linux-gnu"
|
debianName: "i386-linux-gnu"
|
||||||
- container: "git.tesses.org/tesses50/linux-arm:latest"
|
- container: "git.tesses.org/tesses50/linux-arm:latest"
|
||||||
puter: "fw13-ubuntu-latest"
|
puter: "msi-walmart"
|
||||||
nfpmName: "arm7"
|
nfpmName: "arm7"
|
||||||
debianName: "arm-linux-gnueabihf"
|
debianName: "arm-linux-gnueabihf"
|
||||||
- container: "git.tesses.org/tesses50/linux-arm64:latest"
|
- container: "git.tesses.org/tesses50/linux-arm64:latest"
|
||||||
puter: "msi-walmart"
|
puter: "asrock"
|
||||||
nfpmName: "arm64"
|
nfpmName: "arm64"
|
||||||
debianName: "aarch64-linux-gnu"
|
debianName: "aarch64-linux-gnu"
|
||||||
- container: "git.tesses.org/tesses50/linux-riscv64:latest"
|
- container: "git.tesses.org/tesses50/linux-riscv64:latest"
|
||||||
nfpmName: "riscv64"
|
nfpmName: "riscv64"
|
||||||
debianName: "riscv64-linux-gnu"
|
debianName: "riscv64-linux-gnu"
|
||||||
puter: "asrock"
|
puter: "msi-walmart"
|
||||||
runs-on: ${{ matrix.puter }}
|
runs-on: ${{ matrix.puter }}
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.container }}
|
image: ${{ matrix.container }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
url: https://git.tesses.org/tesses50/tessesframework.git
|
|
||||||
- run: bash build-for-nfpm.sh ${{ matrix.nfpmName }} ${{ matrix.debianName }}
|
- run: bash build-for-nfpm.sh ${{ matrix.nfpmName }} ${{ matrix.debianName }}
|
||||||
- uses: akkuman/gitea-release-action@v1
|
- uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
|
||||||
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |-
|
files: |-
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ Tesses Framework
|
|||||||
- MacOS
|
- MacOS
|
||||||
- FreeBSD (including GhostBSD)
|
- FreeBSD (including GhostBSD)
|
||||||
- NetBSD
|
- NetBSD
|
||||||
|
- Haiku (only static builds work as of right now)
|
||||||
- Wii (using libogc2, may be broken)
|
- Wii (using libogc2, may be broken)
|
||||||
- Switch (using libnx, may be broken)
|
- Switch (using libnx, may be broken)
|
||||||
- Android (kinda, uses legacy and hardcoded /sdcard api unless you use TF_AllowPortable(std::string))
|
- Android (kinda, uses legacy and hardcoded /sdcard api unless you use TF_AllowPortable(std::string))
|
||||||
|
|||||||
+6
-7
@@ -9,14 +9,13 @@ Json::JToken Html2JToken(std::shared_ptr<Html::HtmlNode> node) {
|
|||||||
} else {
|
} else {
|
||||||
Json::JObject obj;
|
Json::JObject obj;
|
||||||
obj.SetValue("Tag", node->text_or_tag);
|
obj.SetValue("Tag", node->text_or_tag);
|
||||||
Json::JArray attrs;
|
Json::JObject attrs;
|
||||||
for (auto &item : node->attributes) {
|
for (auto &item : node->attributes) {
|
||||||
if (item.second)
|
if (item.second) {
|
||||||
attrs.Add(Json::JObject(
|
attrs.SetValue(item.first, *item.second);
|
||||||
{{"Key", item.first}, {"Value", item.second.value()}}));
|
} else {
|
||||||
else
|
attrs.SetValue(item.first, nullptr);
|
||||||
attrs.Add(
|
}
|
||||||
Json::JObject({{"Key", item.first}, {"Value", nullptr}}));
|
|
||||||
}
|
}
|
||||||
obj.SetValue("Attributes", attrs);
|
obj.SetValue("Attributes", attrs);
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -58,13 +58,13 @@ int main(int argc, char **argv) {
|
|||||||
html->FindNodes("meta", metaTags);
|
html->FindNodes("meta", metaTags);
|
||||||
|
|
||||||
for (auto &meta : metaTags) {
|
for (auto &meta : metaTags) {
|
||||||
std::optional<std::string> prop, content;
|
auto prop_off = meta->attributes.find("property");
|
||||||
for (auto &[k, v] : meta->attributes) {
|
auto content_off = meta->attributes.find("content");
|
||||||
if (k == "property" && v)
|
if (!(prop_off != meta->attributes.end() &&
|
||||||
prop = *v;
|
content_off != meta->attributes.end()))
|
||||||
if (k == "content" && v)
|
continue;
|
||||||
content = *v;
|
auto &prop = prop_off->second;
|
||||||
}
|
auto &content = content_off->second;
|
||||||
|
|
||||||
if (prop && content && prop->find("og:") == 0) {
|
if (prop && content && prop->find("og:") == 0) {
|
||||||
Tesses::Framework::Console::WriteView(prop.value());
|
Tesses::Framework::Console::WriteView(prop.value());
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.0.11
|
||||||
|
Fix the event loop so it isn't 100% CPU utilization
|
||||||
|
|
||||||
|
## 0.0.10
|
||||||
|
Fix NX, add constant time compare
|
||||||
|
|
||||||
|
## 0.0.9
|
||||||
|
Make html parser use case insensitive unordered_map for attributes
|
||||||
|
|
||||||
## 0.0.8
|
## 0.0.8
|
||||||
Fixed a stoll bug that was there since day one, html parser, fix pkgconfig
|
Fixed a stoll bug that was there since day one, html parser, fix pkgconfig
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ endif()
|
|||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
mbedtls
|
mbedtls
|
||||||
URL https://downloads.tesses.net/cache/libraries/source/mbedtls-3.6.4.tar.bz2
|
URL https://downloads.tesses.net/cache/libraries/source/mbedtls-3.6.7.tar.bz2
|
||||||
|
|
||||||
)
|
)
|
||||||
if(NOT mbedtls_POPULATED)
|
if(NOT mbedtls_POPULATED)
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
set(TESSESFRAMEWORK_MAJOR_VERSION 0)
|
set(TESSESFRAMEWORK_MAJOR_VERSION 0)
|
||||||
set(TESSESFRAMEWORK_MINOR_VERSION 0)
|
set(TESSESFRAMEWORK_MINOR_VERSION 0)
|
||||||
set(TESSESFRAMEWORK_PATCH_VERSION 8)
|
set(TESSESFRAMEWORK_PATCH_VERSION 11)
|
||||||
|
|||||||
@@ -36,8 +36,11 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Tesses::Framework {
|
namespace Tesses::Framework {
|
||||||
|
|
||||||
|
|
||||||
class TF_Timer_Handle;
|
class TF_Timer_Handle;
|
||||||
// Used for internal purposes, don't use unless you want to run timer events on
|
// Used for internal purposes, don't use unless you want to run timer events on
|
||||||
// another thread
|
// another thread
|
||||||
|
|||||||
@@ -316,6 +316,9 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
bool PBKDF2(std::vector<uint8_t> &output, std::string pass,
|
bool PBKDF2(std::vector<uint8_t> &output, std::string pass,
|
||||||
std::vector<uint8_t> &salt, long itterations, ShaVersion version);
|
std::vector<uint8_t> &salt, long itterations, ShaVersion version);
|
||||||
|
|
||||||
|
bool ConstantEquals(const std::vector<uint8_t>& left, const std::vector<uint8_t>& right);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get secure random bytes
|
* @brief Get secure random bytes
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -21,13 +21,31 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../TextStreams/TextReader.hpp"
|
#include "../TextStreams/TextReader.hpp"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
namespace Tesses::Framework::Serialization::Html {
|
namespace Tesses::Framework::Serialization::Html {
|
||||||
|
|
||||||
|
struct CaseInsensitiveHash {
|
||||||
|
size_t operator()(const std::string &s) const {
|
||||||
|
std::string lower = s;
|
||||||
|
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
|
||||||
|
return std::hash<std::string>{}(lower);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CaseInsensitiveEqual {
|
||||||
|
bool operator()(const std::string &a, const std::string &b) const {
|
||||||
|
return strcasecmp(a.c_str(), b.c_str()) == 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct HtmlNode;
|
struct HtmlNode;
|
||||||
struct HtmlNode : public std::enable_shared_from_this<HtmlNode> {
|
struct HtmlNode : public std::enable_shared_from_this<HtmlNode> {
|
||||||
|
|
||||||
std::string text_or_tag;
|
std::string text_or_tag;
|
||||||
std::vector<std::pair<std::string, std::optional<std::string>>> attributes;
|
std::unordered_map<std::string, std::optional<std::string>,
|
||||||
|
CaseInsensitiveHash, CaseInsensitiveEqual>
|
||||||
|
attributes;
|
||||||
std::vector<std::shared_ptr<HtmlNode>> children;
|
std::vector<std::shared_ptr<HtmlNode>> children;
|
||||||
bool isText = false;
|
bool isText = false;
|
||||||
|
|
||||||
@@ -60,7 +78,8 @@ struct HtmlNode : public std::enable_shared_from_this<HtmlNode> {
|
|||||||
auto node = std::make_shared<HtmlNode>();
|
auto node = std::make_shared<HtmlNode>();
|
||||||
node->isText = false;
|
node->isText = false;
|
||||||
node->text_or_tag = std::string{name};
|
node->text_or_tag = std::string{name};
|
||||||
node->attributes.insert(node->attributes.end(), attrBegin, attrEnd);
|
for (auto it = attrBegin; it != attrEnd; ++it)
|
||||||
|
node->attributes[it->first] = it->second;
|
||||||
node->children.insert(node->children.end(), nodesBegin, nodesEnd);
|
node->children.insert(node->children.end(), nodesBegin, nodesEnd);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ class NetworkStream : public Stream {
|
|||||||
size_t ReadFrom(uint8_t *buff, size_t sz, std::string &ip, uint16_t &port);
|
size_t ReadFrom(uint8_t *buff, size_t sz, std::string &ip, uint16_t &port);
|
||||||
size_t WriteTo(const uint8_t *buff, size_t sz, std::string ip,
|
size_t WriteTo(const uint8_t *buff, size_t sz, std::string ip,
|
||||||
uint16_t port);
|
uint16_t port);
|
||||||
|
|
||||||
static std::vector<std::pair<std::string, std::string>>
|
static std::vector<std::pair<std::string, std::string>>
|
||||||
GetIPs(bool ipV6 = false);
|
GetIPs(bool ipV6 = false);
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class Stream {
|
|||||||
virtual size_t Write(const uint8_t *buff, size_t sz);
|
virtual size_t Write(const uint8_t *buff, size_t sz);
|
||||||
size_t ReadBlock(uint8_t *buff, size_t sz);
|
size_t ReadBlock(uint8_t *buff, size_t sz);
|
||||||
void WriteBlock(const uint8_t *buff, size_t sz);
|
void WriteBlock(const uint8_t *buff, size_t sz);
|
||||||
|
|
||||||
virtual bool CanRead();
|
virtual bool CanRead();
|
||||||
virtual bool CanWrite();
|
virtual bool CanWrite();
|
||||||
virtual bool CanSeek();
|
virtual bool CanSeek();
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ using StreamReader = Tesses::Framework::TextStreams::StreamReader;
|
|||||||
#include <mbedtls/net_sockets.h>
|
#include <mbedtls/net_sockets.h>
|
||||||
#include <mbedtls/ssl.h>
|
#include <mbedtls/ssl.h>
|
||||||
#include <mbedtls/x509.h>
|
#include <mbedtls/x509.h>
|
||||||
|
#include <mbedtls/version.h>
|
||||||
#endif
|
#endif
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
using namespace Tesses::Framework::Streams;
|
using namespace Tesses::Framework::Streams;
|
||||||
@@ -56,7 +57,6 @@ class ClientTLSPrivateData {
|
|||||||
mbedtls_pk_context client_key;
|
mbedtls_pk_context client_key;
|
||||||
|
|
||||||
~ClientTLSPrivateData() {
|
~ClientTLSPrivateData() {
|
||||||
strm->SetSendTimeout((uint64_t)7);
|
|
||||||
mbedtls_ssl_close_notify(&ssl);
|
mbedtls_ssl_close_notify(&ssl);
|
||||||
if (mTLS) {
|
if (mTLS) {
|
||||||
mbedtls_x509_crt_free(&client_cert);
|
mbedtls_x509_crt_free(&client_cert);
|
||||||
@@ -127,15 +127,23 @@ ClientTLSStream::ClientTLSStream(
|
|||||||
if ((ret = mbedtls_ctr_drbg_seed(
|
if ((ret = mbedtls_ctr_drbg_seed(
|
||||||
&data->ctr_drbg, mbedtls_entropy_func, &data->entropy,
|
&data->ctr_drbg, mbedtls_entropy_func, &data->entropy,
|
||||||
(const unsigned char *)pers, strlen(pers))) != 0) {
|
(const unsigned char *)pers, strlen(pers))) != 0) {
|
||||||
printf("FAILED mbedtls_ctr_drbg_seed\n");
|
|
||||||
return;
|
char buffer[100];
|
||||||
|
mbedtls_strerror(ret, buffer, sizeof(buffer));
|
||||||
|
std::string msg = "mbedtls_ctr_drbg_seed failed: " + std::string(buffer);
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mbedtls_x509_crt_parse(
|
ret = mbedtls_x509_crt_parse(
|
||||||
&data->cachain, (const unsigned char *)cert.c_str(), cert.size() + 1);
|
&data->cachain, (const unsigned char *)cert.c_str(), cert.size() + 1);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printf("FAILED mbedtls_x509_crt_parse cert %i\n", ret);
|
char buffer[100];
|
||||||
return;
|
mbedtls_strerror(ret, buffer, sizeof(buffer));
|
||||||
|
std::string msg = "mbedtls_x509_crt_parse failed: " + std::string(buffer);
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error(msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = mbedtls_ssl_config_defaults(&data->conf, MBEDTLS_SSL_IS_CLIENT,
|
if ((ret = mbedtls_ssl_config_defaults(&data->conf, MBEDTLS_SSL_IS_CLIENT,
|
||||||
@@ -143,8 +151,9 @@ ClientTLSStream::ClientTLSStream(
|
|||||||
MBEDTLS_SSL_PRESET_DEFAULT)) != 0) {
|
MBEDTLS_SSL_PRESET_DEFAULT)) != 0) {
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
mbedtls_strerror(ret, buffer, sizeof(buffer));
|
mbedtls_strerror(ret, buffer, sizeof(buffer));
|
||||||
printf("FAILED mbedtls_ssl_conf_defaults %s\n", buffer);
|
std::string msg = "mbedtls_ssl_conf_defaults failed: " + std::string(buffer);
|
||||||
return;
|
delete data;
|
||||||
|
throw std::runtime_error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_ssl_conf_rng(&data->conf, mbedtls_ctr_drbg_random, &data->ctr_drbg);
|
mbedtls_ssl_conf_rng(&data->conf, mbedtls_ctr_drbg_random, &data->ctr_drbg);
|
||||||
@@ -161,18 +170,25 @@ ClientTLSStream::ClientTLSStream(
|
|||||||
mbedtls_ssl_set_bio(&data->ssl, static_cast<void *>(data), strm_send,
|
mbedtls_ssl_set_bio(&data->ssl, static_cast<void *>(data), strm_send,
|
||||||
strm_recv, NULL);
|
strm_recv, NULL);
|
||||||
if ((ret = mbedtls_ssl_setup(&data->ssl, &data->conf) != 0)) {
|
if ((ret = mbedtls_ssl_setup(&data->ssl, &data->conf) != 0)) {
|
||||||
printf("FAILED mbedtls_ssl_setup %i\n", ret);
|
char errbuf[100];
|
||||||
return;
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
std::string msg = "SSL setup failed: " + std::string(errbuf);
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error(msg);
|
||||||
}
|
}
|
||||||
if ((ret = mbedtls_ssl_set_hostname(&data->ssl, domain.c_str()) != 0)) {
|
if ((ret = mbedtls_ssl_set_hostname(&data->ssl, domain.c_str()) != 0)) {
|
||||||
printf("FAILED mbedtls_ssl_set_hostname %i\n", ret);
|
char errbuf[100];
|
||||||
return;
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_ssl_set_hostname failed: " + std::string(errbuf));
|
||||||
}
|
}
|
||||||
if ((ret = mbedtls_ssl_handshake(&data->ssl)) != 0) {
|
if ((ret = mbedtls_ssl_handshake(&data->ssl)) != 0) {
|
||||||
char buffer[100];
|
|
||||||
mbedtls_strerror(ret, buffer, sizeof(buffer));
|
char errbuf[100];
|
||||||
printf("FAILED mbedtls_ssl_handshake %s\n", buffer);
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
return;
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_ssl_handshake failed: " + std::string(errbuf));
|
||||||
|
|
||||||
}
|
}
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
if ((flags = mbedtls_ssl_get_verify_result(&data->ssl)) != 0) {
|
if ((flags = mbedtls_ssl_get_verify_result(&data->ssl)) != 0) {
|
||||||
@@ -224,16 +240,20 @@ ClientTLSStream::ClientTLSStream(
|
|||||||
if ((ret = mbedtls_ctr_drbg_seed(
|
if ((ret = mbedtls_ctr_drbg_seed(
|
||||||
&data->ctr_drbg, mbedtls_entropy_func, &data->entropy,
|
&data->ctr_drbg, mbedtls_entropy_func, &data->entropy,
|
||||||
(const unsigned char *)pers, strlen(pers))) != 0) {
|
(const unsigned char *)pers, strlen(pers))) != 0) {
|
||||||
printf("FAILED mbedtls_ctr_drbg_seed\n");
|
char errbuf[100];
|
||||||
return;
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_ctr_drbg_seed failed: " + std::string(errbuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mbedtls_x509_crt_parse(
|
ret = mbedtls_x509_crt_parse(
|
||||||
&data->cachain, (const unsigned char *)cert.c_str(), cert.size() + 1);
|
&data->cachain, (const unsigned char *)cert.c_str(), cert.size() + 1);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printf("FAILED mbedtls_x509_crt_parse chain %i\n", ret);
|
char errbuf[100];
|
||||||
return;
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_x509_crt_parse chain failed: " + std::string(errbuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mbedtls_x509_crt_parse(
|
ret = mbedtls_x509_crt_parse(
|
||||||
@@ -241,30 +261,44 @@ ClientTLSStream::ClientTLSStream(
|
|||||||
keyStore.certificate.size() + 1);
|
keyStore.certificate.size() + 1);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printf("FAILED mbedtls_x509_crt_parse client_certificate %i\n", ret);
|
|
||||||
return;
|
char errbuf[100];
|
||||||
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_x509_crt_parse client_certificate failed: " + std::string(errbuf));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mbedtls_pk_parse_key(
|
ret = mbedtls_pk_parse_key(
|
||||||
&data->client_key, (const unsigned char *)keyStore.certificate.c_str(),
|
&data->client_key, (const unsigned char *)keyStore.key.c_str(),
|
||||||
keyStore.certificate.size() + 1,
|
keyStore.key.size() + 1,
|
||||||
keyStore.password.empty()
|
keyStore.password.empty()
|
||||||
? NULL
|
? NULL
|
||||||
: (const unsigned char *)keyStore.password.c_str(),
|
: (const unsigned char *)keyStore.password.c_str(),
|
||||||
keyStore.password.size(), mbedtls_entropy_func, &data->entropy);
|
keyStore.password.size() + 1
|
||||||
|
#if MBEDTLS_VERSION_MAJOR == 3
|
||||||
|
, mbedtls_entropy_func, &data->entropy
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printf("FAILED mbedtls_x509_crt_parse client_certificate %i\n", ret);
|
char errbuf[100];
|
||||||
return;
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_pk_parse_key failed: " + std::string(errbuf));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = mbedtls_ssl_config_defaults(&data->conf, MBEDTLS_SSL_IS_CLIENT,
|
if ((ret = mbedtls_ssl_config_defaults(&data->conf, MBEDTLS_SSL_IS_CLIENT,
|
||||||
MBEDTLS_SSL_TRANSPORT_STREAM,
|
MBEDTLS_SSL_TRANSPORT_STREAM,
|
||||||
MBEDTLS_SSL_PRESET_DEFAULT)) != 0) {
|
MBEDTLS_SSL_PRESET_DEFAULT)) != 0) {
|
||||||
char buffer[100];
|
|
||||||
mbedtls_strerror(ret, buffer, sizeof(buffer));
|
char errbuf[100];
|
||||||
printf("FAILED mbedtls_ssl_conf_defaults %s\n", buffer);
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
return;
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_ssl_conf_defaults failed: " + std::string(errbuf));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_ssl_conf_rng(&data->conf, mbedtls_ctr_drbg_random, &data->ctr_drbg);
|
mbedtls_ssl_conf_rng(&data->conf, mbedtls_ctr_drbg_random, &data->ctr_drbg);
|
||||||
@@ -284,18 +318,26 @@ ClientTLSStream::ClientTLSStream(
|
|||||||
mbedtls_ssl_set_bio(&data->ssl, static_cast<void *>(data), strm_send,
|
mbedtls_ssl_set_bio(&data->ssl, static_cast<void *>(data), strm_send,
|
||||||
strm_recv, NULL);
|
strm_recv, NULL);
|
||||||
if ((ret = mbedtls_ssl_setup(&data->ssl, &data->conf) != 0)) {
|
if ((ret = mbedtls_ssl_setup(&data->ssl, &data->conf) != 0)) {
|
||||||
printf("FAILED mbedtls_ssl_setup %i\n", ret);
|
|
||||||
return;
|
char errbuf[100];
|
||||||
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_ssl_setup failed: " + std::string(errbuf));
|
||||||
|
|
||||||
}
|
}
|
||||||
if ((ret = mbedtls_ssl_set_hostname(&data->ssl, domain.c_str()) != 0)) {
|
if ((ret = mbedtls_ssl_set_hostname(&data->ssl, domain.c_str()) != 0)) {
|
||||||
printf("FAILED mbedtls_ssl_set_hostname %i\n", ret);
|
char errbuf[100];
|
||||||
return;
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_ssl_set_hostname failed: " + std::string(errbuf));
|
||||||
}
|
}
|
||||||
if ((ret = mbedtls_ssl_handshake(&data->ssl)) != 0) {
|
if ((ret = mbedtls_ssl_handshake(&data->ssl)) != 0) {
|
||||||
char buffer[100];
|
|
||||||
mbedtls_strerror(ret, buffer, sizeof(buffer));
|
char errbuf[100];
|
||||||
printf("FAILED mbedtls_ssl_handshake %s\n", buffer);
|
mbedtls_strerror(ret, errbuf, sizeof(errbuf));
|
||||||
return;
|
delete data;
|
||||||
|
throw std::runtime_error("mbedtls_ssl_handshake failed: " + std::string(errbuf));
|
||||||
|
|
||||||
}
|
}
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
if ((flags = mbedtls_ssl_get_verify_result(&data->ssl)) != 0) {
|
if ((flags = mbedtls_ssl_get_verify_result(&data->ssl)) != 0) {
|
||||||
@@ -327,10 +369,16 @@ size_t ClientTLSStream::Read(uint8_t *buffer, size_t len) {
|
|||||||
return 0;
|
return 0;
|
||||||
int r = mbedtls_ssl_read(&priv->ssl, buffer, len);
|
int r = mbedtls_ssl_read(&priv->ssl, buffer, len);
|
||||||
|
|
||||||
if (r == -30848) {
|
if (r == 0) {
|
||||||
priv->eos = true;
|
priv->eos = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (r < 0) {
|
||||||
|
char errbuf[100];
|
||||||
|
mbedtls_strerror(r, errbuf, sizeof(errbuf));
|
||||||
|
std::string msg = "Read failed: " + std::string(errbuf);
|
||||||
|
throw std::runtime_error(msg);
|
||||||
|
}
|
||||||
return (size_t)r;
|
return (size_t)r;
|
||||||
#else
|
#else
|
||||||
return (size_t)0;
|
return (size_t)0;
|
||||||
@@ -342,6 +390,16 @@ size_t ClientTLSStream::Write(const uint8_t *buffer, size_t len) {
|
|||||||
if (!priv->success)
|
if (!priv->success)
|
||||||
return 0;
|
return 0;
|
||||||
int r = mbedtls_ssl_write(&priv->ssl, buffer, len);
|
int r = mbedtls_ssl_write(&priv->ssl, buffer, len);
|
||||||
|
if (r == 0) {
|
||||||
|
priv->eos = true;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (r < 0) {
|
||||||
|
char errbuf[100];
|
||||||
|
mbedtls_strerror(r, errbuf, sizeof(errbuf));
|
||||||
|
std::string msg = "Write failed: " + std::string(errbuf);
|
||||||
|
throw std::runtime_error(msg);
|
||||||
|
}
|
||||||
return (size_t)r;
|
return (size_t)r;
|
||||||
#else
|
#else
|
||||||
return (size_t)0;
|
return (size_t)0;
|
||||||
|
|||||||
@@ -377,4 +377,20 @@ bool RandomBytes(std::vector<uint8_t> &output, std::string personal_str) {
|
|||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool ConstantEquals(const std::vector<uint8_t>& left, const std::vector<uint8_t>& right)
|
||||||
|
{
|
||||||
|
if (left.size() != right.size()) return false;
|
||||||
|
if (left.empty()) return true;
|
||||||
|
|
||||||
|
const auto* pa = left.data();
|
||||||
|
const auto* pb = right.data();
|
||||||
|
const auto n = left.size();
|
||||||
|
|
||||||
|
uint8_t diff = 0;
|
||||||
|
for (size_t i = 0; i < n; i++)
|
||||||
|
diff |= pa[i] ^ pb[i];
|
||||||
|
|
||||||
|
return diff == 0;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Tesses::Framework::Crypto
|
} // namespace Tesses::Framework::Crypto
|
||||||
|
|||||||
@@ -282,13 +282,23 @@ FIFOCreationResult LocalFilesystem::CreateFIFO(VFSPath path, uint32_t mod) {
|
|||||||
void LocalFilesystem::Lock(VFSPath path) {
|
void LocalFilesystem::Lock(VFSPath path) {
|
||||||
auto p2 = VFSPathToSystem(path);
|
auto p2 = VFSPathToSystem(path);
|
||||||
const char *fopenPath = p2.c_str();
|
const char *fopenPath = p2.c_str();
|
||||||
while (true) {
|
for (int i = 0; i < 10; i++) {
|
||||||
FILE *fp = fopen(fopenPath, "wx");
|
FILE *fp = fopen(fopenPath, "wx");
|
||||||
if (fp) {
|
if (fp) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (errno != EEXIST) {
|
||||||
|
std::string error_msg("Failed to acquire lock on ");
|
||||||
|
error_msg += p2;
|
||||||
|
error_msg += ": ";
|
||||||
|
error_msg += strerror(errno);
|
||||||
|
throw std::runtime_error(error_msg);
|
||||||
}
|
}
|
||||||
|
TF_Sleep(100);
|
||||||
|
}
|
||||||
|
throw std::runtime_error("Lock acquisition timed out for " + p2);
|
||||||
}
|
}
|
||||||
void LocalFilesystem::Unlock(VFSPath path) {
|
void LocalFilesystem::Unlock(VFSPath path) {
|
||||||
std::error_code error;
|
std::error_code error;
|
||||||
|
|||||||
@@ -332,12 +332,16 @@ std::string GetPlatform() {
|
|||||||
#if TARGET_OS_WATCH
|
#if TARGET_OS_WATCH
|
||||||
return "Apple Watch";
|
return "Apple Watch";
|
||||||
#endif
|
#endif
|
||||||
|
return "Unknown Apple Device";
|
||||||
#if __EMSCRIPTEN__
|
#endif
|
||||||
|
#if defined(__EMSCRIPTEN__)
|
||||||
return "WebAssembly";
|
return "WebAssembly";
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__HAIKU__)
|
||||||
return "Unknown Apple Device";
|
return "Haiku";
|
||||||
|
#endif
|
||||||
|
#if defined(__TessesOS__)
|
||||||
|
return "TessesOS";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
|
|||||||
@@ -360,16 +360,15 @@ struct HtmlParser {
|
|||||||
if (v.type ==
|
if (v.type ==
|
||||||
HtmlLexTokenType::STRING) {
|
HtmlLexTokenType::STRING) {
|
||||||
Read();
|
Read();
|
||||||
newNode->attributes.emplace_back(
|
newNode->attributes[k.text] =
|
||||||
k.text,
|
|
||||||
Http::HttpUtils::HtmlDecode(
|
Http::HttpUtils::HtmlDecode(
|
||||||
v.text));
|
v.text);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newNode->attributes.emplace_back(k.text,
|
newNode->attributes[k.text] = std::nullopt;
|
||||||
std::nullopt);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-14
@@ -98,13 +98,7 @@ static GXRModeObj *rmode = NULL;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Tesses::Framework {
|
namespace Tesses::Framework {
|
||||||
#if defined(TESSESFRAMEWORK_ENABLE_THREADING) && \
|
|
||||||
(defined(GEKKO) || defined(__SWITCH__))
|
|
||||||
namespace Threading {
|
|
||||||
extern void JoinAllThreads();
|
|
||||||
extern void LookForFinishedThreads();
|
|
||||||
} // namespace Threading
|
|
||||||
#endif
|
|
||||||
volatile static bool isRunningSig = true;
|
volatile static bool isRunningSig = true;
|
||||||
volatile static std::atomic<bool> isRunning;
|
volatile static std::atomic<bool> isRunning;
|
||||||
volatile static std::atomic<bool> gaming_console_events = true;
|
volatile static std::atomic<bool> gaming_console_events = true;
|
||||||
@@ -268,10 +262,6 @@ int64_t TF_Timer_Handle::GetIntervalMilliseconds() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TF_RunEventLoopItteration() {
|
void TF_RunEventLoopItteration() {
|
||||||
#if defined(TESSESFRAMEWORK_ENABLE_THREADING) && (defined(__SWITCH__))
|
|
||||||
Tesses::Framework::Threading::LookForFinishedThreads();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#if defined(TESSESFRAMEWORK_ENABLE_THREADING)
|
#if defined(TESSESFRAMEWORK_ENABLE_THREADING)
|
||||||
invokings_mtx.Lock();
|
invokings_mtx.Lock();
|
||||||
auto invokes = invokings;
|
auto invokes = invokings;
|
||||||
@@ -315,13 +305,11 @@ void TF_RunEventLoopItteration() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
timer_handler->Update();
|
timer_handler->Update();
|
||||||
|
TF_Sleep(1);
|
||||||
}
|
}
|
||||||
void TF_SetIsRunning(bool _isRunning) { isRunning = _isRunning; }
|
void TF_SetIsRunning(bool _isRunning) { isRunning = _isRunning; }
|
||||||
void TF_Quit() {
|
void TF_Quit() {
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
#if defined(TESSESFRAMEWORK_ENABLE_THREADING) && (defined(__SWITCH__))
|
|
||||||
Tesses::Framework::Threading::JoinAllThreads();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
void TF_InitEventLoop() {
|
void TF_InitEventLoop() {
|
||||||
signal(SIGINT, _sigInt);
|
signal(SIGINT, _sigInt);
|
||||||
|
|||||||
+2
-102
@@ -40,89 +40,6 @@ namespace Tesses::Framework::Threading {
|
|||||||
|
|
||||||
#if defined(TESSESFRAMEWORK_ENABLE_THREADING)
|
#if defined(TESSESFRAMEWORK_ENABLE_THREADING)
|
||||||
|
|
||||||
#if defined(__SWITCH__)
|
|
||||||
Mutex needed_to_be_joined_mtx;
|
|
||||||
class NeedToBeJoinnedThread {
|
|
||||||
|
|
||||||
static void *cb(void *data) {
|
|
||||||
|
|
||||||
auto ntbjt = static_cast<NeedToBeJoinnedThread *>(data);
|
|
||||||
|
|
||||||
ntbjt->hasInvoked = true;
|
|
||||||
TF_LOG("About to call thread func");
|
|
||||||
if (ntbjt->_cb)
|
|
||||||
ntbjt->_cb();
|
|
||||||
TF_LOG("Finished calling thread func");
|
|
||||||
ntbjt->hasExited = true;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
std::function<void()> _cb;
|
|
||||||
std::atomic<bool> hasInvoked = false;
|
|
||||||
|
|
||||||
pthread_t thrd;
|
|
||||||
|
|
||||||
public:
|
|
||||||
NeedToBeJoinnedThread(std::function<void()> cb) {
|
|
||||||
this->_cb = cb;
|
|
||||||
joinned = false;
|
|
||||||
joinning = false;
|
|
||||||
hasExited = false;
|
|
||||||
|
|
||||||
pthread_create(&thrd, NULL, this->cb, static_cast<void *>(this));
|
|
||||||
}
|
|
||||||
std::atomic<bool> joinned;
|
|
||||||
std::atomic<bool> joinning;
|
|
||||||
std::atomic<bool> hasExited;
|
|
||||||
void Join();
|
|
||||||
void WaitTillInvoked() {
|
|
||||||
while (!hasInvoked)
|
|
||||||
;
|
|
||||||
TF_LOG("Invoked!");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void NeedToBeJoinnedThread::Join() {
|
|
||||||
if (joinning) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
joinning = true;
|
|
||||||
pthread_join(this->thrd, NULL);
|
|
||||||
|
|
||||||
joinned = true;
|
|
||||||
// start the joinning process
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::shared_ptr<NeedToBeJoinnedThread>> needToBeJoinnedThread;
|
|
||||||
void JoinAllThreads() {
|
|
||||||
needed_to_be_joined_mtx.Lock();
|
|
||||||
for (auto item : needToBeJoinnedThread) {
|
|
||||||
item->Join();
|
|
||||||
}
|
|
||||||
needToBeJoinnedThread.clear();
|
|
||||||
needed_to_be_joined_mtx.Unlock();
|
|
||||||
}
|
|
||||||
void LookForFinishedThreads() {
|
|
||||||
|
|
||||||
needed_to_be_joined_mtx.Lock();
|
|
||||||
for (auto index = needToBeJoinnedThread.begin();
|
|
||||||
index < needToBeJoinnedThread.end(); index++) {
|
|
||||||
auto &idx = *index;
|
|
||||||
if (idx->hasExited) {
|
|
||||||
if (idx->joinning)
|
|
||||||
while (!idx->joinned)
|
|
||||||
;
|
|
||||||
TF_LOG("ABOUT TO JOIN");
|
|
||||||
idx->Join();
|
|
||||||
TF_LOG("JOINNED");
|
|
||||||
needToBeJoinnedThread.erase(index);
|
|
||||||
index--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
needed_to_be_joined_mtx.Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
class ThreadHiddenFieldData : public HiddenFieldData {
|
class ThreadHiddenFieldData : public HiddenFieldData {
|
||||||
public:
|
public:
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
@@ -130,8 +47,7 @@ class ThreadHiddenFieldData : public HiddenFieldData {
|
|||||||
HANDLE thrd;
|
HANDLE thrd;
|
||||||
DWORD thrdId;
|
DWORD thrdId;
|
||||||
|
|
||||||
#elif defined(__SWITCH__)
|
|
||||||
std::shared_ptr<NeedToBeJoinnedThread> thread;
|
|
||||||
#else
|
#else
|
||||||
pthread_t thrd;
|
pthread_t thrd;
|
||||||
#endif
|
#endif
|
||||||
@@ -143,8 +59,6 @@ class ThreadHiddenFieldData : public HiddenFieldData {
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
static DWORD __stdcall cb(LPVOID data)
|
static DWORD __stdcall cb(LPVOID data)
|
||||||
#elif defined(__SWITCH__)
|
|
||||||
static void cb(void *data)
|
|
||||||
#else
|
#else
|
||||||
static void *cb(void *data)
|
static void *cb(void *data)
|
||||||
#endif
|
#endif
|
||||||
@@ -154,10 +68,8 @@ static void *cb(void *data)
|
|||||||
auto fn = thrd->fn;
|
auto fn = thrd->fn;
|
||||||
thrd->hasInvoked = true;
|
thrd->hasInvoked = true;
|
||||||
fn();
|
fn();
|
||||||
#if !defined(_WIN32) && !defined(__SWITCH__)
|
#if !defined(_WIN32)
|
||||||
return NULL;
|
return NULL;
|
||||||
#elif (__SWITCH__)
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -174,9 +86,6 @@ Thread::Thread(std::function<void()> fn) {
|
|||||||
CreateThread(NULL, 0, cb, static_cast<LPVOID>(data), 0, &data->thrdId);
|
CreateThread(NULL, 0, cb, static_cast<LPVOID>(data), 0, &data->thrdId);
|
||||||
while (!data->hasInvoked)
|
while (!data->hasInvoked)
|
||||||
;
|
;
|
||||||
#elif defined(__SWITCH__)
|
|
||||||
data->thread = std::make_shared<NeedToBeJoinnedThread>(fn);
|
|
||||||
data->thread->WaitTillInvoked();
|
|
||||||
// threadCreate(,cb,static_cast<void*>(data),NULL,8000000,0x00,-2);
|
// threadCreate(,cb,static_cast<void*>(data),NULL,8000000,0x00,-2);
|
||||||
#else
|
#else
|
||||||
pthread_create(&data->thrd, NULL, cb, static_cast<void *>(data));
|
pthread_create(&data->thrd, NULL, cb, static_cast<void *>(data));
|
||||||
@@ -193,13 +102,6 @@ void Thread::Detach() {
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
CloseHandle(data->thrd);
|
CloseHandle(data->thrd);
|
||||||
#elif defined(__SWITCH__)
|
|
||||||
TF_LOG("Detaching");
|
|
||||||
needed_to_be_joined_mtx.Lock();
|
|
||||||
needToBeJoinnedThread.push_back(data->thread);
|
|
||||||
needed_to_be_joined_mtx.Unlock();
|
|
||||||
|
|
||||||
TF_LOG("Detached!");
|
|
||||||
#else
|
#else
|
||||||
pthread_detach(data->thrd);
|
pthread_detach(data->thrd);
|
||||||
#endif
|
#endif
|
||||||
@@ -212,8 +114,6 @@ void Thread::Join() {
|
|||||||
auto data = this->data.GetField<ThreadHiddenFieldData *>();
|
auto data = this->data.GetField<ThreadHiddenFieldData *>();
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
WaitForSingleObject(data->thrd, INFINITE);
|
WaitForSingleObject(data->thrd, INFINITE);
|
||||||
#elif defined(__SWITCH__)
|
|
||||||
data->thread->Join();
|
|
||||||
#else
|
#else
|
||||||
pthread_join(data->thrd, NULL);
|
pthread_join(data->thrd, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user