|
|
@@ -638,7 +638,7 @@ u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
|
|
|
{
|
|
|
u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
|
|
|
|
|
|
- if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
|
|
|
+ if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND(pcb) / 2), pcb->mss))) {
|
|
|
/* we can advertise more window */
|
|
|
pcb->rcv_ann_wnd = pcb->rcv_wnd;
|
|
|
return new_right_edge - pcb->rcv_ann_right_edge;
|
|
|
@@ -694,10 +694,10 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len)
|
|
|
wnd_inflation = tcp_update_rcv_ann_wnd(pcb);
|
|
|
|
|
|
/* If the change in the right edge of window is significant (default
|
|
|
- * watermark is TCP_WND/4), then send an explicit update now.
|
|
|
+ * watermark is TCP_WND(pcb)/4), then send an explicit update now.
|
|
|
* Otherwise wait for a packet to be sent in the normal course of
|
|
|
* events (or more window to be available later) */
|
|
|
- if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
|
|
|
+ if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD(pcb)) {
|
|
|
tcp_ack_now(pcb);
|
|
|
tcp_output(pcb);
|
|
|
}
|
|
|
@@ -827,9 +827,9 @@ tcp_connect(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port,
|
|
|
pcb->snd_lbb = iss - 1;
|
|
|
/* Start with a window that does not need scaling. When window scaling is
|
|
|
enabled and used, the window is enlarged when both sides agree on scaling. */
|
|
|
- pcb->rcv_wnd = pcb->rcv_ann_wnd = TCPWND_MIN16(TCP_WND);
|
|
|
+ pcb->rcv_wnd = pcb->rcv_ann_wnd = TCPWND_MIN16(TCP_WND(pcb));
|
|
|
pcb->rcv_ann_right_edge = pcb->rcv_nxt;
|
|
|
- pcb->snd_wnd = TCP_WND;
|
|
|
+ pcb->snd_wnd = TCP_WND(pcb);
|
|
|
/* As initial send MSS, we use TCP_MSS but limit it to 536.
|
|
|
The send MSS is updated when an MSS option is received. */
|
|
|
pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
|
|
|
@@ -837,7 +837,7 @@ tcp_connect(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port,
|
|
|
pcb->mss = tcp_eff_send_mss(pcb->mss, &pcb->local_ip, &pcb->remote_ip);
|
|
|
#endif /* TCP_CALCULATE_EFF_SEND_MSS */
|
|
|
pcb->cwnd = 1;
|
|
|
- pcb->ssthresh = TCP_WND;
|
|
|
+ pcb->ssthresh = TCP_WND(pcb);
|
|
|
#if LWIP_CALLBACK_API
|
|
|
pcb->connected = connected;
|
|
|
#else /* LWIP_CALLBACK_API */
|
|
|
@@ -1581,11 +1581,11 @@ tcp_alloc(u8_t prio)
|
|
|
if (pcb != NULL) {
|
|
|
memset(pcb, 0, sizeof(struct tcp_pcb));
|
|
|
pcb->prio = prio;
|
|
|
- pcb->snd_buf = TCP_SND_BUF;
|
|
|
+ pcb->snd_buf = TCP_SND_BUF_DEFAULT;
|
|
|
pcb->snd_queuelen = 0;
|
|
|
/* Start with a window that does not need scaling. When window scaling is
|
|
|
enabled and used, the window is enlarged when both sides agree on scaling. */
|
|
|
- pcb->rcv_wnd = pcb->rcv_ann_wnd = TCPWND_MIN16(TCP_WND);
|
|
|
+ pcb->rcv_wnd = pcb->rcv_ann_wnd = TCPWND_MIN16(TCP_WND(pcb));
|
|
|
#if LWIP_WND_SCALE
|
|
|
/* snd_scale and rcv_scale are zero unless both sides agree to use scaling */
|
|
|
pcb->snd_scale = 0;
|
|
|
@@ -1608,7 +1608,6 @@ tcp_alloc(u8_t prio)
|
|
|
pcb->snd_lbb = iss;
|
|
|
pcb->tmr = tcp_ticks;
|
|
|
pcb->last_timer = tcp_timer_ctr;
|
|
|
-
|
|
|
pcb->polltmr = 0;
|
|
|
|
|
|
#if LWIP_CALLBACK_API
|
|
|
@@ -1624,7 +1623,13 @@ tcp_alloc(u8_t prio)
|
|
|
#endif /* LWIP_TCP_KEEPALIVE */
|
|
|
|
|
|
pcb->keep_cnt_sent = 0;
|
|
|
+
|
|
|
+#if ESP_PER_SOC_TCP_WND
|
|
|
+ pcb->per_soc_tcp_wnd = TCP_WND_DEFAULT;
|
|
|
+ pcb->per_soc_tcp_snd_buf = TCP_SND_BUF_DEFAULT;
|
|
|
+#endif
|
|
|
}
|
|
|
+
|
|
|
return pcb;
|
|
|
}
|
|
|
|