Skip to content

Commit 490f5ca

Browse files
committed
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>
1 parent 9fd2bf4 commit 490f5ca

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/apps/altcp_tls/altcp_tls_mbedtls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,8 @@ altcp_mbedtls_bio_send(void *ctx, const unsigned char *dataptr, size_t size)
12921292
while (size_left) {
12931293
u16_t write_len = (u16_t)LWIP_MIN(size_left, 0xFFFF);
12941294
err_t err = altcp_write(conn->inner_conn, (const void *)dataptr, write_len, apiflags);
1295+
/* try to send data... */
1296+
altcp_output(conn->inner_conn);
12951297
if (err == ERR_OK) {
12961298
written += write_len;
12971299
size_left -= write_len;

src/core/tcp_out.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,14 +1255,6 @@ tcp_output(struct tcp_pcb *pcb)
12551255
LWIP_ASSERT("don't call tcp_output for listen-pcbs",
12561256
pcb->state != LISTEN);
12571257

1258-
/* First, check if we are invoked by the TCP input processing
1259-
code. If so, we do not output anything. Instead, we rely on the
1260-
input processing code to call us when input processing is done
1261-
with. */
1262-
if (tcp_input_pcb == pcb) {
1263-
return ERR_OK;
1264-
}
1265-
12661258
wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);
12671259

12681260
seg = pcb->unsent;
@@ -2039,7 +2031,7 @@ tcp_rst(const struct tcp_pcb *pcb, u32_t seqno, u32_t ackno,
20392031
u16_t local_port, u16_t remote_port)
20402032
{
20412033
struct pbuf *p;
2042-
2034+
20432035
p = tcp_rst_common(pcb, seqno, ackno, local_ip, remote_ip, local_port, remote_port);
20442036
if (p != NULL) {
20452037
tcp_output_control_segment(pcb, p, local_ip, remote_ip);

0 commit comments

Comments
 (0)