diff options
author | Aki <please@ignore.pl> | 2020-08-24 17:37:53 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2020-08-24 17:37:53 +0200 |
commit | ef5e5e6691f02844499c57f16b0bb470a83aa92f (patch) | |
tree | da84f0e7592298e35e26a7391d49df66dda29d47 | |
parent | 1667f1be988e9a7f3ae745138b8bd5ecfdc165f5 (diff) | |
download | plop-ef5e5e6691f02844499c57f16b0bb470a83aa92f.zip plop-ef5e5e6691f02844499c57f16b0bb470a83aa92f.tar.gz plop-ef5e5e6691f02844499c57f16b0bb470a83aa92f.tar.bz2 |
Plop now makes sure that client fd is nonblocking
-rw-r--r-- | plop.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -195,6 +195,12 @@ int handle_server(lua_State * L, const int efd, const int server) } } + if (-1 == fcntl(client, F_SETFL, (fcntl(client, F_GETFL, 0) | O_NONBLOCK))) + { + close(client); + return 0; // TODO: Retriage this error at some point. + } + // TODO: Request is not the enitre state of the client. Make them distinct along with responses. struct request * request = new_request(L); if (NULL == request) |