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

Run buffer until end packet

parent ed4948a2
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,7 +397,9 @@ void Net::_run() { ...@@ -393,7 +397,9 @@ void Net::_run() {
nextTs = std::min(nextTs, next); nextTs = std::min(nextTs, next);
hasLocalNext = true; hasLocalNext = true;
hasNext = true; hasNext = true;
break; if (seenEnd) {
break;
}
} }
// lk2.lock(); // lk2.lock();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment