yamt commented on pull request #4080:
URL: https://github.com/apache/incubator-nuttx/pull/4080#issuecomment-875255375


   > > i looked at the tcp part.
   > > 
   > > * tcp_wrbuffer_tryalloc is not the only place we allocate IOBs. we 
allocate them in TCP_WBTRYCOPYIN too. i suspect it might be simpler to perform 
the check in psock_tcp_send.
   > > * i guess you need to update poll.
   > 
   > @yamt san,
   > Think for a while, psock_tcp_send not suitable to check the buffer size, 
because it's hard to find a suitable place to notify that there are available 
buffers,
   
   do you mean where to put the semaphore or an equivalent of it?
   what's wrong with eg. conn->snd_buf_sem?
   psock_send_eventhandler can wake it up when some buffers are acked by the 
peer.
   
   > TCP_WBTRYCOPYIN is a potential risk, but every time of tcp send() will 
only do the iobcopyin once, the next send() will be check further by 
tcp_wrbuffer_tryalloc(), I don't think it's a serious scene
   
   maybe it works for the majority of cases, yes.
   i suspect it can be a problem for a small sndbuf though.
   


-- 
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