8000 数据包超长得情况下丢包有问题 · Issue #3 · aeo123/upacker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
数据包超长得情况下丢包有问题 #3
Open
@Sunxiaowei123370

Description

@Sunxiaowei123370

else if (packer->state == 2)
{
//长度信息
packer->flen |= (uint16_t)d << 8;
packer->calc ^= d & 0x3F;

   //数据包超长得情况下直接丢包
    if ((packer->flen & 0x3FFF) > MAX_PACK_SIZE)
    {
        packer->state = 0;
    }
    packer->state = 3;
    packer->cnt = 0;
}

问题:
当数据包超长时并不会直接丢包因为底下又重新给 state 赋值导致state = 0被覆盖。
解决方法:
在 packer->state = 0; 的下一行直接return 0;您看这样改是否妥当。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      You can’t perform that action at this time.
      0