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:
David Girault 2017-08-01 10:46:22 +02:00 committed by goldsimon
parent 0486100a2b
commit bc3edfb4d7

View File

@ -284,7 +284,6 @@ altcp_mbedtls_lower_recv_process(struct altcp_pcb *conn, altcp_mbedtls_state_t *
return ERR_OK;
}
/* 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_appl == 0);
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) {
conn->connected(conn->arg, conn, ERR_OK);
}
if (state->rx)
goto pbuf_left;
return ERR_OK;
} else {
/* handle application data */
pbuf_left:
return altcp_mbedtls_handle_rx_appldata(conn, state);
}
}