nids_discard() may be called from the TCP callback function to specify the number of bytes to discard from the beginning of the data buffer (updating the offset value accordingly) after the TCP callback function exits. Otherwise, the new data (totalling count_new bytes) will be discarded by default.
- 如果不调用nids_discard(),则将默认丢弃data缓冲区中new data个字节。
- 常用的是nids_discard(0, stream);用于接收到的数据不足,保留所有数据等待下一次接收。
- 或者是nids_discard(tcp->len, stream);用于丢弃一个完整的tcp报文载荷,等待接收下一个报文。