Skip to content

Commit

Permalink
solved crash because of protocol being shutdown after the first conne…
Browse files Browse the repository at this point in the history
…ction. This is strange because nothing has changed in this part but resetting socket and not stopping ioservice solves it
  • Loading branch information
lurume84 committed Apr 25, 2020
1 parent 22f852f commit 8c49dec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DesktopCore/Blink/Agents/SyncVideoAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ namespace desktop { namespace core { namespace agent {
}
else
{
service::LogService::error("Video {} could not be downloaded at {}", video.second, downloadFolder);
service::LogService::error("Video {} could not be downloaded at {}", video.second, target);
}

setLastUpdateTimestamp(video.first);
Expand Down
5 changes: 2 additions & 3 deletions src/DesktopCore/Network/Services/HTTPClientService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ namespace desktop { namespace core { namespace service {
| boost::asio::ssl::context::no_sslv2
| boost::asio::ssl::context::no_sslv3
| boost::asio::ssl::context::no_tlsv1);

m_socket.reset(new boost::asio::ssl::stream<boost::asio::ip::tcp::socket>(m_io_service, context_));
}

HTTPClientService::~HTTPClientService() = default;
Expand Down Expand Up @@ -53,6 +51,8 @@ namespace desktop { namespace core { namespace service {
{
try
{
m_socket.reset(new boost::asio::ssl::stream<boost::asio::ip::tcp::socket>(m_io_service, context_));

tcp::resolver resolver(m_io_service);
tcp::resolver::query query(server, port);
tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
Expand Down Expand Up @@ -83,7 +83,6 @@ namespace desktop { namespace core { namespace service {

m_socket->shutdown(error);
m_socket->lowest_layer().close(error);
m_io_service.stop();

service::LogService::info("HTTP {} {} {}:{}{}", action, status_code, server, port, path);

Expand Down

0 comments on commit 8c49dec

Please sign in to comment.