Skip to content

Commit

Permalink
update https.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanoBelli committed Mar 30, 2020
1 parent d0dd26c commit 5e2b973
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ find_package(CURL REQUIRED)
find_package(Threads REQUIRED)
#find_library(GCRYPT_LIBRARY NAMES gcrypt libgcrypt)

pkg_check_modules(JSONCPP QUIET jsoncpp)

#if(NOT GCRYPT_LIBRARY)
# message(FATAL_ERROR "Could not find gcrypt library")
#endif()

pkg_check_modules(JSONCPP QUIET jsoncpp)

if(JSONCPP_LIBRARIES)
message(STATUS "Found JsonCpp: ${JSONCPP_LIBRARIES}")
if(NOT JSONCPP_INCLUDE_DIRS STREQUAL "")
Expand All @@ -24,10 +24,10 @@ endif()
if(NOT XXTELEBOT_PKG_CONFIG)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(XXTELEBOT_PKG_CONFIG "/usr/share/pkgconfig")
else()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(XXTELEBOT_PKG_CONFIG "/usr/local/libdata/pkgconfig")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(XXTELEBOT_PKG_CONFIG "/usr/local/libdata/pkgconfig")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(XXTELEBOT_PKG_CONFIG "/usr/local/share/pkgconfig")
endif()
message("-- guessed pkg-config data directory")
message("-- option -DXXTELEBOT_PKG_CONFIG=\"/path/to/pkgconfig\" if needed.")
Expand Down
3 changes: 3 additions & 0 deletions src/https.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ static size_t write_data(const char *ptr, unused size_t nbs, size_t count,
//}

void tgbot::utils::http::__internal_Curl_GlobalInit() {
if(curl_global_sslset(CURLSSLBACKEND_GNUTLS, NULL, NULL) != CURLSSLSET_OK)
throw std::runtime_error("curl_global_sslset() error: libcurl does not support GnuTLS");

curl_global_init(CURL_GLOBAL_SSL);
// __GnuTLS_ProvideLockingMethod();
}
Expand Down

0 comments on commit 5e2b973

Please sign in to comment.