From 265be307cd470476d0f741e91044deab12de4255 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 12 Apr 2019 03:13:07 +0000 Subject: [PATCH] made ssl selective in main.c --- mio/lib/main.c | 5 ++++- mio/lib/mio-sck.c | 1 + mio/lib/mio-sck.h | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mio/lib/main.c b/mio/lib/main.c index fb091d1..d93d1f4 100644 --- a/mio/lib/main.c +++ b/mio/lib/main.c @@ -751,9 +751,12 @@ int main (int argc, char* argv[]) memset (&tcp_bind, 0, MIO_SIZEOF(tcp_bind)); mio_sckaddr_initforip4 (&tcp_bind.localaddr, 1235, MIO_NULL); - tcp_bind.options = MIO_DEV_SCK_BIND_REUSEADDR | /*MIO_DEV_SCK_BIND_REUSEPORT |*/ MIO_DEV_SCK_BIND_SSL; + tcp_bind.options = MIO_DEV_SCK_BIND_REUSEADDR /*| MIO_DEV_SCK_BIND_REUSEPORT |*/; +#if defined(USE_SSL) + tcp_bind.options |= MIO_DEV_SCK_BIND_SSL; tcp_bind.ssl_certfile = "localhost.crt"; tcp_bind.ssl_keyfile = "localhost.key"; +#endif MIO_INIT_NTIME (&tcp_bind.accept_tmout, 5, 1); if (mio_dev_sck_bind(tcp[2], &tcp_bind) <= -1) diff --git a/mio/lib/mio-sck.c b/mio/lib/mio-sck.c index 37672c0..2e55059 100644 --- a/mio/lib/mio-sck.c +++ b/mio/lib/mio-sck.c @@ -1767,3 +1767,4 @@ mio_uint16_t mio_checksumip (const void* hdr, mio_oow_t len) return (mio_uint16_t)~sum; } + diff --git a/mio/lib/mio-sck.h b/mio/lib/mio-sck.h index 518b176..73b360f 100644 --- a/mio/lib/mio-sck.h +++ b/mio/lib/mio-sck.h @@ -596,7 +596,6 @@ MIO_EXPORT mio_uint16_t mio_checksumip ( mio_oow_t len ); - #ifdef __cplusplus } #endif