a-lunev commented on a change in pull request #5434:
URL: https://github.com/apache/incubator-nuttx/pull/5434#discussion_r801251928
##########
File path: net/usrsock/usrsock_sendmsg.c
##########
@@ -283,7 +283,8 @@ ssize_t usrsock_sendmsg(FAR struct socket *psock,
if (!(conn->flags & USRSOCK_EVENT_SENDTO_READY))
{
- if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0)
+ if (_SS_ISNONBLOCK(conn->sconn.s_flags) ||
+ (flags & MSG_DONTWAIT) != 0)
Review comment:
Why not the following formatting?
```
if (_SS_ISNONBLOCK(conn->sconn.s_flags) ||
(flags & MSG_DONTWAIT) != 0)
```
##########
File path: net/tcp/tcp_close.c
##########
@@ -64,7 +64,7 @@ static uint16_t tcp_close_eventhandler(FAR struct
net_driver_s *dev,
uint16_t flags)
{
FAR struct tcp_close_s *pstate = (FAR struct tcp_close_s *)pvpriv;
- FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)pvconn;
+ FAR struct tcp_conn_s *conn = pstate->cl_conn;
Review comment:
Let's document here:
```
/* FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)pvconn;
*
* Do not use pvconn argument to get the TCP connection pointer (the above
* commented line) because pvconn is normally NULL for some events like
* NETDEV_DOWN. Instead, the TCP connection pointer can be reliably
* obtained from the corresponding TCP socket.
*/
```
##########
File path: net/usrsock/usrsock_recvmsg.c
##########
@@ -302,7 +302,8 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR
struct msghdr *msg,
if (!(conn->flags & USRSOCK_EVENT_RECVFROM_AVAIL))
{
- if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0)
+ if (_SS_ISNONBLOCK(conn->sconn.s_flags) ||
+ (flags & MSG_DONTWAIT) != 0)
Review comment:
Why not the following formatting?
```
if (_SS_ISNONBLOCK(conn->sconn.s_flags) ||
(flags & MSG_DONTWAIT) != 0)
```
##########
File path: net/udp/udp_sendto_buffered.c
##########
@@ -394,10 +389,9 @@ static uint16_t sendto_eventhandler(FAR struct
net_driver_s *dev,
FAR void *pvconn, FAR void *pvpriv,
uint16_t flags)
{
- FAR struct udp_conn_s *conn = (FAR struct udp_conn_s *)pvconn;
- FAR struct socket *psock = (FAR struct socket *)pvpriv;
+ FAR struct udp_conn_s *conn = (FAR struct udp_conn_s *)pvpriv;
Review comment:
Let's document here:
```
/* FAR struct udp_conn_s *conn = (FAR struct udp_conn_s *)pvconn;
*
* Do not use pvconn argument to get the UDP connection pointer (the above
* commented line) because pvconn is normally NULL for some events like
* NETDEV_DOWN. Instead, the UDP connection pointer can be reliably
* obtained from the corresponding UDP socket.
*/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]