fixed some printf formatters (mainly for window scaling code)

This commit is contained in:
sg 2015-09-17 21:33:25 +02:00
parent 9614c60cf6
commit 6f0dceee09
3 changed files with 9 additions and 8 deletions

View File

@ -701,7 +701,7 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len)
tcp_output(pcb); tcp_output(pcb);
} }
LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n", LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F").\n",
len, pcb->rcv_wnd, TCP_WND_MAX(pcb) - pcb->rcv_wnd)); len, pcb->rcv_wnd, TCP_WND_MAX(pcb) - pcb->rcv_wnd));
} }

View File

@ -998,11 +998,11 @@ tcp_receive(struct tcp_pcb *pcb)
/* stop persist timer */ /* stop persist timer */
pcb->persist_backoff = 0; pcb->persist_backoff = 0;
} }
LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: window update %"U16_F"\n", pcb->snd_wnd)); LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: window update %"TCPWNDSIZE_F"\n", pcb->snd_wnd));
#if TCP_WND_DEBUG #if TCP_WND_DEBUG
} else { } else {
if (pcb->snd_wnd != SND_WND_SCALE(pcb, tcphdr->wnd)) { if (pcb->snd_wnd != (tcpwnd_size_t)SND_WND_SCALE(pcb, tcphdr->wnd)) {
LWIP_DEBUGF(TCP_WND_DEBUG, LWIP_DEBUGF(TCP_WND_DEBUG,
("tcp_receive: no window update lastack %"U32_F" ackno %" ("tcp_receive: no window update lastack %"U32_F" ackno %"
U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n", U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n",
pcb->lastack, ackno, pcb->snd_wl1, seqno, pcb->snd_wl2)); pcb->lastack, ackno, pcb->snd_wl1, seqno, pcb->snd_wl2));

View File

@ -322,7 +322,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len)
/* fail on too much data */ /* fail on too much data */
if (len > pcb->snd_buf) { if (len > pcb->snd_buf) {
LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too much data (len=%"U16_F" > snd_buf=%"U16_F")\n", LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too much data (len=%"U16_F" > snd_buf=%"TCPWNDSIZE_F")\n",
len, pcb->snd_buf)); len, pcb->snd_buf));
pcb->flags |= TF_NAGLEMEMERR; pcb->flags |= TF_NAGLEMEMERR;
return ERR_MEM; return ERR_MEM;
@ -334,7 +334,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len)
* configured maximum, return an error */ * configured maximum, return an error */
/* check for configured max queuelen and possible overflow */ /* check for configured max queuelen and possible overflow */
if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) { if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too long queue %"TCPWNDSIZE_F" (max %"TCPWNDSIZE_F")\n", LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too long queue %"U16_F" (max %"U16_F")\n",
pcb->snd_queuelen, TCP_SND_QUEUELEN)); pcb->snd_queuelen, TCP_SND_QUEUELEN));
TCP_STATS_INC(tcp.memerr); TCP_STATS_INC(tcp.memerr);
pcb->flags |= TF_NAGLEMEMERR; pcb->flags |= TF_NAGLEMEMERR;
@ -604,7 +604,8 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
* length of the queue exceeds the configured maximum or * length of the queue exceeds the configured maximum or
* overflows. */ * overflows. */
if ((queuelen > TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) { if ((queuelen > TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: queue too long %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F")\n", queuelen, TCP_SND_QUEUELEN)); LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: queue too long %"U16_F" (%d)\n",
queuelen, (int)TCP_SND_QUEUELEN));
pbuf_free(p); pbuf_free(p);
goto memerr; goto memerr;
} }
@ -1455,7 +1456,7 @@ tcp_rexmit_fast(struct tcp_pcb *pcb)
/* The minimum value for ssthresh should be 2 MSS */ /* The minimum value for ssthresh should be 2 MSS */
if (pcb->ssthresh < (2U * pcb->mss)) { if (pcb->ssthresh < (2U * pcb->mss)) {
LWIP_DEBUGF(TCP_FR_DEBUG, LWIP_DEBUGF(TCP_FR_DEBUG,
("tcp_receive: The minimum value for ssthresh %"U16_F ("tcp_receive: The minimum value for ssthresh %"TCPWNDSIZE_F
" should be min 2 mss %"U16_F"...\n", " should be min 2 mss %"U16_F"...\n",
pcb->ssthresh, 2*pcb->mss)); pcb->ssthresh, 2*pcb->mss));
pcb->ssthresh = 2*pcb->mss; pcb->ssthresh = 2*pcb->mss;