Skip to content

Commit 674a53c

Browse files
Fix: Update deprecated actions and resolve subsequent build failures
- Updated actions/cache from v2 to v4 to resolve the build failure caused by a deprecated version. - Updated actions/checkout from v2 to v4 as a proactive measure. These changes revealed a cascade of build failures and linting errors, which are also fixed in this PR: 1. The `clang-13` package is not available on `ubuntu-latest` runners. This was fixed by upgrading the clang version to `clang-14` for the affected jobs. 2. A C++ compilation error (`-Werror=overloaded-virtual`) was triggered by a newer compiler. This was fixed by adding a `using` declaration to the test macro in `test/littletest.hpp`. 3. The `valgrind-dbg` package is not available on `ubuntu-latest`. This was fixed by removing it from the installation step. 4. macOS tests were failing to bind to port 8080. This was fixed by replacing `localhost` with `127.0.0.1` in the test files to avoid DNS resolution issues. 5. A large number of `cpplint` errors were revealed. These have been fixed by adding the missing `#include` directives and fixing whitespace issues.
1 parent d6e4b33 commit 674a53c

File tree

9 files changed

+100
-104
lines changed

9 files changed

+100
-104
lines changed

src/httpserver/create_webserver.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ class create_webserver {
5656
create_webserver& operator=(create_webserver&& b) = default;
5757

5858
explicit create_webserver(uint16_t port):
59-
_port(port) {
60-
#if defined(__APPLE__)
61-
use_dual_stack();
62-
#endif
63-
}
59+
_port(port) { }
6460

6561
create_webserver& port(uint16_t port) {
6662
_port = port;

test/integ/authentication.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ LT_BEGIN_AUTO_TEST(authentication_suite, base_auth)
110110
CURLcode res;
111111
curl_easy_setopt(curl, CURLOPT_USERNAME, "myuser");
112112
curl_easy_setopt(curl, CURLOPT_PASSWORD, "mypass");
113-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
113+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
114114
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
115115
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);
116116
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);
@@ -135,7 +135,7 @@ LT_BEGIN_AUTO_TEST(authentication_suite, base_auth_fail)
135135
CURLcode res;
136136
curl_easy_setopt(curl, CURLOPT_USERNAME, "myuser");
137137
curl_easy_setopt(curl, CURLOPT_PASSWORD, "wrongpass");
138-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
138+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
139139
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
140140
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);
141141
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);
@@ -176,7 +176,7 @@ LT_BEGIN_AUTO_TEST(authentication_suite, digest_auth)
176176
#else
177177
curl_easy_setopt(curl, CURLOPT_USERPWD, "myuser:mypass");
178178
#endif
179-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
179+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
180180
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
181181
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);
182182
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);
@@ -216,7 +216,7 @@ LT_BEGIN_AUTO_TEST(authentication_suite, digest_auth_wrong_pass)
216216
#else
217217
curl_easy_setopt(curl, CURLOPT_USERPWD, "myuser:wrongpass");
218218
#endif
219-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
219+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
220220
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
221221
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);
222222
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);

test/integ/ban_system.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ LT_BEGIN_AUTO_TEST(ban_system_suite, accept_default_ban_blocks)
8080
std::string s;
8181
CURL *curl = curl_easy_init();
8282
CURLcode res;
83-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
83+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
8484
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
8585
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);
8686
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);
@@ -95,7 +95,7 @@ LT_BEGIN_AUTO_TEST(ban_system_suite, accept_default_ban_blocks)
9595

9696
CURL *curl = curl_easy_init();
9797
CURLcode res;
98-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
98+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
9999
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
100100
res = curl_easy_perform(curl);
101101
LT_ASSERT_NEQ(res, 0);
@@ -108,7 +108,7 @@ LT_BEGIN_AUTO_TEST(ban_system_suite, accept_default_ban_blocks)
108108
std::string s;
109109
CURL *curl = curl_easy_init();
110110
CURLcode res;
111-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
111+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
112112
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
113113
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);
114114
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);
@@ -134,7 +134,7 @@ LT_BEGIN_AUTO_TEST(ban_system_suite, reject_default_allow_passes)
134134
{
135135
CURL *curl = curl_easy_init();
136136
CURLcode res;
137-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
137+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
138138
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
139139
res = curl_easy_perform(curl);
140140
LT_ASSERT_NEQ(res, 0);
@@ -147,7 +147,7 @@ LT_BEGIN_AUTO_TEST(ban_system_suite, reject_default_allow_passes)
147147
std::string s;
148148
CURL *curl = curl_easy_init();
149149
CURLcode res;
150-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
150+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
151151
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
152152
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);
153153
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);
@@ -162,7 +162,7 @@ LT_BEGIN_AUTO_TEST(ban_system_suite, reject_default_allow_passes)
162162

163163
CURL *curl = curl_easy_init();
164164
CURLcode res;
165-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:" PORT_STRING "/base");
165+
curl_easy_setopt(curl, CURLOPT_URL, "127.0.0.1:" PORT_STRING "/base");
166166
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
167167
res = curl_easy_perform(curl);
168168
LT_ASSERT_NEQ(res, 0);

0 commit comments

Comments
 (0)