Skip to content

Commit 78ef65f

Browse files
committed
issue: 4669942 Don't increase error counter on TCP EOF
EOF is a regular scenario. Treating it as an error in the stats can be confusing. Signed-off-by: Dmytro Podgornyi <[email protected]>
1 parent 9e1d79d commit 78ef65f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core/lwip/tcp_in.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void L3_level_tcp_input(struct pbuf *p, struct tcp_pcb *pcb)
198198
PCB. */
199199
tcp_pcb_remove(pcb);
200200
} else {
201-
/* If the application has registered a "sent" function to be
201+
/* If the application has registered an "acked" function to be
202202
called when new send buffer space is available, we call it
203203
now. */
204204
if (pcb->acked > 0) {
@@ -225,7 +225,7 @@ void L3_level_tcp_input(struct pbuf *p, struct tcp_pcb *pcb)
225225
if (err == ERR_ABRT) {
226226
goto aborted;
227227
}
228-
/* If the upper layer can't receive this data, store it */
228+
/* If the upper layer can't receive this data, drop it */
229229
if (err != ERR_OK) {
230230
pcb->rcv_wnd += in_data.recv_data->tot_len;
231231
pbuf_free(in_data.recv_data);

src/core/sock/sockinfo_tcp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2234,7 +2234,7 @@ int sockinfo_tcp::handle_rx_error(bool blocking)
22342234
errno = EAGAIN;
22352235
}
22362236

2237-
if (m_p_socket_stats) {
2237+
if (unlikely(m_p_socket_stats) && ret == -1) {
22382238
if (errno == EAGAIN) {
22392239
m_p_socket_stats->counters.n_rx_eagain++;
22402240
} else {

0 commit comments

Comments
 (0)