Fixed bug #28099 (API required to disable Nagle algorithm at PCB level): added tcp_nagele_*() function-like macros
This commit is contained in:
@@ -1492,7 +1492,7 @@ lwip_getsockopt_internal(void *arg)
|
||||
case IPPROTO_TCP:
|
||||
switch (optname) {
|
||||
case TCP_NODELAY:
|
||||
*(int*)optval = (sock->conn->pcb.tcp->flags & TF_NODELAY);
|
||||
*(int*)optval = tcp_nagle_enabled(sock->conn->pcb.tcp);
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_NODELAY) = %s\n",
|
||||
s, (*(int*)optval)?"on":"off") );
|
||||
break;
|
||||
@@ -1853,9 +1853,9 @@ lwip_setsockopt_internal(void *arg)
|
||||
switch (optname) {
|
||||
case TCP_NODELAY:
|
||||
if (*(int*)optval) {
|
||||
sock->conn->pcb.tcp->flags |= TF_NODELAY;
|
||||
tcp_nagle_enable(sock->conn->pcb.tcp);
|
||||
} else {
|
||||
sock->conn->pcb.tcp->flags &= ~TF_NODELAY;
|
||||
tcp_nagle_disable(sock->conn->pcb.tcp);
|
||||
}
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_NODELAY) -> %s\n",
|
||||
s, (*(int *)optval)?"on":"off") );
|
||||
|
||||
Reference in New Issue
Block a user