From bdd6d55e9932d0f703c3207e16de7e51c853cd01 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 23 May 2020 06:44:19 +0000 Subject: [PATCH] calling clearenv() only if it's avaialble --- mio/bin/t01.c | 2 +- mio/lib/http-svr.c | 4 ++++ mio/lib/sys-mux.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mio/bin/t01.c b/mio/bin/t01.c index 262e127..1bc3d9a 100644 --- a/mio/bin/t01.c +++ b/mio/bin/t01.c @@ -1135,7 +1135,7 @@ for (i = 0; i < 5; i++) //mio_bcstrtoskad (mio, "[fe80::c7e2:bd6e:1209:ac1b%eno1]:1153", &servaddr); //mio_bcstrtoskad (mio, "[::]:9988", &htts_bind_addr); - mio_bcstrtoskad (mio, "127.0.0.1:9988", &htts_bind_addr); + mio_bcstrtoskad (mio, "0.0.0.0:9988", &htts_bind_addr); dnc = mio_svc_dnc_start(mio, &servaddr, MIO_NULL, &send_tmout, &reply_tmout, 2); /* option - send to all, send one by one */ htts = mio_svc_htts_start(mio, &htts_bind_addr, process_http_request); diff --git a/mio/lib/http-svr.c b/mio/lib/http-svr.c index 5f43a9c..a5300c7 100644 --- a/mio/lib/http-svr.c +++ b/mio/lib/http-svr.c @@ -1277,7 +1277,11 @@ static int cgi_peer_on_fork (mio_dev_pro_t* pro, void* fork_ctx) path = getenv("PATH"); lang = getenv("LANG"); +#if defined(HAVE_CLEARENV) clearenv (); +#else + putenv ("environ=NULL"); +#endif if (path) setenv ("PATH", path, 1); if (lang) setenv ("LANG", lang, 1); diff --git a/mio/lib/sys-mux.c b/mio/lib/sys-mux.c index 37f4a50..d40b9e7 100644 --- a/mio/lib/sys-mux.c +++ b/mio/lib/sys-mux.c @@ -243,7 +243,7 @@ int mio_sys_waitmux (mio_t* mio, const mio_ntime_t* tmout, mio_sys_mux_evtcb_t e dev = mux->pd.dptr[i]; - MIO_ASSERT (mio, !(mux->pd.pfd[i].revents & POLLNVAL)); + /*MIO_ASSERT (mio, !(mux->pd.pfd[i].revents & POLLNVAL));*/ if (mux->pd.pfd[i].revents & POLLIN) events |= MIO_DEV_EVENT_IN; if (mux->pd.pfd[i].revents & POLLOUT) events |= MIO_DEV_EVENT_OUT; if (mux->pd.pfd[i].revents & POLLPRI) events |= MIO_DEV_EVENT_PRI;