Skip to content

Commit cca338b

Browse files
authored
Merge pull request #154 from TechdroidInc/master
feat: Added setting for http reuse (keep-alive)
2 parents 5a835bb + 5a7c6d0 commit cca338b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/esp32FOTA.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ void esp32FOTA::setConfig( FOTAConfig_t cfg )
189189
_cfg.root_ca = cfg.root_ca;
190190
_cfg.pub_key = cfg.pub_key;
191191
_cfg.signature_len = cfg.signature_len;
192+
_cfg.allow_reuse = cfg.allow_reuse;
192193
}
193194

194195

@@ -206,7 +207,8 @@ void esp32FOTA::printConfig( FOTAConfig_t *cfg )
206207
cfg->use_device_id ?"true":"false",
207208
cfg->root_ca ?"true":"false",
208209
cfg->pub_key ?"true":"false",
209-
cfg->signature_len
210+
cfg->signature_len,
211+
cfg->allow_reuse
210212
);
211213
}
212214

@@ -364,7 +366,8 @@ bool esp32FOTA::setupHTTP( const char* url )
364366
{
365367
const char* rootcastr = nullptr;
366368
_http.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
367-
369+
_http.setReuse(_cfg.allow_reuse);
370+
368371
log_i("Connecting to: %s", url );
369372
if( String(url).startsWith("https") ) {
370373
if (!_cfg.unsafe) {

src/esp32FOTA.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ struct FOTAConfig_t
220220
CryptoAsset* root_ca { nullptr };
221221
CryptoAsset* pub_key { nullptr };
222222
size_t signature_len {FW_SIGNATURE_LENGTH};
223+
bool allow_reuse { true };
223224
FOTAConfig_t() = default;
224225
};
225226

0 commit comments

Comments
 (0)