mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-06 22:44:38 +08:00
altcp_tls_mbedtls: remove "rx pbufs left at end of handshake" assert
There is case where a close notify come right after the handshake and is in the same pbuf! So just handle these data like any other data.
This commit is contained in:
parent
0486100a2b
commit
bc3edfb4d7
@ -284,7 +284,6 @@ altcp_mbedtls_lower_recv_process(struct altcp_pcb *conn, altcp_mbedtls_state_t *
|
|||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
/* If we come here, handshake succeeded. */
|
/* If we come here, handshake succeeded. */
|
||||||
LWIP_ASSERT("rx pbufs left at end of handshake", state->rx == NULL);
|
|
||||||
LWIP_ASSERT("state", state->bio_bytes_read == 0);
|
LWIP_ASSERT("state", state->bio_bytes_read == 0);
|
||||||
LWIP_ASSERT("state", state->bio_bytes_appl == 0);
|
LWIP_ASSERT("state", state->bio_bytes_appl == 0);
|
||||||
state->flags |= ALTCP_MBEDTLS_FLAGS_HANDSHAKE_DONE;
|
state->flags |= ALTCP_MBEDTLS_FLAGS_HANDSHAKE_DONE;
|
||||||
@ -292,9 +291,12 @@ altcp_mbedtls_lower_recv_process(struct altcp_pcb *conn, altcp_mbedtls_state_t *
|
|||||||
if (conn->connected) {
|
if (conn->connected) {
|
||||||
conn->connected(conn->arg, conn, ERR_OK);
|
conn->connected(conn->arg, conn, ERR_OK);
|
||||||
}
|
}
|
||||||
|
if (state->rx)
|
||||||
|
goto pbuf_left;
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
} else {
|
} else {
|
||||||
/* handle application data */
|
/* handle application data */
|
||||||
|
pbuf_left:
|
||||||
return altcp_mbedtls_handle_rx_appldata(conn, state);
|
return altcp_mbedtls_handle_rx_appldata(conn, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user