| 1603 | } |
| 1604 | |
| 1605 | int FECFilterBuiltin::RcvGetRowGroupIndex(int32_t seq, EHangStatus& w_status) |
| 1606 | { |
| 1607 | RcvGroup& head = rcv.rowq[0]; |
| 1608 | const int32_t base = head.base; |
| 1609 | |
| 1610 | const int offset = CSeqNo::seqoff(base, seq); |
| 1611 | |
| 1612 | // Discard the packet, if older than base. |
| 1613 | if (offset < 0) |
| 1614 | { |
| 1615 | HLOGC(pflog.Debug, log << "FEC/H: Packet %" << seq << " is in the past, ignoring"); |
| 1616 | w_status = HANG_PAST; |
| 1617 | return -1; |
| 1618 | } |
| 1619 | |
| 1620 | // Hang in the receiver group first. |
| 1621 | size_t rowx = offset / m_number_cols; |
| 1622 | |
| 1623 | /* |
| 1624 | Don't. |
| 1625 | Leaving this code for future if needed, but this check should not be done. |
| 1626 | The resource management for "crazy" sequence numbers is done in the beginning, |
| 1627 | so simply TRUST THIS SEQUENCE, no matter what. After the check it won't do any harm. |
| 1628 | if (rowx > numberRows()*2) // past twice the matrix |
| 1629 | { |
| 1630 | LOGC(pflog.Error, log << "FEC/H: Packet %" << seq << " is in the far future, ignoring"); |
| 1631 | return -1; |
| 1632 | } |
| 1633 | */ |
| 1634 | |
| 1635 | // The packet might have come completely out of the blue. |
| 1636 | // The row group container must be prepared to extend |
| 1637 | // itself in order to give place for the packet. |
| 1638 | |
| 1639 | // First, possibly extend the row container |
| 1640 | if (rowx >= rcv.rowq.size()) |
| 1641 | { |
| 1642 | // Never returns -1 |
| 1643 | rowx = ExtendRows(rowx); |
| 1644 | } |
| 1645 | |
| 1646 | w_status = HANG_SUCCESS; |
| 1647 | return int(rowx); |
| 1648 | } |
| 1649 | |
| 1650 | void FECFilterBuiltin::MarkCellReceived(int32_t seq, ECellReceived is_received) |
| 1651 | { |