@@ -128,14 +128,14 @@ class ClientContext
128
128
if (err != ERR_OK) {
129
129
return 0 ;
130
130
}
131
- _delaying = true ;
131
+ _connect_pending = true ;
132
132
_op_start_time = millis ();
133
133
// Following delay will be interrupted by connect callback
134
- for (decltype (_timeout_ms) i = 0 ; _delaying && i < _timeout_ms; i++) {
134
+ for (decltype (_timeout_ms) i = 0 ; _connect_pending && i < _timeout_ms; i++) {
135
135
// Give scheduled functions a chance to run (e.g. Ethernet uses recurrent)
136
136
delay (1 );
137
137
}
138
- _delaying = false ;
138
+ _connect_pending = false ;
139
139
if (!_pcb) {
140
140
DEBUGV (" :cabrt\r\n " );
141
141
return 0 ;
@@ -432,16 +432,17 @@ class ClientContext
432
432
433
433
void _notify_error ()
434
434
{
435
- if (_delaying) {
436
- _delaying = false ;
435
+ if (_connect_pending || _send_waiting) {
436
+ _send_waiting = false ;
437
+ _connect_pending = false ;
437
438
esp_schedule (); // break current delay()
438
439
}
439
440
}
440
441
441
442
size_t _write_from_source (DataSource* ds)
442
443
{
443
444
assert (_datasource == nullptr );
444
- assert (!_delaying );
445
+ assert (!_send_waiting );
445
446
_datasource = ds;
446
447
_written = 0 ;
447
448
_op_start_time = millis ();
@@ -459,13 +460,13 @@ class ClientContext
459
460
break ;
460
461
}
461
462
462
- _delaying = true ;
463
+ _send_waiting = true ;
463
464
// Following delay will be interrupted by on next received ack
464
- for (decltype (_timeout_ms) i = 0 ; _delaying && i < _timeout_ms; i++) {
465
+ for (decltype (_timeout_ms) i = 0 ; _send_waiting && i < _timeout_ms; i++) {
465
466
// Give scheduled functions a chance to run (e.g. Ethernet uses recurrent)
466
467
delay (1 );
467
468
}
468
- _delaying = false ;
469
+ _send_waiting = false ;
469
470
} while (true );
470
471
471
472
if (_sync)
@@ -533,8 +534,8 @@ class ClientContext
533
534
534
535
void _write_some_from_cb ()
535
536
{
536
- if (_delaying ) {
537
- _delaying = false ;
537
+ if (_send_waiting ) {
538
+ _send_waiting = false ;
538
539
esp_schedule (); // break current delay()
539
540
}
540
541
}
@@ -609,8 +610,8 @@ class ClientContext
609
610
(void ) err;
610
611
(void ) pcb;
611
612
assert (pcb == _pcb);
612
- if (_delaying ) {
613
- _delaying = false ;
613
+ if (_connect_pending ) {
614
+ _connect_pending = false ;
614
615
esp_schedule (); // break current delay()
615
616
}
616
617
return ERR_OK;
@@ -660,7 +661,8 @@ class ClientContext
660
661
size_t _written = 0 ;
661
662
uint32_t _timeout_ms = 5000 ;
662
663
uint32_t _op_start_time = 0 ;
663
- bool _delaying = false ;
664
+ bool _send_waiting = false ;
665
+ bool _connect_pending = false ;
664
666
665
667
int8_t _refcnt;
666
668
ClientContext* _next;
0 commit comments