Skip to content
Snippets Groups Projects
Commit 0e631ed1 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Merge branch 'bug/netstream-dbg4' into 'main'

Run buffer until end packet

See merge request beyondaka/beyond-protocol!65
parents ed4948a2 b0fe02e9
No related branches found
No related tags found
No related merge requests found
...@@ -368,6 +368,7 @@ void Net::_run() { ...@@ -368,6 +368,7 @@ void Net::_run() {
} }
auto current = state->buffer.begin(); auto current = state->buffer.begin();
bool seenEnd = false;
for (size_t i = 0; i < size; ++i) { for (size_t i = 0; i < size; ++i) {
// lk2.unlock(); // lk2.unlock();
...@@ -375,13 +376,16 @@ void Net::_run() { ...@@ -375,13 +376,16 @@ void Net::_run() {
// Should the packet be dispatched yet // Should the packet be dispatched yet
if (pts == ats) { if (pts == ats) {
StreamPacket *spkt; StreamPacket *spkt;
DataPacket *pkt; DataPacket *pkt;
spkt = &current->packets.first; spkt = &current->packets.first;
pkt = &current->packets.second; pkt = &current->packets.second;
if (spkt->channel == Channel::kEndFrame) {
seenEnd = true;
}
++state->active; ++state->active;
ftl::pool.push([this, buf = &*current, spkt, pkt, state](int ix) { ftl::pool.push([this, buf = &*current, spkt, pkt, state](int ix) {
_processPacket(buf->peer, 0, *spkt, *pkt); _processPacket(buf->peer, 0, *spkt, *pkt);
...@@ -393,8 +397,10 @@ void Net::_run() { ...@@ -393,8 +397,10 @@ void Net::_run() {
nextTs = std::min(nextTs, next); nextTs = std::min(nextTs, next);
hasLocalNext = true; hasLocalNext = true;
hasNext = true; hasNext = true;
if (seenEnd) {
break; break;
} }
}
// lk2.lock(); // lk2.lock();
++current; ++current;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment