修复linux_x86构建和tfo定义 (#3)

* fix:libcurl build error

* fix:tfo define error
This commit is contained in:
auqhjjqdo 2023-03-20 00:33:37 +08:00 committed by GitHub
parent d856bf7da7
commit 359ff83a07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 15 deletions

View File

@ -4,8 +4,9 @@ set -xe
apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool python2 apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool python2
apk add mbedtls-dev mbedtls-static zlib-dev rapidjson-dev libevent-dev libevent-static zlib-static pcre2-dev apk add mbedtls-dev mbedtls-static zlib-dev rapidjson-dev libevent-dev libevent-static zlib-static pcre2-dev
git clone https://github.com/curl/curl --depth=1 git clone https://github.com/curl/curl
cd curl cd curl
git checkout curl-7_88_0
cmake -DCURL_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_CURL_EXE=OFF . > /dev/null cmake -DCURL_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_CURL_EXE=OFF . > /dev/null
make install -j2 > /dev/null make install -j2 > /dev/null
cd .. cd ..

View File

@ -235,8 +235,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
singleproxy["type"] = "ss"; singleproxy["type"] = "ss";
singleproxy["cipher"] = x.EncryptMethod; singleproxy["cipher"] = x.EncryptMethod;
singleproxy["password"] = x.Password; singleproxy["password"] = x.Password;
if (!x.TCPFastOpen.is_undef()) if (!tfo.is_undef())
singleproxy["tfo"] = x.TCPFastOpen.get(); singleproxy["tfo"] = tfo.get();
if (std::all_of(x.Password.begin(), x.Password.end(), ::isdigit) && !x.Password.empty()) if (std::all_of(x.Password.begin(), x.Password.end(), ::isdigit) && !x.Password.empty())
singleproxy["password"].SetTag("str"); singleproxy["password"].SetTag("str");
switch (hash_(x.Plugin)) { switch (hash_(x.Plugin)) {
@ -266,8 +266,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
singleproxy["tls"] = x.TLSSecure; singleproxy["tls"] = x.TLSSecure;
if (xudp && udp) if (xudp && udp)
singleproxy["xudp"] = true; singleproxy["xudp"] = true;
if (!x.TCPFastOpen.is_undef()) if (!tfo.is_undef())
singleproxy["tfo"] = x.TCPFastOpen.get(); singleproxy["tfo"] = tfo.get();
if (!scv.is_undef()) if (!scv.is_undef())
singleproxy["skip-cert-verify"] = scv.get(); singleproxy["skip-cert-verify"] = scv.get();
if (!x.ServerName.empty()) if (!x.ServerName.empty())
@ -321,8 +321,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
singleproxy["auth_str"] = x.Auth; singleproxy["auth_str"] = x.Auth;
singleproxy["up"] = x.UpMbps; singleproxy["up"] = x.UpMbps;
singleproxy["down"] = x.DownMbps; singleproxy["down"] = x.DownMbps;
if (!x.TCPFastOpen.is_undef()) if (!tfo.is_undef())
singleproxy["fast-open"] = x.TCPFastOpen.get(); singleproxy["fast-open"] = tfo.get();
if (!x.FakeType.empty()) if (!x.FakeType.empty())
singleproxy["protocol"] = x.FakeType; singleproxy["protocol"] = x.FakeType;
if (!x.Host.empty()) if (!x.Host.empty())
@ -340,8 +340,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
singleproxy["type"] = "vless"; singleproxy["type"] = "vless";
singleproxy["uuid"] = x.UserId; singleproxy["uuid"] = x.UserId;
singleproxy["tls"] = x.TLSSecure; singleproxy["tls"] = x.TLSSecure;
if (!x.TCPFastOpen.is_undef()) if (!tfo.is_undef())
singleproxy["tfo"] = x.TCPFastOpen.get(); singleproxy["tfo"] = tfo.get();
if (xudp && udp) if (xudp && udp)
singleproxy["xudp"] = true; singleproxy["xudp"] = true;
if (!x.Host.empty()) if (!x.Host.empty())
@ -409,8 +409,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
singleproxy["type"] = "ssr"; singleproxy["type"] = "ssr";
singleproxy["cipher"] = x.EncryptMethod == "none" ? "dummy" : x.EncryptMethod; singleproxy["cipher"] = x.EncryptMethod == "none" ? "dummy" : x.EncryptMethod;
singleproxy["password"] = x.Password; singleproxy["password"] = x.Password;
if (!x.TCPFastOpen.is_undef()) if (!tfo.is_undef())
singleproxy["tfo"] = x.TCPFastOpen.get(); singleproxy["tfo"] = tfo.get();
if (std::all_of(x.Password.begin(), x.Password.end(), ::isdigit) && !x.Password.empty()) if (std::all_of(x.Password.begin(), x.Password.end(), ::isdigit) && !x.Password.empty())
singleproxy["password"].SetTag("str"); singleproxy["password"].SetTag("str");
singleproxy["protocol"] = x.Protocol; singleproxy["protocol"] = x.Protocol;
@ -452,8 +452,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
case ProxyType::Trojan: case ProxyType::Trojan:
singleproxy["type"] = "trojan"; singleproxy["type"] = "trojan";
singleproxy["password"] = x.Password; singleproxy["password"] = x.Password;
if (!x.TCPFastOpen.is_undef()) if (!tfo.is_undef())
singleproxy["tfo"] = x.TCPFastOpen.get(); singleproxy["tfo"] = tfo.get();
if (!x.Host.empty()) if (!x.Host.empty())
singleproxy["sni"] = x.Host; singleproxy["sni"] = x.Host;
if (std::all_of(x.Password.begin(), x.Password.end(), ::isdigit) && !x.Password.empty()) if (std::all_of(x.Password.begin(), x.Password.end(), ::isdigit) && !x.Password.empty())
@ -479,8 +479,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
case ProxyType::Snell: case ProxyType::Snell:
singleproxy["type"] = "snell"; singleproxy["type"] = "snell";
singleproxy["psk"] = x.Password; singleproxy["psk"] = x.Password;
if (!x.TCPFastOpen.is_undef()) if (!tfo.is_undef())
singleproxy["tfo"] = x.TCPFastOpen.get(); singleproxy["tfo"] = tfo.get();
if (x.SnellVersion != 0) if (x.SnellVersion != 0)
singleproxy["version"] = x.SnellVersion; singleproxy["version"] = x.SnellVersion;
if (!x.OBFS.empty()) { if (!x.OBFS.empty()) {