Commit f15925cb authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Olivier SOLDANO

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
......@@ -529,8 +529,12 @@ PeerConnection::PeerConnectionImpl::eventLoop()
handle_stream_list(inputs_, [&](auto& stream){
if (!stream->read(buf))
return false;
endpoint_->write(buf, ec);
return true;
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment