Skip to content

Commit

Permalink
Merge pull request #244 from qicosmos/remove_boost
Browse files Browse the repository at this point in the history
remove boost
  • Loading branch information
qicosmos authored Feb 14, 2023
2 parents 795a537 + 571857b commit 15dee61
Show file tree
Hide file tree
Showing 16 changed files with 258 additions and 292 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ arch:
- cmake
- gcc
- clang
- boost

script:
- cd example
Expand Down
3 changes: 0 additions & 3 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ target_include_directories(${project_name} PRIVATE
${cinatra_SOURCE_DIR}/thirdparty/asio
)

if(LINUX)
target_link_libraries(${project_name} ${Boost_LIBRARIES} -lstdc++fs)
endif()
if (ENABLE_SSL)
target_link_libraries(${project_name} ${OPENSSL_LIBRARIES} pthread -ldl)
endif()
Expand Down
16 changes: 8 additions & 8 deletions example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ void test_sync_client() {
#ifdef CINATRA_ENABLE_SSL
response_data result2 = client->get(uri2);
////if you need to verify peer
// client->set_ssl_context_callback([](boost::asio::ssl::context& ctx) {
// ctx.set_verify_mode(boost::asio::ssl::context::verify_peer);
// client->set_ssl_context_callback([](asio::ssl::context& ctx) {
// ctx.set_verify_mode(asio::ssl::context::verify_peer);
// ctx.load_verify_file("server.crt");

// //ctx.set_options(
// // boost::asio::ssl::context::default_workarounds
// // | boost::asio::ssl::context::no_sslv2
// // | boost::asio::ssl::context::single_dh_use);
// // asio::ssl::context::default_workarounds
// // | asio::ssl::context::no_sslv2
// // | asio::ssl::context::single_dh_use);

// //ctx.use_certificate_chain_file("server.crt");
// //ctx.use_private_key_file("server.key",
// boost::asio::ssl::context::pem);
// asio::ssl::context::pem);
// //ctx.use_tmp_dh_file("dh512.pem");
//});

Expand Down Expand Up @@ -191,7 +191,7 @@ void test_upload() {
}

void test_smtp_client() {
boost::asio::io_context io_context;
asio::io_context io_context;
#ifdef CINATRA_ENABLE_SSL
auto client = cinatra::smtp::get_smtp_client<cinatra::SSL>(io_context);
#else
Expand All @@ -216,7 +216,7 @@ void test_smtp_client() {

client.start();

boost::system::error_code ec;
std::error_code ec;
io_context.run(ec);
}

Expand Down
4 changes: 2 additions & 2 deletions include/cinatra/client_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class client_factory {
client_factory(client_factory &&) = delete;
client_factory &operator=(client_factory &&) = delete;

boost::asio::io_service ios_;
boost::asio::io_service::work work_;
asio::io_service ios_;
asio::io_service::work work_;
std::shared_ptr<std::thread> thd_;
};

Expand Down
Loading

0 comments on commit 15dee61

Please sign in to comment.