Merge pull request #6832 from s-hadinger/fix_upnp_crash

Fix random crash caused by UPNP flood
This commit is contained in:
Theo Arends 2019-11-03 20:50:04 +01:00 committed by GitHub
commit 9a431af91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
/*********************************************************************************************\ /*********************************************************************************************\
* 7.0.0.3 20191103 * 7.0.0.3 20191103
* Initial support for I2C driver runtime control using command I2CDriver and document I2CDEVICES.md * Initial support for I2C driver runtime control using command I2CDriver and document I2CDEVICES.md
* Fix random crash caused by UPNP flood
* *
* 7.0.0.2 20191102 * 7.0.0.2 20191102
* Add command WebColor19 to control color of Module and Name (#6811) * Add command WebColor19 to control color of Module and Name (#6811)

View File

@ -75,7 +75,7 @@ bool UdpConnect(void)
void PollUdp(void) void PollUdp(void)
{ {
if (udp_connected) { if (udp_connected) {
if (PortUdp.parsePacket()) { while (PortUdp.parsePacket()) {
char packet_buffer[UDP_BUFFER_SIZE]; // buffer to hold incoming UDP/SSDP packet char packet_buffer[UDP_BUFFER_SIZE]; // buffer to hold incoming UDP/SSDP packet
int len = PortUdp.read(packet_buffer, UDP_BUFFER_SIZE -1); int len = PortUdp.read(packet_buffer, UDP_BUFFER_SIZE -1);
@ -134,7 +134,7 @@ void PollUdp(void)
} }
} }
delay(1); optimistic_yield(100);
} }
} }