altcp_tls_mbedtls: tcp_out: Fix handshake when called from u-boot

When using the http-client LWIP app in U-Boot (OS_SYS=0), the handshake
fails because LWIP doesn't send TCP packets after it initiates.

Signed-off-by: Javier Tia <javier.tia@linaro.org>
This commit is contained in:
Javier Tia 2024-04-26 14:51:21 -06:00
parent 0ccd09df52
commit 2e7fb9700a
No known key found for this signature in database
GPG Key ID: B5EEC30BA867771F
2 changed files with 3 additions and 9 deletions

View File

@ -1292,6 +1292,8 @@ altcp_mbedtls_bio_send(void *ctx, const unsigned char *dataptr, size_t size)
while (size_left) {
u16_t write_len = (u16_t)LWIP_MIN(size_left, 0xFFFF);
err_t err = altcp_write(conn->inner_conn, (const void *)dataptr, write_len, apiflags);
/* try to send data... */
altcp_output(conn->inner_conn);
if (err == ERR_OK) {
written += write_len;
size_left -= write_len;

View File

@ -1255,14 +1255,6 @@ tcp_output(struct tcp_pcb *pcb)
LWIP_ASSERT("don't call tcp_output for listen-pcbs",
pcb->state != LISTEN);
/* First, check if we are invoked by the TCP input processing
code. If so, we do not output anything. Instead, we rely on the
input processing code to call us when input processing is done
with. */
if (tcp_input_pcb == pcb) {
return ERR_OK;
}
wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);
seg = pcb->unsent;
@ -2039,7 +2031,7 @@ tcp_rst(const struct tcp_pcb *pcb, u32_t seqno, u32_t ackno,
u16_t local_port, u16_t remote_port)
{
struct pbuf *p;
p = tcp_rst_common(pcb, seqno, ackno, local_ip, remote_ip, local_port, remote_port);
if (p != NULL) {
tcp_output_control_segment(pcb, p, local_ip, remote_ip);