esp-tls: Fix connection failure when esp-tls config is empty
This commit is contained in:
parent
a48e0121e0
commit
0d0445103b
1 changed files with 6 additions and 7 deletions
|
@ -279,12 +279,11 @@ esp_tls_t *esp_tls_conn_new(const char *hostname, int hostlen, int port, const e
|
|||
}
|
||||
tls->read = tls_read;
|
||||
tls->write = tls_write;
|
||||
}
|
||||
|
||||
if (cfg->non_block == true) {
|
||||
int flags = fcntl(tls->sockfd, F_GETFL, 0);
|
||||
fcntl(tls->sockfd, F_SETFL, flags | O_NONBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
return tls;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue