mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 00:15:16 +00:00
Got the tcp_nagle_*() defines wrong (inverted) :-(
This commit is contained in:
parent
c8d2d2a8ea
commit
4391463832
@ -1492,7 +1492,7 @@ lwip_getsockopt_internal(void *arg)
|
|||||||
case IPPROTO_TCP:
|
case IPPROTO_TCP:
|
||||||
switch (optname) {
|
switch (optname) {
|
||||||
case TCP_NODELAY:
|
case TCP_NODELAY:
|
||||||
*(int*)optval = tcp_nagle_enabled(sock->conn->pcb.tcp);
|
*(int*)optval = tcp_nagle_disabled(sock->conn->pcb.tcp);
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_NODELAY) = %s\n",
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_NODELAY) = %s\n",
|
||||||
s, (*(int*)optval)?"on":"off") );
|
s, (*(int*)optval)?"on":"off") );
|
||||||
break;
|
break;
|
||||||
@ -1853,9 +1853,9 @@ lwip_setsockopt_internal(void *arg)
|
|||||||
switch (optname) {
|
switch (optname) {
|
||||||
case TCP_NODELAY:
|
case TCP_NODELAY:
|
||||||
if (*(int*)optval) {
|
if (*(int*)optval) {
|
||||||
tcp_nagle_enable(sock->conn->pcb.tcp);
|
|
||||||
} else {
|
|
||||||
tcp_nagle_disable(sock->conn->pcb.tcp);
|
tcp_nagle_disable(sock->conn->pcb.tcp);
|
||||||
|
} else {
|
||||||
|
tcp_nagle_enable(sock->conn->pcb.tcp);
|
||||||
}
|
}
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_NODELAY) -> %s\n",
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_NODELAY) -> %s\n",
|
||||||
s, (*(int *)optval)?"on":"off") );
|
s, (*(int *)optval)?"on":"off") );
|
||||||
|
@ -78,9 +78,9 @@ void tcp_err (struct tcp_pcb *pcb,
|
|||||||
|
|
||||||
#define tcp_mss(pcb) ((pcb)->mss)
|
#define tcp_mss(pcb) ((pcb)->mss)
|
||||||
#define tcp_sndbuf(pcb) ((pcb)->snd_buf)
|
#define tcp_sndbuf(pcb) ((pcb)->snd_buf)
|
||||||
#define tcp_nagle_enable(pcb) ((pcb)->flags |= TF_NODELAY)
|
#define tcp_nagle_disable(pcb) ((pcb)->flags |= TF_NODELAY)
|
||||||
#define tcp_nagle_disable(pcb) ((pcb)->flags &= ~TF_NODELAY)
|
#define tcp_nagle_enable(pcb) ((pcb)->flags &= ~TF_NODELAY)
|
||||||
#define tcp_nagle_enabled(pcb) (((pcb)->flags & TF_NODELAY) != 0)
|
#define tcp_nagle_disabled(pcb) (((pcb)->flags & TF_NODELAY) != 0)
|
||||||
|
|
||||||
#if TCP_LISTEN_BACKLOG
|
#if TCP_LISTEN_BACKLOG
|
||||||
#define tcp_accepted(pcb) (((struct tcp_pcb_listen *)(pcb))->accepts_pending--)
|
#define tcp_accepted(pcb) (((struct tcp_pcb_listen *)(pcb))->accepts_pending--)
|
||||||
@ -140,7 +140,7 @@ u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb);
|
|||||||
* than one unsent segment - with lwIP, this can happen although unsent->len < mss)
|
* than one unsent segment - with lwIP, this can happen although unsent->len < mss)
|
||||||
*/
|
*/
|
||||||
#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \
|
#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \
|
||||||
(tcp_nagle_enabled(tpcb)) || \
|
((tpcb)->flags & TF_NODELAY) || \
|
||||||
(((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \
|
(((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \
|
||||||
((tpcb)->unsent->len >= (tpcb)->mss))) \
|
((tpcb)->unsent->len >= (tpcb)->mss))) \
|
||||||
) ? 1 : 0)
|
) ? 1 : 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user