APPLEMAIL-24
Volker Birk 4 years ago
parent 21cd35dfc7
commit dbed09c3ce
  1. 7
      HTTPSStream.cc
  2. 6
      Makefile
  3. 3
      test_split_url.cc

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

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

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

Loading…
Cancel
Save