diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/client.cpp | 4 | ||||
-rw-r--r-- | src/client.h | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c43670..29a0a75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -13,4 +13,4 @@ include_directories(${CURLCPP_SOURCE_DIR}/include) | |||
13 | add_library(twitter++ src/client.cpp src/auth.cpp src/tweet.cpp src/codes.cpp src/notification.cpp src/direct_message.cpp src/list.cpp src/user.cpp) | 13 | add_library(twitter++ src/client.cpp src/auth.cpp src/tweet.cpp src/codes.cpp src/notification.cpp src/direct_message.cpp src/list.cpp src/user.cpp) |
14 | set_property(TARGET twitter++ PROPERTY CXX_STANDARD 11) | 14 | set_property(TARGET twitter++ PROPERTY CXX_STANDARD 11) |
15 | set_property(TARGET twitter++ PROPERTY CXX_STANDARD_REQUIRED ON) | 15 | set_property(TARGET twitter++ PROPERTY CXX_STANDARD_REQUIRED ON) |
16 | target_link_libraries(twitter++ oauthcpp curlcpp) | 16 | target_link_libraries(twitter++ oauthcpp curlcpp curl pthread) |
diff --git a/src/client.cpp b/src/client.cpp index ffb651b..bae563f 100644 --- a/src/client.cpp +++ b/src/client.cpp | |||
@@ -3,6 +3,8 @@ | |||
3 | #include <set> | 3 | #include <set> |
4 | #include <algorithm> | 4 | #include <algorithm> |
5 | #include <liboauthcpp/liboauthcpp.h> | 5 | #include <liboauthcpp/liboauthcpp.h> |
6 | #include <curl_easy.h> | ||
7 | #include <curl_header.h> | ||
6 | #include "util.h" | 8 | #include "util.h" |
7 | #include <json.hpp> | 9 | #include <json.hpp> |
8 | 10 | ||
@@ -727,7 +729,7 @@ namespace twitter { | |||
727 | } | 729 | } |
728 | } | 730 | } |
729 | 731 | ||
730 | int client::stream::write(char* ptr, size_t size, size_t nmemb) | 732 | size_t client::stream::write(char* ptr, size_t size, size_t nmemb) |
731 | { | 733 | { |
732 | for (size_t i = 0; i < size*nmemb; i++) | 734 | for (size_t i = 0; i < size*nmemb; i++) |
733 | { | 735 | { |
diff --git a/src/client.h b/src/client.h index ae80ed9..750d603 100644 --- a/src/client.h +++ b/src/client.h | |||
@@ -5,8 +5,6 @@ | |||
5 | #include "tweet.h" | 5 | #include "tweet.h" |
6 | #include "auth.h" | 6 | #include "auth.h" |
7 | #include <list> | 7 | #include <list> |
8 | #include <curl_easy.h> | ||
9 | #include <curl_header.h> | ||
10 | #include <thread> | 8 | #include <thread> |
11 | #include <mutex> | 9 | #include <mutex> |
12 | #include "notification.h" | 10 | #include "notification.h" |
@@ -20,6 +18,8 @@ namespace OAuth { | |||
20 | class Client; | 18 | class Client; |
21 | }; | 19 | }; |
22 | 20 | ||
21 | class curl_httppost; | ||
22 | |||
23 | namespace twitter { | 23 | namespace twitter { |
24 | 24 | ||
25 | class client { | 25 | class client { |
@@ -36,6 +36,9 @@ namespace twitter { | |||
36 | void start(); | 36 | void start(); |
37 | void stop(); | 37 | void stop(); |
38 | 38 | ||
39 | int progress(); | ||
40 | size_t write(char* ptr, size_t size, size_t nmemb); | ||
41 | |||
39 | private: | 42 | private: |
40 | enum class backoff { | 43 | enum class backoff { |
41 | none, | 44 | none, |
@@ -45,11 +48,6 @@ namespace twitter { | |||
45 | }; | 48 | }; |
46 | 49 | ||
47 | void run(); | 50 | void run(); |
48 | int progress(); | ||
49 | int write(char* ptr, size_t size, size_t nmemb); | ||
50 | |||
51 | friend int client_stream_progress_callback_wrapper(void* stream, curl_off_t, curl_off_t, curl_off_t, curl_off_t); | ||
52 | friend size_t client_stream_write_callback_wrapper(void* ptr, size_t size, size_t nmemb, void* stream); | ||
53 | 51 | ||
54 | client& _client; | 52 | client& _client; |
55 | notify_callback _notify; | 53 | notify_callback _notify; |