aboutsummaryrefslogtreecommitdiffstats
path: root/http-client
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2017-08-08 20:12:39 +0200
committerMauro Sardara <msardara+fdio@cisco.com>2017-08-08 20:12:39 +0200
commitcbc04c22d00db043716fc695d40937252ebbf9ee (patch)
tree7001052eb3d0ed4416db2c590cf3f3fa7e5ec0b2 /http-client
parent582ac1576f63554bf5af0f28c8b12ab5f25854ef (diff)
- Send proxied response sequentially
- Set mpd lifetime to 1 second - Change default lifetime for a generic content Change-Id: I43fd9e61d5cba059e32f67665d0ac22ce04682de Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
Diffstat (limited to 'http-client')
-rw-r--r--http-client/http_client.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/http-client/http_client.cc b/http-client/http_client.cc
index 221e7bbe..a2e9800b 100644
--- a/http-client/http_client.cc
+++ b/http-client/http_client.cc
@@ -13,6 +13,7 @@
* limitations under the License.
*/
+#include "response.h"
#include "http_client.h"
#include <curl/curl.h>
@@ -20,9 +21,11 @@
#include <iostream>
using namespace std;
+using namespace icn_httpserver;
size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) {
- ((ostream*) stream)->write((const char*)ptr, size * nmemb);
+ ((Response*) stream)->write((const char*)ptr, size * nmemb);
+ ((Response*) stream)->send();
return size * nmemb;
}
@@ -56,4 +59,4 @@ bool HTTPClient::download(const std::string& url, std::ostream& out) {
}
return true;
-} \ No newline at end of file
+}