From dbed09c3ce64d569253f898e88d95c33e13cabaa Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Sat, 27 Oct 2018 15:35:40 +0200 Subject: [PATCH] https test --- HTTPSStream.cc | 7 +++++++ Makefile | 6 +++++- test_split_url.cc | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/HTTPSStream.cc b/HTTPSStream.cc index 8fe2b6c..fa27f4c 100644 --- a/HTTPSStream.cc +++ b/HTTPSStream.cc @@ -5,6 +5,7 @@ #include #include +#include #include namespace pEp { @@ -59,6 +60,8 @@ namespace pEp { if (_stream) throw runtime_error("stream already open"); + _host = u.host; + boost::system::error_code ec; tcp::resolver resolver{_ioc}; @@ -99,6 +102,10 @@ namespace pEp { req.set(http::field::user_agent, _user_agent); http::write(*_stream, req); + + boost::beast::flat_buffer b; + http::response res; + http::read(*_stream, b, res); } void HTTPSDevice::close() diff --git a/Makefile b/Makefile index b65fcc3..4b35631 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,12 @@ uninstall: test_split_url: test_split_url.o HTTPSStream.o $(CXX) $(LDFLAGS) $< HTTPSStream.o -o $@ -test: test_split_url +test_https: test_https.o HTTPSStream.o + $(CXX) $(LDFLAGS) $< HTTPSStream.o -o $@ + +test: test_split_url test_https ./test_split_url + ./test_https tags: $(SOURCE) $(HEADERS) ctags $(SOURCE) $(HEADERS) diff --git a/test_split_url.cc b/test_split_url.cc index 9ad51c4..f9ec038 100644 --- a/test_split_url.cc +++ b/test_split_url.cc @@ -1,3 +1,6 @@ +// this file is under GNU General Public License 3.0 +// see LICENSE.txt + #include #include #include "HTTPSStream.hh"