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
Branches
Tags
No related merge requests found
......@@ -529,8 +529,12 @@ PeerConnection::PeerConnectionImpl::eventLoop()
handle_stream_list(inputs_, [&](auto& stream){
if (!stream->read(buf))
return false;
endpoint_->write(buf, ec);
auto size = endpoint_->write(buf, ec);
if (!ec)
return true;
if (!size)
return false;
throw std::system_error(ec);
});
handle_stream_list(outputs_, [&](auto& stream){
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