cederom commented on PR #4172:
URL: https://github.com/apache/nuttx-apps/pull/4172#issuecomment-7247709275

   The test looks good: the helpers track every fd (`tcp_bl_keep`), so teardown 
cleans up even when an assertion fails; the `#ifdef` nesting matches the 
registration in `test_tcp.c`; nxstyle is clean. Some suggestions:
   
   1. **Merge order:** this depends on apache/nuttx#22441 (on the current 
kernel `setsockopt(TCP_CORK, 1)` returns `ENOSYS`). It would help to link the 
two PRs both ways, and to merge this one after the kernel change.
   
   2. **The delivery check can't fail on NuttX:** the stack sends the byte 
right away, so "reaches the peer once uncorked" passes whether or not the cork 
does anything. That's fine as a Linux-compatible check. Maybe say so in the 
description, so nobody later reads it as proof that segments are held back.
   
   3. **Cover the restructured `TCP_NODELAY` path:** #22441 splits the shared 
`TCP_NODELAY`/`TCP_CORK` case. A few cheap assertions would pin that down:
      - `getsockopt(TCP_NODELAY)` still returns 1 while the socket is corked;
      - `setsockopt(TCP_NODELAY, 0)` still fails with `ENOSYS`;
      - a non-boolean value (e.g. `2`) reads back as 1 (the `!= 0` 
normalisation).
   
   4. **Nit, `test_tcp.h`:** the `test_tcp_cork` comment block sits outside its 
`#ifdef`, while the next entry (`test_tcp_sndtimeo_setup`) puts the `#ifdef` 
before the comment block. Better to pick the neighbouring style.


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

Reply via email to