Update libtidy and curlcpp.

This commit is contained in:
King_DuckZ 2015-09-28 15:30:09 +02:00
parent 44992458ac
commit 4f85fa01a9
4 changed files with 14 additions and 10 deletions

View file

@ -38,7 +38,7 @@ add_executable(${PROJECT_NAME}
)
target_link_libraries(${PROJECT_NAME}
lib-tidy
tidy-share
${PUGIXML_LIBRARIES}
curlcpp
)

@ -1 +1 @@
Subproject commit 05bad3db527ee3c76730d42104ddaaa8a6376a3f
Subproject commit 194fdb0ced92a993a60cd0810610845a12023e82

@ -1 +1 @@
Subproject commit 2e383c602957245ff4bc566d1760b525924234cb
Subproject commit fa43957b6d2afd62c12ab507794f9053ea08557b

View file

@ -2,7 +2,7 @@
#include "duckscraperConfig.h"
#include <ciso646>
#include <tidy.h>
#include <buffio.h>
#include <tidybuffio.h>
#include <sstream>
#include <curl_easy.h>
#include <cstring>
@ -83,15 +83,19 @@ namespace duck {
} //unnamed namespace
std::string getCleanHtml (const std::string& parSource, const std::string& parUserAgent, bool parSslVerifyPeer, bool parSslVerifyHost) {
using curl::curl_easy;
using curl::curl_pair;
std::ostringstream oss;
curl::curl_easy easy(oss);
easy.add(curl::curl_pair<CURLoption, std::string>(CURLOPT_URL, parSource));
curl_writer wr(oss);
curl_easy easy(wr);
easy.add(curl_pair<CURLoption, std::string>(CURLOPT_URL, parSource));
if (isHttps(parSource)) {
easy.add(curl::curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYPEER, parSslVerifyPeer));
easy.add(curl::curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYHOST, parSslVerifyHost));
easy.add(curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYPEER, parSslVerifyPeer));
easy.add(curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYHOST, parSslVerifyHost));
}
easy.add(curl::curl_pair<CURLoption, std::string>(CURLOPT_USERAGENT, parUserAgent));
easy.add(curl::curl_pair<CURLoption, long>(CURLOPT_FOLLOWLOCATION, 1L));
easy.add(curl_pair<CURLoption, std::string>(CURLOPT_USERAGENT, parUserAgent));
easy.add(curl_pair<CURLoption, long>(CURLOPT_FOLLOWLOCATION, 1L));
//try {
easy.perform();