When webserver receives a websocket packet, it generates websocket
handler for processing the packet and inherits its own context. In this
process, mbedtls network file descriptor (fd) context was not inherited
properly and changed it. Because of this problem, the websocket client
handler thread cannot be released sometimes.
Change-Id: I9e70bd506a61091f442e8da8e18c62400b1bb211
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
ws->tls_ssl = (mbedtls_ssl_context *)malloc(sizeof(mbedtls_ssl_context));
memcpy(ws->tls_ssl, &client->tls_ssl, sizeof(mbedtls_ssl_context));
ws->tls_conf = &client->server->tls_conf;
+ mbedtls_ssl_set_bio(ws->tls_ssl, &ws->tls_net, mbedtls_net_send, mbedtls_net_recv, NULL);
}
#endif
pthread_attr_init(&ws->thread_attr);