Removed and replaced last bits of curlpp.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ed989935ac
commit
c48c1a66f2
@ -1,8 +1,7 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
find_depencency(jsoncpp REQUIRED CONFIG)
|
find_depencency(jsoncpp CONFIG REQUIRED)
|
||||||
find_dependency(PkgConfig REQUIRED)
|
find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG REQUIRED)
|
||||||
pkg_check_modules(curlpp REQUIRED IMPORTED_TARGET curlpp)
|
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||||
|
@ -7,5 +7,6 @@ Name: ${name}
|
|||||||
Description: @PROJECT_DESCRIPTION@
|
Description: @PROJECT_DESCRIPTION@
|
||||||
Version: @PROJECT_VERSION@
|
Version: @PROJECT_VERSION@
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
Libs: -L${libdir} -l${name} -lpthread
|
Libs: -L${libdir} -l${name} -lpthread -lPocoNet
|
||||||
Requires: jsoncpp curlpp
|
Requires: jsoncpp
|
||||||
|
Libs.private: -lPocoFoundation -lPocoNetSSL
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(curlpp REQUIRED IMPORTED_TARGET curlpp)
|
|
||||||
if(WITH_EASY)
|
if(WITH_EASY)
|
||||||
find_package(jsoncpp REQUIRED CONFIG)
|
find_package(jsoncpp CONFIG REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
# Some distributions do not contain Poco*Config.cmake recipes.
|
# Some distributions do not contain Poco*Config.cmake recipes.
|
||||||
find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG)
|
find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG)
|
||||||
@ -33,10 +31,7 @@ target_include_directories(${PROJECT_NAME}
|
|||||||
|
|
||||||
if(WITH_EASY)
|
if(WITH_EASY)
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
PUBLIC pthread PkgConfig::curlpp jsoncpp_lib)
|
PUBLIC pthread jsoncpp_lib)
|
||||||
else()
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
|
||||||
PUBLIC pthread PkgConfig::curlpp)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If no Poco*Config.cmake recipes are found, look for headers in standard dirs.
|
# If no Poco*Config.cmake recipes are found, look for headers in standard dirs.
|
||||||
|
@ -18,9 +18,6 @@
|
|||||||
#include <functional> // std::bind
|
#include <functional> // std::bind
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <curlpp/Options.hpp>
|
|
||||||
#include <curlpp/Exception.hpp>
|
|
||||||
#include <curlpp/Infos.hpp>
|
|
||||||
#include <Poco/Net/HTTPSClientSession.h>
|
#include <Poco/Net/HTTPSClientSession.h>
|
||||||
#include <Poco/Net/HTTPRequest.h>
|
#include <Poco/Net/HTTPRequest.h>
|
||||||
#include <Poco/Net/HTTPResponse.h>
|
#include <Poco/Net/HTTPResponse.h>
|
||||||
@ -35,7 +32,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace Mastodon;
|
using namespace Mastodon;
|
||||||
namespace curlopts = curlpp::options;
|
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::istream;
|
using std::istream;
|
||||||
using std::make_unique;
|
using std::make_unique;
|
||||||
@ -54,8 +50,6 @@ API::http::http(const API &api, const string &instance,
|
|||||||
, _access_token(access_token)
|
, _access_token(access_token)
|
||||||
, _cancel_stream(false)
|
, _cancel_stream(false)
|
||||||
{
|
{
|
||||||
curlpp::initialize();
|
|
||||||
|
|
||||||
Poco::Net::initializeSSL();
|
Poco::Net::initializeSSL();
|
||||||
|
|
||||||
// FIXME: rewrite set_proxy() that it calls set_proxy() here.
|
// FIXME: rewrite set_proxy() that it calls set_proxy() here.
|
||||||
@ -98,8 +92,6 @@ API::http::http(const API &api, const string &instance,
|
|||||||
|
|
||||||
API::http::~http()
|
API::http::~http()
|
||||||
{
|
{
|
||||||
curlpp::terminate();
|
|
||||||
|
|
||||||
Poco::Net::uninitializeSSL();
|
Poco::Net::uninitializeSSL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <Poco/Net/FilePartSource.h>
|
#include <Poco/Net/FilePartSource.h>
|
||||||
|
#include <Poco/URI.h>
|
||||||
#include "version.hpp"
|
#include "version.hpp"
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
#include "mastodon-cpp.hpp"
|
#include "mastodon-cpp.hpp"
|
||||||
@ -333,11 +334,16 @@ const parameters API::delete_params(const parameters ¶ms,
|
|||||||
|
|
||||||
const string Mastodon::urlencode(const std::string &str)
|
const string Mastodon::urlencode(const std::string &str)
|
||||||
{
|
{
|
||||||
return curlpp::escape(str);
|
string out;
|
||||||
|
Poco::URI::encode(str, "", out);
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Mastodon::urldecode(const std::string &str)
|
const string Mastodon::urldecode(const std::string &str)
|
||||||
{
|
{
|
||||||
return curlpp::unescape(str);
|
string out;
|
||||||
|
Poco::URI::decode(str, out);
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Mastodon::unescape_html(const string &html)
|
const string Mastodon::unescape_html(const string &html)
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <curlpp/cURLpp.hpp>
|
|
||||||
#include <curlpp/Easy.hpp>
|
|
||||||
#include <Poco/Net/HTMLForm.h>
|
#include <Poco/Net/HTMLForm.h>
|
||||||
|
|
||||||
#include "return_types.hpp"
|
#include "return_types.hpp"
|
||||||
@ -686,13 +684,12 @@ namespace Mastodon
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Percent-encodes a string. This is done automatically, unless
|
* @brief Percent-encodes a string.
|
||||||
* you make a custom request.
|
|
||||||
*
|
*
|
||||||
* Calls curlpp::escape(str).
|
|
||||||
*
|
*
|
||||||
* The only time you should use this, is if you use
|
* This is done automatically where necessary. The only time you
|
||||||
* get(const string &call, string &answer).
|
* should use this, is if you use get(const string &call, string
|
||||||
|
* &answer).
|
||||||
*
|
*
|
||||||
* See RFC 3986 section 2.1 for more info.
|
* See RFC 3986 section 2.1 for more info.
|
||||||
*
|
*
|
||||||
@ -707,8 +704,6 @@ namespace Mastodon
|
|||||||
/*!
|
/*!
|
||||||
* @brief Decodes a percent-encoded string.
|
* @brief Decodes a percent-encoded string.
|
||||||
*
|
*
|
||||||
* Calls curlpp::unescape(str).
|
|
||||||
*
|
|
||||||
* See RFC 3986 section 2.1 for more info.
|
* See RFC 3986 section 2.1 for more info.
|
||||||
*
|
*
|
||||||
* @param str The string to decode.
|
* @param str The string to decode.
|
||||||
|
Reference in New Issue
Block a user