Skip to content
Snippets Groups Projects
Commit f15925cb authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Olivier SOLDANO
Browse files

datatransfer: fix io error during write op


io error in endpoint write operation was not handled.
Add this by this patch and fixes write issues (ex, when peer disconnect).

Change-Id: I24dada649f4d9f9627d2d2ff8efcea2b2d44b4ad
Reviewed-by: default avatarOlivier Soldano <olivier.soldano@savoirfairelinux.com>
parent cec87854
No related branches found
No related tags found
No related merge requests found
...@@ -529,8 +529,12 @@ PeerConnection::PeerConnectionImpl::eventLoop() ...@@ -529,8 +529,12 @@ PeerConnection::PeerConnectionImpl::eventLoop()
handle_stream_list(inputs_, [&](auto& stream){ handle_stream_list(inputs_, [&](auto& stream){
if (!stream->read(buf)) if (!stream->read(buf))
return false; return false;
endpoint_->write(buf, ec); auto size = endpoint_->write(buf, ec);
if (!ec)
return true; return true;
if (!size)
return false;
throw std::system_error(ec);
}); });
handle_stream_list(outputs_, [&](auto& stream){ handle_stream_list(outputs_, [&](auto& stream){
endpoint_->read(buf, ec); endpoint_->read(buf, ec);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment