Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Dependencies
The build process uses [**CMake**](https://cmake.org/) and, by default, [**Ninja**](https://ninja-build.org/). You must install these; the project cannot locate them for you. The source code also depends on third-party libraries that are not provided as part of the repository:
- [**SDL3**](https://wiki.libsdl.org/SDL3/FrontPage) which is used as the base to handle video, audio and input.
- [**cpp-httplib**](https://github.com/yhirose/cpp-httplib) as a HTTP client to download levels.
- [**cpp-httplib**](https://github.com/yhirose/cpp-httplib) >= 0.23 as a HTTP client to download levels.
- [**glm**](https://github.com/g-truc/glm) providing useful additions to OpenGL.
- [**plog**](https://github.com/SergiusTheBest/plog) for logging
- [**zlib**](https://www.zlib.net/) as a compression utility
Expand Down
2 changes: 1 addition & 1 deletion Descent3/mission_download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ bool msn_DownloadWithStatus(const char *url, const std::filesystem::path &filena
}

httplib::Result (D3::HttpClient::*hcg)(const std::string &, const httplib::ContentReceiver &,
const httplib::Progress &) = &D3::HttpClient::Get;
const D3::HttpClient::Progress &) = &D3::HttpClient::Get;
std::fstream in(qualfile, std::ios::binary | std::ios::trunc | std::ios::out);
auto async_task = std::async(
std::launch::async, hcg, &http_client, download_uri,
Expand Down
4 changes: 2 additions & 2 deletions netcon/inetfile/httpclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ httplib::Result HttpClient::Get(const std::string &URIPath) {
return m_client->Get(URIPath);
}

httplib::Result HttpClient::Get(const std::string &URIPath, const httplib::Progress &progress) {
httplib::Result HttpClient::Get(const std::string &URIPath, const D3::HttpClient::Progress &progress) {
return m_client->Get(URIPath, progress);
}

Expand All @@ -39,7 +39,7 @@ httplib::Result HttpClient::Get(const std::string &URIPath, const httplib::Conte
}

httplib::Result HttpClient::Get(const std::string &URIPath, const httplib::ContentReceiver &content_receiver,
const httplib::Progress &progress) {
const D3::HttpClient::Progress &progress) {
return m_client->Get(URIPath, content_receiver, progress);
}

Expand Down
10 changes: 8 additions & 2 deletions netcon/inetfile/httpclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ namespace D3 {

class HttpClient {
public:
using Progress = httplib::DownloadProgress;
// no way to test with macro; would have to do a cmake-level compile check
//#if httplib < 0.23
//using Progress = httplib::Progress;
//#endif

/**
* Constructor for HttpClient
* @param URL request URL, should be in form of http://example.com. Don't add "/" on the end as it's part of URIPath.
Expand All @@ -46,12 +52,12 @@ class HttpClient {
* @param URIPath requested path (for example, "/some_dir/my_file.txt")
* @return standard HTTP code. 200 means is OK.
*/
httplib::Result Get(const std::string &URIPath, const httplib::Progress &progress);
httplib::Result Get(const std::string &URIPath, const Progress &progress);

httplib::Result Get(const std::string &URIPath, const httplib::ContentReceiver &content_receiver);

httplib::Result Get(const std::string &URIPath, const httplib::ContentReceiver &content_receiver,
const httplib::Progress &progress);
const Progress &progress);

void SetProxy(const std::string &proxy_host, uint16_t port);

Expand Down
7 changes: 5 additions & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"builtin-baseline": "8f90c294883ccf67d2f4953383718aeae981575f",
"builtin-baseline": "4334d8b4c8916018600212ab4dd4bbdc343065d1",
"dependencies": [
"cpp-httplib",
{
"name": "cpp-httplib",
"version>=": "0.23.0"
},
"glm",
"gtest",
"plog",
Expand Down
Loading