net/tcp/tcp_send*: added debug asserts for TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags
This commit is contained in:
parent
8bcdefafc9
commit
6bb7a92a9a
|
@ -388,6 +388,17 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
|||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
|
||||
/* The TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags are expected to
|
||||
* appear here strictly one at a time
|
||||
*/
|
||||
|
||||
DEBUGASSERT((flags & TCP_ACKDATA) == 0 ||
|
||||
(flags & TCP_REXMIT) == 0);
|
||||
DEBUGASSERT((flags & TCP_DISCONN_EVENTS) == 0 ||
|
||||
(flags & TCP_ACKDATA) == 0);
|
||||
DEBUGASSERT((flags & TCP_DISCONN_EVENTS) == 0 ||
|
||||
(flags & TCP_REXMIT) == 0);
|
||||
|
||||
/* Check for a loss of connection */
|
||||
|
||||
if ((flags & TCP_DISCONN_EVENTS) != 0)
|
||||
|
|
|
@ -207,6 +207,17 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
|
|||
ninfo("flags: %04x acked: %" PRId32 " sent: %zd\n",
|
||||
flags, pstate->snd_acked, pstate->snd_sent);
|
||||
|
||||
/* The TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags are expected to
|
||||
* appear here strictly one at a time
|
||||
*/
|
||||
|
||||
DEBUGASSERT((flags & TCP_ACKDATA) == 0 ||
|
||||
(flags & TCP_REXMIT) == 0);
|
||||
DEBUGASSERT((flags & TCP_DISCONN_EVENTS) == 0 ||
|
||||
(flags & TCP_ACKDATA) == 0);
|
||||
DEBUGASSERT((flags & TCP_DISCONN_EVENTS) == 0 ||
|
||||
(flags & TCP_REXMIT) == 0);
|
||||
|
||||
/* If this packet contains an acknowledgement, then update the count of
|
||||
* acknowledged bytes.
|
||||
* This condition is located here for performance reasons
|
||||
|
|
|
@ -199,6 +199,17 @@ static uint16_t sendfile_eventhandler(FAR struct net_driver_s *dev,
|
|||
ninfo("flags: %04x acked: %" PRId32 " sent: %zd\n",
|
||||
flags, pstate->snd_acked, pstate->snd_sent);
|
||||
|
||||
/* The TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags are expected to
|
||||
* appear here strictly one at a time
|
||||
*/
|
||||
|
||||
DEBUGASSERT((flags & TCP_ACKDATA) == 0 ||
|
||||
(flags & TCP_REXMIT) == 0);
|
||||
DEBUGASSERT((flags & TCP_DISCONN_EVENTS) == 0 ||
|
||||
(flags & TCP_ACKDATA) == 0);
|
||||
DEBUGASSERT((flags & TCP_DISCONN_EVENTS) == 0 ||
|
||||
(flags & TCP_REXMIT) == 0);
|
||||
|
||||
/* If this packet contains an acknowledgement, then update the count of
|
||||
* acknowledged bytes.
|
||||
* This condition is located here for performance reasons
|
||||
|
|
Loading…
Reference in New Issue