changed mio-sck.c to ignore some eunavailable feature request

This commit is contained in:
hyung-hwan 2019-04-12 02:45:35 +00:00
parent 564af6fbaf
commit 2ec12d96eb
4 changed files with 20 additions and 12 deletions

View File

@ -54,13 +54,13 @@ libmio_la_SOURCES = \
utl.c
libmio_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libmio_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libmio_la_LIBADD = $(LIBADD_LIB_COMMON) $(SSL_LIBS)
libmio_la_LIBADD = $(LIBADD_LIB_COMMON) $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS)
bin_PROGRAMS = mio
mio_SOURCES = main.c
mio_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
mio_LDFLAGS = $(LDFLAGS_LIB_COMMON)
mio_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS)
mio_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS)
install-data-hook:
@echo "#ifndef _MIO_CFG_H_" > "$(DESTDIR)$(includedir)/mio-cfg.h"

View File

@ -139,7 +139,8 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
libmio_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
libmio_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_libmio_la_OBJECTS = libmio_la-dns.lo libmio_la-err.lo \
libmio_la-fmtout.lo libmio_la-mio.lo libmio_la-mio-pro.lo \
libmio_la-mio-sck.lo libmio_la-sck-addr.lo libmio_la-sys.lo \
@ -157,7 +158,8 @@ libmio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
PROGRAMS = $(bin_PROGRAMS)
am_mio_OBJECTS = mio-main.$(OBJEXT)
mio_OBJECTS = $(am_mio_OBJECTS)
mio_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
mio_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
mio_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(mio_LDFLAGS) $(LDFLAGS) -o $@
@ -427,11 +429,11 @@ libmio_la_SOURCES = \
libmio_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libmio_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libmio_la_LIBADD = $(LIBADD_LIB_COMMON) $(SSL_LIBS)
libmio_la_LIBADD = $(LIBADD_LIB_COMMON) $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS)
mio_SOURCES = main.c
mio_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
mio_LDFLAGS = $(LDFLAGS_LIB_COMMON)
mio_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS)
mio_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS)
all: mio-cfg.h
$(MAKE) $(AM_MAKEFLAGS) all-am

View File

@ -675,7 +675,7 @@ int main (int argc, char* argv[])
tcp[0] = mio_dev_sck_make(mio, MIO_SIZEOF(tcp_server_t), &tcp_make);
if (!tcp[0])
{
printf ("Cannot make tcp\n");
MIO_INFO1 (mio, "Cannot make tcp - %js\n", mio_geterrmsg(mio));
goto oops;
}
@ -693,7 +693,7 @@ int main (int argc, char* argv[])
tcp_conn.options = MIO_DEV_SCK_CONNECT_SSL;
if (mio_dev_sck_connect(tcp[0], &tcp_conn) <= -1)
{
MIO_INFO0 (mio, "tcp[0] mio_dev_sck_connect() failed....\n");
MIO_INFO1 (mio, "tcp[0] mio_dev_sck_connect() failed - %js\n", mio_geterrmsg(mio));
/* carry on regardless of failure */
}
@ -708,7 +708,7 @@ int main (int argc, char* argv[])
tcp[1] = mio_dev_sck_make(mio, MIO_SIZEOF(tcp_server_t), &tcp_make);
if (!tcp[1])
{
MIO_INFO0 (mio, "cannot make tcp[1]....\n");
MIO_INFO1 (mio, "Cannot make tcp[1] - %js\n", mio_geterrmsg(mio));
goto oops;
}
ts = (tcp_server_t*)(tcp[1] + 1);
@ -720,7 +720,7 @@ int main (int argc, char* argv[])
if (mio_dev_sck_bind(tcp[1],&tcp_bind) <= -1)
{
MIO_INFO0 (mio, "tcp[1] mio_dev_sck_bind() failed....\n");
MIO_INFO1 (mio, "tcp[1] mio_dev_sck_bind() failed - %js\n", mio_geterrmsg(mio));
goto oops;
}
@ -728,7 +728,7 @@ int main (int argc, char* argv[])
tcp_lstn.backlogs = 100;
if (mio_dev_sck_listen(tcp[1], &tcp_lstn) <= -1)
{
MIO_INFO0 (mio, "tcp[1] mio_dev_sck_listen() failed....\n");
MIO_INFO1 (mio, "tcp[1] mio_dev_sck_listen() failed - %js\n", mio_geterrmsg(mio));
goto oops;
}
@ -743,7 +743,7 @@ int main (int argc, char* argv[])
tcp[2] = mio_dev_sck_make(mio, MIO_SIZEOF(tcp_server_t), &tcp_make);
if (!tcp[2])
{
printf ("Cannot make tcp\n");
MIO_INFO1 (mio, "Cannot make tcp[2] - %js\n", mio_geterrmsg(mio));
goto oops;
}
ts = (tcp_server_t*)(tcp[2] + 1);

View File

@ -825,9 +825,11 @@ static int dev_sck_ioctl (mio_dev_t* dev, int cmd, void* arg)
mio_seterrbfmtwithsyserr (mio, 0, errno, "unable to set SO_REUSEADDR");
return -1;
}
/* ignore it if not available
#else
mio_seterrnum (mio, MIO_ENOIMPL);
return -1;
*/
#endif
}
@ -840,9 +842,11 @@ static int dev_sck_ioctl (mio_dev_t* dev, int cmd, void* arg)
mio_seterrbfmtwithsyserr (mio, 0, errno, "unable to set SO_REUSEPORT");
return -1;
}
/* ignore it if not available
#else
mio_seterrnum (mio, MIO_ENOIMPL);
return -1;
*/
#endif
}
@ -855,9 +859,11 @@ static int dev_sck_ioctl (mio_dev_t* dev, int cmd, void* arg)
mio_seterrbfmtwithsyserr (mio, 0, errno, "unable to set IP_TRANSPARENT");
return -1;
}
/* ignore it if not available
#else
mio_seterrnum (mio, MIO_ENOIMPL);
return -1;
*/
#endif
}