Merge pull request #14429 from gemu2015/email_fix

fix esp8266 email
This commit is contained in:
Theo Arends 2022-01-14 10:12:50 +01:00 committed by GitHub
commit dc2fbb060a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -418,6 +418,10 @@ size_t WiFiClientSecure_light::_write(const uint8_t *buf, size_t size, bool pmem
return sent_bytes;
}
void WiFiClientSecure_light::setInsecure() {
_insecure = true;
}
size_t WiFiClientSecure_light::write(const uint8_t *buf, size_t size) {
return _write(buf, size, false);
}
@ -965,7 +969,7 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) {
_freeSSL();
clearLastError();
#ifdef ESP8266
if (!stack_thunk_light_get_stack_bot()) break;
if (!stack_thunk_light_get_stack_bot()) break;
#endif // ESP8266
_ctx_present = true;

View File

@ -124,6 +124,8 @@ class WiFiClientSecure_light : public WiFiClient {
return _max_thunkstack_use;
}
void setInsecure();
private:
void _clear();
bool _ctx_present;
@ -152,7 +154,6 @@ class WiFiClientSecure_light : public WiFiClient {
unsigned char *_recvapp_buf;
size_t _recvapp_len;
bool _clientConnected(); // Is the underlying socket alive?
bool _connectSSL(const char *hostName); // Do initial SSL handshake
void _freeSSL();

View File

@ -203,6 +203,8 @@ String buffer;
}
client->setTimeout(timeout);
client->setInsecure();
// smtp connect
#ifdef DEBUG_EMAIL_PORT
AddLog(LOG_LEVEL_INFO, PSTR("Connecting: %s on port %d"),host.c_str(),port);
@ -484,4 +486,4 @@ void attach_File(char *path) {
#endif // USE_SENDMAIL
#endif // ESP32
#endif // ESP8266