https test

APPLEMAIL-24
Volker Birk 2018-10-27 15:35:40 +02:00
parent 21cd35dfc7
commit dbed09c3ce
3 changed files with 15 additions and 1 deletions

View File

@ -5,6 +5,7 @@
#include <boost/regex.hpp>
#include <boost/asio/connect.hpp>
#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
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<http::dynamic_body> res;
http::read(*_stream, b, res);
}
void HTTPSDevice::close()

View File

@ -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)

View File

@ -1,3 +1,6 @@
// this file is under GNU General Public License 3.0
// see LICENSE.txt
#include <iostream>
#include <assert.h>
#include "HTTPSStream.hh"