xiaoxiang781216 commented on code in PR #22441:
URL: https://github.com/apache/nuttx/pull/22441#discussion_r4715013960


##########
net/tcp/tcp.h:
##########
@@ -272,6 +272,8 @@ struct tcp_conn_s
                            * variable */
   uint8_t  rto;           /* Retransmission time-out */
   uint8_t  tcpstateflags; /* TCP state and flags */
+  bool     cork;          /* TCP_CORK was set (a hint: segments are not

Review Comment:
   why not save to s_options like other



##########
net/tcp/tcp_setsockopt.c:
##########
@@ -216,22 +216,30 @@ int tcp_setsockopt(FAR struct socket *psock, int option,
 #endif /* CONFIG_NET_TCP_KEEPALIVE */
 
       case TCP_NODELAY: /* Avoid coalescing of small segments. */
-      case TCP_CORK:    /* coalescing of small segments. */
         if (value_len != sizeof(int))
           {
             ret = -EDOM;
           }
-        else
+        else if (*(FAR int *)value == 0)
           {
-            int nodelay = *(FAR int *)value;
+            nerr("ERROR: TCP_NODELAY 0 not supported\n");
+            ret = -ENOSYS;
+          }
+        break;
 
-            if ((!nodelay && option == TCP_NODELAY) ||
-                (nodelay && option == TCP_CORK))
-              {
-                nerr("ERROR: %s not supported\n",
-                     option == TCP_NODELAY ? "TCP_NODELAY" : "TCP_CORK");
-                ret = -ENOSYS;
-              }
+      case TCP_CORK:    /* Coalescing of small segments. */

Review Comment:
   should we support get too?



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