pkarashchenko commented on a change in pull request #5526:
URL: https://github.com/apache/incubator-nuttx/pull/5526#discussion_r808991846



##########
File path: net/tcp/tcp_send_buffered.c
##########
@@ -1172,7 +1177,24 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR 
const void *buf,
               goto errout_with_lock;
             }
 
-          net_lockedwait_uninterruptible(&conn->snd_sem);
+          if (remain != UINT_MAX)

Review comment:
       this code is repeated 3 times. Maybe we can build a small support 
function and use it? Something like:
   ```
   uint32_t tcp_send_gettimeout(uint32_t start, uint32_t remain)
   {
     uint32_t elapse;
   
     if (remain != UINT_MAX)
       {
         elapse = TICK2MSEC(clock_systime_ticks()) - start;
         if (elapse >= remain)
           {
             remain = 0;
           }
         else
           {
             remain -= elapse;
           }
     }
   
     return remain;
   }
   ```




-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to