net/tcp: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
d78bf36740
commit
a22f5bb8b0
@ -416,7 +416,9 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
sq_rem(entry, &conn->unacked_q);
|
sq_rem(entry, &conn->unacked_q);
|
||||||
|
|
||||||
/* And return the write buffer to the pool of free buffers */
|
/* And return the write buffer to the pool of free
|
||||||
|
* buffers
|
||||||
|
*/
|
||||||
|
|
||||||
tcp_wrbuffer_release(wrb);
|
tcp_wrbuffer_release(wrb);
|
||||||
|
|
||||||
@ -537,7 +539,9 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
FAR struct tcp_wrbuffer_s *tmp;
|
FAR struct tcp_wrbuffer_s *tmp;
|
||||||
uint16_t sent;
|
uint16_t sent;
|
||||||
|
|
||||||
/* Yes.. Reset the number of bytes sent sent from the write buffer */
|
/* Yes.. Reset the number of bytes sent sent from
|
||||||
|
* the write buffer
|
||||||
|
*/
|
||||||
|
|
||||||
sent = TCP_WBSENT(wrb);
|
sent = TCP_WBSENT(wrb);
|
||||||
if (conn->tx_unacked > sent)
|
if (conn->tx_unacked > sent)
|
||||||
@ -779,7 +783,9 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
conn->tx_unacked += sndlen;
|
conn->tx_unacked += sndlen;
|
||||||
conn->sent += sndlen;
|
conn->sent += sndlen;
|
||||||
|
|
||||||
/* Below prediction will become true, unless retransmission occurrence */
|
/* Below prediction will become true,
|
||||||
|
* unless retransmission occurrence
|
||||||
|
*/
|
||||||
|
|
||||||
predicted_seqno = tcp_getsequence(conn->sndseq) + sndlen;
|
predicted_seqno = tcp_getsequence(conn->sndseq) + sndlen;
|
||||||
|
|
||||||
@ -1086,7 +1092,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nerr("ERROR: Failed to add data to the I/O buffer chain\n");
|
nerr("ERROR: Failed to add data to the I/O chain\n");
|
||||||
ret = -EWOULDBLOCK;
|
ret = -EWOULDBLOCK;
|
||||||
goto errout_with_wrb;
|
goto errout_with_wrb;
|
||||||
}
|
}
|
||||||
@ -1102,8 +1108,8 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
|
|||||||
int blresult;
|
int blresult;
|
||||||
|
|
||||||
/* iob_copyin might wait for buffers to be freed, but if network is
|
/* iob_copyin might wait for buffers to be freed, but if network is
|
||||||
* locked this might never happen, since network driver is also locked,
|
* locked this might never happen, since network driver is also
|
||||||
* therefore we need to break the lock
|
* locked, therefore we need to break the lock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
blresult = net_breaklock(&count);
|
blresult = net_breaklock(&count);
|
||||||
@ -1208,9 +1214,10 @@ int psock_tcp_cansend(FAR struct socket *psock)
|
|||||||
* buffer head and at least one free IOB to initialize the write buffer
|
* buffer head and at least one free IOB to initialize the write buffer
|
||||||
* head.
|
* head.
|
||||||
*
|
*
|
||||||
* REVISIT: The send will still block if we are unable to buffer the entire
|
* REVISIT: The send will still block if we are unable to buffer
|
||||||
* user-provided buffer which may be quite large. We will almost certainly
|
* the entire user-provided buffer which may be quite large.
|
||||||
* need to have more than one free IOB, but we don't know how many more.
|
* We will almost certainly need to have more than one free IOB,
|
||||||
|
* but we don't know how many more.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (tcp_wrbuffer_test() < 0 || iob_navail(false) <= 0)
|
if (tcp_wrbuffer_test() < 0 || iob_navail(false) <= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user