Skip to content
Merged
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 CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)

project(cpp-workspace VERSION 0.4.0 LANGUAGES CXX)
project(cpp-workspace VERSION 0.4.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
9 changes: 5 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ class AppConan(ConanFile):
generators = "CMakeDeps", "CMakeToolchain"

def requirements(self):
self.requires("fmt/11.2.0")
self.requires("libcurl/8.5.0")
self.requires("nlohmann_json/3.11.2")
self.requires("ncurses/6.5")
if self.requires != None:
self.requires("fmt/11.2.0")
self.requires("libcurl/8.5.0")
self.requires("nlohmann_json/3.11.2")
self.requires("ncurses/6.5")

def layout(self):
cmake_layout(self)
2 changes: 1 addition & 1 deletion src/ollama/ollama_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void OllamaClient::process_response_stream(const std::string& line) {
#ifdef DEBUG
if (this->ui->is_running() == false) {
UserInterface::print_message_noninteractive(
std::format("\t[DEBUG] process_response_stream called with line: {}\n", << line.substr(0, 100)));
std::format("\t[DEBUG] process_response_stream called with line: {}\n", line.substr(0, 100)));
}
#endif

Expand Down
23 changes: 20 additions & 3 deletions src/utils/curl_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,26 @@ void CurlUtils::initialize() {
* @note Assumes cleanup operations succeed without error checking.
*/
void CurlUtils::cleanup() {
curl_easy_cleanup(this->curl);
curl_slist_free_all(this->headers);
this->headers = nullptr;
if (this->curl) {
#ifdef DEBUG
if (this->ui->is_running() == false) {
UserInterface::print_message_noninteractive(
std::format("\t[DEBUG] curl pointer before cleanup: {}\n", static_cast<void*>(this->curl)));
}
#endif
curl_easy_cleanup(this->curl);
this->curl = nullptr;
}
if (this->headers) {
#ifdef DEBUG
if (this->ui->is_running() == false) {
UserInterface::print_message_noninteractive(
std::format("\t[DEBUG] curl headers pointer before cleanup: {}\n", static_cast<void*>(this->headers)));
}
#endif
curl_slist_free_all(this->headers);
this->headers = nullptr;
}
std::string message = "CURL cleanup is complete.\n";
if (this->ui->is_running() == false) {
UserInterface::print_success_noninteractive(message);
Expand Down
Loading