Skip to content

Commit a22f0da

Browse files
committed
optimized
1 parent f90234b commit a22f0da

21 files changed

+54
-39
lines changed

.github/workflows/alpinelinux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: alpinelinux
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
alpinelinux:

.github/workflows/archlinux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: archlinux
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
archlinux:

.github/workflows/centos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CentOS Linux
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
centos8:

.github/workflows/codacy-analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: codacy-analysis
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
codacy-analysis:

.github/workflows/debian.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Debian GNU/Linux
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
test:

.github/workflows/fedora.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Fedora
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
test:

.github/workflows/freebsd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: FreeBSD
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
freebsd:

.github/workflows/gentoo.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: gentoo
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
gentoo:

.github/workflows/linuxmint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: LinuxMint
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
test:

.github/workflows/macos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: macos
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010

.github/workflows/manjaro.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Manjaro Linux
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
test:

.github/workflows/netbsd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: NetBSD
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
netbsd:

.github/workflows/openbsd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: OpenBSD
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
openbsd:

.github/workflows/opensuse.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: openSUSE
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
opensuse:

.github/workflows/ppkg.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: ppkg
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
ppkg:

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
17-
ref: 0.15.3
17+
ref: 0.15.4
1818

1919
- id: check-if-has-new-commit
2020
run: |

.github/workflows/ubuntu.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: ubuntu
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
vcpkg:

.github/workflows/valgrind.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: valgrind
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
valgrind:

.github/workflows/voidlinux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: voidlinux
22

33
on:
44
push:
5-
branches: [ 0.15.3 ]
5+
branches: [ 0.15.4 ]
66
pull_request:
7-
branches: [ 0.15.3 ]
7+
branches: [ 0.15.4 ]
88

99
jobs:
1010
voidlinux:

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.0)
22

33
project(uppm C)
44

5-
set(PROJECT_VERSION 0.15.3)
5+
set(PROJECT_VERSION 0.15.4)
66
set(PROJECT_VERSION_MAJOR 0)
77
set(PROJECT_VERSION_MINOR 15)
8-
set(PROJECT_VERSION_PATCH 3)
8+
set(PROJECT_VERSION_PATCH 4)
99

1010
set(CMAKE_C_STANDARD 99)
1111
set(CMAKE_C_STANDARD_REQUIRED ON)

src/core/http.c

+15
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ int http_fetch_to_stream(const char * url, FILE * outputFile, bool verbose, bool
5656
//curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
5757
//curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
5858

59+
///////////////////////////////////////////////////////////////////////////////////
60+
5961
// https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_default_verify_paths.html
6062
const char * const SSL_CERT_FILE = getenv("SSL_CERT_FILE");
6163

@@ -64,13 +66,26 @@ int http_fetch_to_stream(const char * url, FILE * outputFile, bool verbose, bool
6466
curl_easy_setopt(curl, CURLOPT_CAINFO, SSL_CERT_FILE);
6567
}
6668

69+
///////////////////////////////////////////////////////////////////////////////////
70+
6771
const char * const SSL_CERT_DIR = getenv("SSL_CERT_DIR");
6872

6973
if ((SSL_CERT_DIR != NULL) && (SSL_CERT_DIR[0] != '\0')) {
7074
// https://curl.se/libcurl/c/CURLOPT_CAPATH.html
7175
curl_easy_setopt(curl, CURLOPT_CAPATH, SSL_CERT_DIR);
7276
}
7377

78+
///////////////////////////////////////////////////////////////////////////////////
79+
80+
const char * const DNS_SERVERS = getenv("CURLOPT_DNS_SERVERS");
81+
82+
if ((DNS_SERVERS != NULL) && (DNS_SERVERS[0] != '\0')) {
83+
// https://curl.se/libcurl/c/CURLOPT_DNS_SERVERS.html
84+
curl_easy_setopt(curl, CURLOPT_DNS_SERVERS, DNS_SERVERS);
85+
}
86+
87+
///////////////////////////////////////////////////////////////////////////////////
88+
7489
char userAgent[50];
7590
snprintf(userAgent, 50, "User-Agent: libcurl-%s", LIBCURL_VERSION);
7691

0 commit comments

Comments
 (0)