1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-09-08 06:28:00 +03:00

various minor web fixes (#8885)

* httpclient: use refs - httpserver: add chunks in examples

* basic https client: update cert

* debug log: read() returning -1 is usual and means "nothing to read"

* emulation on host: SSL server has never been and is now working

* style

* move SSL server certs from examples into a single place with appropriate warnings

* web-hello-servers: make chunks bigger

* factorize template declaration

* http-client: add getString(pre-reservation)

* mock: add umm_info()

* style

* comment API in example

* style

* fix per review
This commit is contained in:
david gauchard
2023-03-30 19:39:35 +02:00
committed by GitHub
parent d3c102e717
commit 97018a5bbf
18 changed files with 251 additions and 298 deletions

View File

@@ -61,10 +61,22 @@ WiFiClient WiFiServer::available(uint8_t* status)
return accept();
}
WiFiClient WiFiServer::accept()
void WiFiServer::_mockUnclaimed()
{
if (hasClient())
return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
_unclaimed
= slist_append_tail(_unclaimed, new ClientContext(serverAccept(pcb2int(_listen_pcb))));
}
WiFiClient WiFiServer::accept()
{
_mockUnclaimed();
if (_unclaimed)
{
auto ctx = _unclaimed;
_unclaimed = _unclaimed->next();
return WiFiClient(ctx);
}
return WiFiClient();
}