|
|
@@ -359,6 +359,7 @@ typedef struct
|
|
|
uint8_t fast_timer_active;
|
|
|
uint8_t dhcp_check_cnt;
|
|
|
uint8_t next_socket_index;
|
|
|
+ uint8_t fast_rx_ack;
|
|
|
}net_lwip_ctrl_struct;
|
|
|
|
|
|
static net_lwip_ctrl_struct prvlwip;
|
|
|
@@ -532,7 +533,10 @@ static err_t net_lwip_tcp_recv_cb(void *arg, struct tcp_pcb *tpcb,
|
|
|
|
|
|
if (p)
|
|
|
{
|
|
|
-// tcp_recved(tpcb, p->tot_len);
|
|
|
+ if (prvlwip.socket[socket_id].fast_rx_ack)
|
|
|
+ {
|
|
|
+ tcp_recved(tpcb, p->tot_len);
|
|
|
+ }
|
|
|
len = p->tot_len;
|
|
|
if (net_lwip_rx_data(socket_id, p, NULL, 0))
|
|
|
{
|
|
|
@@ -1100,7 +1104,10 @@ static void net_lwip_task(void *param)
|
|
|
NET_DBG("error socket %d state %d,%x,%d", socket_id, prvlwip.socket[socket_id].in_use, prvlwip.socket[socket_id].pcb.ip, prvlwip.socket[socket_id].is_tcp);
|
|
|
break;
|
|
|
}
|
|
|
-// NET_DBG("socket %d rx ack %dbytes", socket_id, event.Param2);
|
|
|
+ if (prvlwip.socket[socket_id].fast_rx_ack)
|
|
|
+ {
|
|
|
+ NET_DBG("socket %d rx ack %dbytes, but in fast ack mode", socket_id, event.Param2);
|
|
|
+ }
|
|
|
tcp_recved(prvlwip.socket[socket_id].pcb.tcp, event.Param2);
|
|
|
break;
|
|
|
case EV_LWIP_SOCKET_CREATE:
|
|
|
@@ -1448,7 +1455,7 @@ static void net_lwip_create_socket_now(uint8_t adapter_index, uint8_t socket_id)
|
|
|
{
|
|
|
prvlwip.socket[socket_id].pcb.tcp->more_delay = 6;
|
|
|
}
|
|
|
-
|
|
|
+ prvlwip.socket[socket_id].fast_rx_ack = prvlwip.fast_rx_ack;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -1613,7 +1620,7 @@ static uint32_t net_lwip_socket_read_data(int socket_id, uint8_t *buf, uint32_t
|
|
|
p->read_pos += dummy_len;
|
|
|
if (p->read_pos >= p->len)
|
|
|
{
|
|
|
- if (prvlwip.socket[socket_id].is_tcp)
|
|
|
+ if (prvlwip.socket[socket_id].is_tcp && !prvlwip.socket[socket_id].fast_rx_ack)
|
|
|
{
|
|
|
platform_send_event(prvlwip.task_handle, EV_LWIP_SOCKET_RX_DONE, socket_id, p->len, 0);
|
|
|
}
|
|
|
@@ -2310,3 +2317,8 @@ void net_lwip_set_ipv6_by_mac(uint8_t adapter_index)
|
|
|
{
|
|
|
platform_send_event(prvlwip.task_handle, EV_LWIP_NETIF_IPV6_BY_MAC, 0, 0, adapter_index);
|
|
|
}
|
|
|
+
|
|
|
+void net_lwip_set_rx_fast_ack(uint8_t adapter_index, uint8_t onoff)
|
|
|
+{
|
|
|
+ prvlwip.fast_rx_ack = onoff;
|
|
|
+}
|