esp32/network_ppp: Stop polling if stream becomes None.
If while a polling operation is active the stream is removed we should stop polling data from that stream. This was already the intended behaviour, but implemented incorrectly. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
This commit is contained in:
parent
053aade741
commit
72147c02c7
2 changed files with 4 additions and 4 deletions
|
|
@ -145,8 +145,8 @@ static mp_obj_t network_ppp_poll(size_t n_args, const mp_obj_t *args) {
|
|||
}
|
||||
|
||||
mp_int_t total_len = 0;
|
||||
mp_obj_t stream = self->stream;
|
||||
while (stream != mp_const_none) {
|
||||
mp_obj_t stream;
|
||||
while ((stream = self->stream) != mp_const_none) {
|
||||
uint8_t buf[256];
|
||||
int err;
|
||||
mp_uint_t len = mp_stream_rw(stream, buf, sizeof(buf), &err, 0);
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ static mp_obj_t network_ppp_poll(size_t n_args, const mp_obj_t *args) {
|
|||
}
|
||||
|
||||
mp_int_t total_len = 0;
|
||||
mp_obj_t stream = self->stream;
|
||||
while (stream != mp_const_none) {
|
||||
mp_obj_t stream;
|
||||
while ((stream = self->stream) != mp_const_none) {
|
||||
uint8_t buf[256];
|
||||
int err;
|
||||
mp_uint_t len = mp_stream_rw(stream, buf, sizeof(buf), &err, 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue