]> prime8.dev >> repos - ttyd.git/commit
Avoid slow reverse-DNS requests caused by libwebsocket (#222)
authorXiang Dai <764524258@qq.com>
Tue, 3 Sep 2019 05:53:54 +0000 (13:53 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Tue, 3 Sep 2019 05:53:54 +0000 (13:53 +0800)
commit94817b4eb37ea547893f26c9fc1b5ede2292e69b
tree58667a5d06aadc14da69e9ab25c10670d58a0f1b
parent43c5aedd356dada21c7896ff3d6efc427d9e27df
Avoid slow reverse-DNS requests caused by libwebsocket (#222)

* Avoid slow reverse-DNS requests caused by libwebsocket

According to warmcat/libwebsockets#537 and following my own experience, in some circumstances lws_get_peer_addresses can take several seconds to execute a reverse DNS request on a connected peer IP. The effect is that sometimes a websocket connection takes several seconds before it is established.
This PR addresses the described issue by replacing lws_get_peer_addresses with lws_get_peer_simple that completely skips the RDNS request.

Signed-off-by: Xiang Dai <764524258@qq.com>
src/http.c