TCP: Improve behavior and documentation

This commit is contained in:
2026-03-04 15:30:07 +01:00
parent 5345b41e16
commit 2914d77dbd
11 changed files with 186 additions and 26 deletions
+2 -4
View File
@@ -128,15 +128,13 @@ void StreamWriter::ProcessDataImage() {
processed_image_size += image_puller_output.cbor->data_message->image.GetCompressedSize();
if (verbose)
logger.Info("Written");
NotifyTcpAck(TCPFrameType::DATA, true, false, TCPAckCode::None);
} catch (const JFJochException &e) {
logger.ErrorException(e);
logger.Warning("Error writing image - switching to error state");
state = StreamWriterState::Error;
err = e.what();
if (!tcp_data_fatal_sent) {
tcp_data_fatal_sent = true;
NotifyTcpAck(TCPFrameType::DATA, false, true, TCPAckCode::DataWriteFailed, err);
}
NotifyTcpAck(TCPFrameType::DATA, false, true, TCPAckCode::DataWriteFailed, err);
}
break;
case StreamWriterState::Error: