mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-27 21:16:50 +03:00
Fix undefined behaviour in WiFiServer::setNoDelay (#1695)
This commit is contained in:
parent
2bc6d6b4a2
commit
213914e1ce
@ -81,19 +81,11 @@ void WiFiServer::begin() {
|
||||
}
|
||||
|
||||
void WiFiServer::setNoDelay(bool nodelay) {
|
||||
if (!_pcb)
|
||||
return;
|
||||
|
||||
if (nodelay)
|
||||
tcp_nagle_disable(_pcb);
|
||||
else
|
||||
tcp_nagle_enable(_pcb);
|
||||
_noDelay = nodelay;
|
||||
}
|
||||
|
||||
bool WiFiServer::getNoDelay() {
|
||||
if (!_pcb)
|
||||
return false;
|
||||
return tcp_nagle_disabled(_pcb);
|
||||
return _noDelay;
|
||||
}
|
||||
|
||||
bool WiFiServer::hasClient() {
|
||||
@ -106,6 +98,7 @@ WiFiClient WiFiServer::available(byte* status) {
|
||||
if (_unclaimed) {
|
||||
WiFiClient result(_unclaimed);
|
||||
_unclaimed = _unclaimed->next();
|
||||
result.setNoDelay(_noDelay);
|
||||
DEBUGV("WS:av\r\n");
|
||||
return result;
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ private:
|
||||
|
||||
ClientContext* _unclaimed;
|
||||
ClientContext* _discarded;
|
||||
bool _noDelay = false;
|
||||
|
||||
public:
|
||||
WiFiServer(IPAddress addr, uint16_t port);
|
||||
|
Loading…
x
Reference in New Issue
Block a user