mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
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:
committed by
Damien George
parent
053aade741
commit
72147c02c7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user