Skip to content

Commit f9de677

Browse files
Adam5Wume-no-dev
authored andcommitted
Do not account ack length before ssl handshake finish (me-no-dev#86)
* Do not account ack length before ssl handshake finish * Add appropriate #ifdefs
1 parent 55cd520 commit f9de677

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ESPAsyncTCP.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,14 @@ void AsyncClient::_ssl_error(int8_t err){
366366
#endif
367367

368368
err_t AsyncClient::_sent(tcp_pcb* pcb, uint16_t len) {
369+
#if ASYNC_TCP_SSL_ENABLED
370+
if (_pcb_secure && !_handshake_done)
371+
return ERR_OK;
372+
#endif
369373
_rx_last_packet = millis();
370-
ASYNC_TCP_DEBUG("_sent: %u\n", len);
371374
_tx_unacked_len -= len;
372375
_tx_acked_len += len;
376+
ASYNC_TCP_DEBUG("_sent: %u (%d %d)\n", len, _tx_unacked_len, _tx_acked_len);
373377
if(_tx_unacked_len == 0){
374378
_pcb_busy = false;
375379
if(_sent_cb)

0 commit comments

Comments
 (0)