When WiFiClientSecure::connect was called, it would first tear down and
existing and set up new TCP session, then tear down existing TLS session
(using ssl_free), and then set up a new one. This caused TLS close-
notify alert to be sent to the new TCP session, preventing new session
from being established. This change postpones setting IO ctx to the new
TCP connection, fixing this issue.
Ref https://github.com/esp8266/Arduino/issues/3330
The Generic ESP8266 Module provides the basis to compile for anything not on the current list. Although most current boards use the 26MHz crystal, there are many using the 40MHz. This change permits these to be readily accommodated as generic ESP8266 boards.
WiFiClient write timeouts introduced in #3257 applied to the whole write
operation, which could take long time if data size was large. This
change makes the timeout happen per chunk. Timeout now happens if no
data has been delivered within a given interval.
Some websites have certificates with uppercase letters in CN. This change
makes _verifyDN function accept such certificates by converting all names
to lower case before comparing them.
Resolves#2978
- fix response not being delivered to the browser after upload is done
(https://github.com/esp8266/Arduino/issues/2221)
- if Update.begin fails, don’t attempt to write data
- if update is not successful, send error message from Update to the
client
- move strings into PROGMEM
Previously, _write_some function would be called each time TCP stack
notifies the application that some data was delivered (via the `sent`
callback). In turn, _write_some would obtain more data to be sent from
the DataSource. In case of a DataSource backed by a Stream, this would
read from a stream. Some libraries (such as SD) may call `yield` and
other blocking operations from Stream read function, which can not be
used in TCP stack callbacks.
This change moves the data sending loop back into the Arduino task, with
a negligible loss of performance. TCP callback now wakes the main task
via `esp_schedule`, which performs stream read and provides more data
to the TCP stack.
Possible future optimization would be to buffer Stream data ahead of
time. That way, buffered data could be sent immediately from the TCP
callback. On the other hand, this optimization would need extra TCP_MSS
of temporary storage, per connection.
Fixes#2399.
In WiFi.config, if we pass 0.0.0.0 for all three parameters (as local_ip, gateway and subnet mask), it will re enable the DHCP. We need to re connect the device to get the IP from router.