mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 19:14:56 +02:00
Fix for streams' getting stuck on the final part.
This commit is contained in:
parent
e7db355c95
commit
d913ac4486
1 changed files with 9 additions and 4 deletions
|
@ -637,9 +637,12 @@ ReliableChannel::ReliableChannel(DatagramSequencer* sequencer, int index, bool o
|
|||
}
|
||||
|
||||
void ReliableChannel::writeData(QDataStream& out, int bytes, QVector<DatagramSequencer::ChannelSpan>& spans) {
|
||||
if (bytes > 0) {
|
||||
_writePosition %= _buffer.pos();
|
||||
|
||||
if (bytes == 0) {
|
||||
out << (quint32)0;
|
||||
return;
|
||||
}
|
||||
_writePosition %= _buffer.pos();
|
||||
while (bytes > 0) {
|
||||
int position = 0;
|
||||
for (int i = 0; i < _acknowledged.getSpans().size(); i++) {
|
||||
const SpanList::Span& span = _acknowledged.getSpans().at(i);
|
||||
|
@ -662,9 +665,11 @@ void ReliableChannel::writeData(QDataStream& out, int bytes, QVector<DatagramSeq
|
|||
int length = qMin(bytes, position - start);
|
||||
writeSpan(out, start, length, spans);
|
||||
writeFullSpans(out, bytes - length, 0, 0, spans);
|
||||
out << (quint32)0;
|
||||
return;
|
||||
}
|
||||
_writePosition = 0;
|
||||
}
|
||||
out << (quint32)0;
|
||||
}
|
||||
|
||||
void ReliableChannel::writeFullSpans(QDataStream& out, int bytes, int startingIndex, int position,
|
||||
|
|
Loading…
Reference in a new issue