Skip to content

Commit

Permalink
feat(mbedtls): Speed up mbedtls handshake process
Browse files Browse the repository at this point in the history
Speed up mbedtls handshake process

internal gitlab: 468d320c
  • Loading branch information
wujiangang committed Dec 5, 2017
1 parent d6fa6df commit 493e8c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ phy:
gitlab:
driver : 68fc7b06
lwip : 798515fd
mbedtls : 798515fd
mbedtls : fd271f4e
Binary file modified lib/libmbedtls.a
Binary file not shown.
4 changes: 4 additions & 0 deletions third_party/mbedtls/app/espconn_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,9 @@ int __attribute__((weak)) mbedtls_parse_internal(int socket, sint8 error)
}

system_soft_wdt_stop();
uint8 cpu_freq;
cpu_freq = system_get_cpu_freq();
system_update_cpu_freq(160);
while ((ret = mbedtls_ssl_handshake(&TLSmsg->ssl)) != 0) {

if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
Expand All @@ -892,6 +895,7 @@ int __attribute__((weak)) mbedtls_parse_internal(int socket, sint8 error)
}
}
system_soft_wdt_restart();
system_update_cpu_freq(cpu_freq);
lwIP_REQUIRE_NOERROR(ret, exit);
/**/
TLSmsg->quiet = mbedtls_handshake_result(TLSmsg);
Expand Down

0 comments on commit 493e8c0

Please sign in to comment.