diff --git a/mio/Makefile.in b/mio/Makefile.in index c321188..71acc1c 100644 --- a/mio/Makefile.in +++ b/mio/Makefile.in @@ -164,8 +164,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \ $(top_srcdir)/ac/compile $(top_srcdir)/ac/config.guess \ $(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \ $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing ac/ar-lib \ - ac/compile ac/config.guess ac/config.sub ac/depcomp \ - ac/install-sh ac/ltmain.sh ac/missing + ac/compile ac/config.guess ac/config.sub ac/install-sh \ + ac/ltmain.sh ac/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff --git a/mio/bin/Makefile.am b/mio/bin/Makefile.am index 9c852be..47cfb78 100644 --- a/mio/bin/Makefile.am +++ b/mio/bin/Makefile.am @@ -40,3 +40,9 @@ mio_t03_SOURCES = t03.c mio_t03_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) mio_t03_LDFLAGS = $(LDFLAGS_LIB_COMMON) mio_t03_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS) + +bin_PROGRAMS += mio-t04 +mio_t04_SOURCES = t04.c +mio_t04_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) +mio_t04_LDFLAGS = $(LDFLAGS_LIB_COMMON) +mio_t04_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS) diff --git a/mio/bin/Makefile.in b/mio/bin/Makefile.in index dd8c4ea..4e99dfd 100644 --- a/mio/bin/Makefile.in +++ b/mio/bin/Makefile.in @@ -89,7 +89,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = mio-execd$(EXEEXT) mio-t01$(EXEEXT) mio-t02$(EXEEXT) \ - mio-t03$(EXEEXT) + mio-t03$(EXEEXT) mio-t04$(EXEEXT) subdir = bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ @@ -141,6 +141,13 @@ mio_t03_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ mio_t03_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(mio_t03_LDFLAGS) $(LDFLAGS) -o $@ +am_mio_t04_OBJECTS = mio_t04-t04.$(OBJEXT) +mio_t04_OBJECTS = $(am_mio_t04_OBJECTS) +mio_t04_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +mio_t04_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(mio_t04_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -158,7 +165,7 @@ depcomp = $(SHELL) $(top_srcdir)/ac/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/mio_execd-execd.Po \ ./$(DEPDIR)/mio_t01-t01.Po ./$(DEPDIR)/mio_t02-t02.Po \ - ./$(DEPDIR)/mio_t03-t03.Po + ./$(DEPDIR)/mio_t03-t03.Po ./$(DEPDIR)/mio_t04-t04.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -179,9 +186,9 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mio_execd_SOURCES) $(mio_t01_SOURCES) $(mio_t02_SOURCES) \ - $(mio_t03_SOURCES) + $(mio_t03_SOURCES) $(mio_t04_SOURCES) DIST_SOURCES = $(mio_execd_SOURCES) $(mio_t01_SOURCES) \ - $(mio_t02_SOURCES) $(mio_t03_SOURCES) + $(mio_t02_SOURCES) $(mio_t03_SOURCES) $(mio_t04_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -387,6 +394,10 @@ mio_t03_SOURCES = t03.c mio_t03_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) mio_t03_LDFLAGS = $(LDFLAGS_LIB_COMMON) mio_t03_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS) +mio_t04_SOURCES = t04.c +mio_t04_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) +mio_t04_LDFLAGS = $(LDFLAGS_LIB_COMMON) +mio_t04_LDADD = $(LIBADD_LIB_COMMON) -lmio $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS) all: all-am .SUFFIXES: @@ -486,6 +497,10 @@ mio-t03$(EXEEXT): $(mio_t03_OBJECTS) $(mio_t03_DEPENDENCIES) $(EXTRA_mio_t03_DEP @rm -f mio-t03$(EXEEXT) $(AM_V_CCLD)$(mio_t03_LINK) $(mio_t03_OBJECTS) $(mio_t03_LDADD) $(LIBS) +mio-t04$(EXEEXT): $(mio_t04_OBJECTS) $(mio_t04_DEPENDENCIES) $(EXTRA_mio_t04_DEPENDENCIES) + @rm -f mio-t04$(EXEEXT) + $(AM_V_CCLD)$(mio_t04_LINK) $(mio_t04_OBJECTS) $(mio_t04_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -496,6 +511,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t01-t01.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t02-t02.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t03-t03.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t04-t04.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -583,6 +599,20 @@ mio_t03-t03.obj: t03.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t03_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mio_t03-t03.obj `if test -f 't03.c'; then $(CYGPATH_W) 't03.c'; else $(CYGPATH_W) '$(srcdir)/t03.c'; fi` +mio_t04-t04.o: t04.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mio_t04-t04.o -MD -MP -MF $(DEPDIR)/mio_t04-t04.Tpo -c -o mio_t04-t04.o `test -f 't04.c' || echo '$(srcdir)/'`t04.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t04-t04.Tpo $(DEPDIR)/mio_t04-t04.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t04.c' object='mio_t04-t04.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mio_t04-t04.o `test -f 't04.c' || echo '$(srcdir)/'`t04.c + +mio_t04-t04.obj: t04.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mio_t04-t04.obj -MD -MP -MF $(DEPDIR)/mio_t04-t04.Tpo -c -o mio_t04-t04.obj `if test -f 't04.c'; then $(CYGPATH_W) 't04.c'; else $(CYGPATH_W) '$(srcdir)/t04.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t04-t04.Tpo $(DEPDIR)/mio_t04-t04.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t04.c' object='mio_t04-t04.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mio_t04-t04.obj `if test -f 't04.c'; then $(CYGPATH_W) 't04.c'; else $(CYGPATH_W) '$(srcdir)/t04.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -720,6 +750,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/mio_t01-t01.Po -rm -f ./$(DEPDIR)/mio_t02-t02.Po -rm -f ./$(DEPDIR)/mio_t03-t03.Po + -rm -f ./$(DEPDIR)/mio_t04-t04.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -769,6 +800,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/mio_t01-t01.Po -rm -f ./$(DEPDIR)/mio_t02-t02.Po -rm -f ./$(DEPDIR)/mio_t03-t03.Po + -rm -f ./$(DEPDIR)/mio_t04-t04.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/mio/bin/t04.c b/mio/bin/t04.c new file mode 100644 index 0000000..31ce5a3 --- /dev/null +++ b/mio/bin/t04.c @@ -0,0 +1,94 @@ + +#include +#include +#include +#include + +static void maria_on_disconnect (mio_dev_maria_t* dev) +{ +} + +static void maria_on_connect (mio_dev_maria_t* dev) +{ +printf ("CONNEcTED...\n"); + if (mio_dev_maria_querywithbchars(dev, "SHOW STATUS", 11) <= -1) + { + mio_dev_maria_halt (dev); + } +} + +static void maria_on_query_started (mio_dev_maria_t* dev) +{ +printf ("QUERY SENT...\n"); + if (mio_dev_maria_fetchrow(dev) <= -1) + { +printf ("FETCH ROW FAILURE\n"); + mio_dev_maria_halt (dev); + } +} + +static void maria_on_row_fetched (mio_dev_maria_t* dev, void* row) +{ + if (!row) printf ("NO MORE ROW..\n"); + else + { + printf ("GOT ROW\n"); + mio_dev_maria_fetchrow (dev); + } +} + +int main (int argc, char* argv[]) +{ + + mio_t* mio = MIO_NULL; + mio_dev_maria_t* maria; + mio_dev_maria_make_t mi; + mio_dev_maria_connect_t ci; + + if (argc != 6) + { + fprintf (stderr, "Usage: %s ipaddr port username password dbname\n", argv[0]); + return -1; + } + + mio = mio_open(MIO_NULL, 0, MIO_NULL, 512, MIO_NULL); + if (!mio) + { + printf ("Cannot open mio\n"); + goto oops; + } + + memset (&ci, 0, MIO_SIZEOF(ci)); + ci.host = argv[1]; + ci.port = 3306; /* TODO: argv[2]; */ + ci.username = argv[3]; + ci.password = argv[4]; + ci.dbname = argv[5]; + + memset (&mi, 0, MIO_SIZEOF(mi)); + /*mi.on_write = maria_on_write; + mi.on_read = maria_on_read;*/ + mi.on_connect = maria_on_connect; + mi.on_disconnect = maria_on_disconnect; + mi.on_query_started = maria_on_query_started; + mi.on_row_fetched = maria_on_row_fetched; + + maria = mio_dev_maria_make(mio, 0, &mi); + if (!maria) + { + printf ("Cannot make a maria db client device\n"); + goto oops; + } + + if (mio_dev_maria_connect(maria, &ci) <= -1) + { + printf ("Cannot connect to maria db server\n"); + goto oops; + } + + mio_loop (mio); + +oops: + if (mio) mio_close (mio); + return 0; +} diff --git a/mio/configure b/mio/configure index 2bdf626..4317df1 100755 --- a/mio/configure +++ b/mio/configure @@ -659,6 +659,8 @@ PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR QUADMATH_LIBS UNWIND_LIBS +ENABLE_MARIADB_FALSE +ENABLE_MARIADB_TRUE SSL_LIBS UNICOWS_LIBS SENDFILE_LIBS @@ -804,6 +806,7 @@ with_gnu_ld with_sysroot enable_libtool_lock enable_ssl +enable_mariadb enable_debug enable_unicode enable_cxx @@ -1453,6 +1456,7 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ssl build the library in the ssl mode (default. yes) + --enable-mariadb enable mariadb support (default. no) --enable-debug build the library in the debug mode (default. no) --enable-unicode Use the unicode character type as the default character type. one of yes, no, yes:2, yes:4, no:2, @@ -18638,6 +18642,30 @@ done fi +# Check whether --enable-mariadb was given. +if test "${enable_mariadb+set}" = set; then : + enableval=$enable_mariadb; enable_mariadb_is=$enableval +else + enable_mariadb_is=no + +fi + +if test "${enable_mariadb_is}" = "yes" +then + +$as_echo "#define MIO_ENABLE_MARIADB 1" >>confdefs.h + +fi + if test "${enable_mariadb_is}" = "yes"; then + ENABLE_MARIADB_TRUE= + ENABLE_MARIADB_FALSE='#' +else + ENABLE_MARIADB_TRUE='#' + ENABLE_MARIADB_FALSE= +fi + + + if test "x${ac_cv_header_libunwind_h}" = "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_backtrace in -lunwind" >&5 @@ -21930,6 +21958,10 @@ if test -z "${MACOSX_TRUE}" && test -z "${MACOSX_FALSE}"; then as_fn_error $? "conditional \"MACOSX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_MARIADB_TRUE}" && test -z "${ENABLE_MARIADB_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_MARIADB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_CXX_TRUE}" && test -z "${ENABLE_CXX_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CXX\" was never defined. diff --git a/mio/configure.ac b/mio/configure.ac index 4ae8665..596cb2d 100644 --- a/mio/configure.ac +++ b/mio/configure.ac @@ -309,6 +309,19 @@ then fi AC_SUBST(SSL_LIBS) +dnl ===== enable-mariadb ===== +AC_ARG_ENABLE([mariadb], + [AS_HELP_STRING([--enable-mariadb],[enable mariadb support (default. no)])], + enable_mariadb_is=$enableval, + enable_mariadb_is=no +) +if test "${enable_mariadb_is}" = "yes" +then + AC_DEFINE([MIO_ENABLE_MARIADB],[1],[build the mariadb device]) +fi +AM_CONDITIONAL(ENABLE_MARIADB, test "${enable_mariadb_is}" = "yes") + + if test "x${ac_cv_header_libunwind_h}" = "xyes" then AC_CHECK_LIB([unwind], [unw_backtrace], diff --git a/mio/lib/Makefile.am b/mio/lib/Makefile.am index a8130cc..59822a5 100644 --- a/mio/lib/Makefile.am +++ b/mio/lib/Makefile.am @@ -83,10 +83,19 @@ libmio_la_SOURCES = \ tmr.c \ utf8.c \ utl.c + + libmio_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) libmio_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) libmio_la_LIBADD = $(LIBADD_LIB_COMMON) $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS) +if ENABLE_MARIADB +include_HEADERS += mio-maria.h +libmio_la_SOURCES += maria.c +libmio_la_LDFLAGS += +libmio_la_LIBADD += -lmariadb +endif + install-data-hook: @echo "#ifndef _MIO_CFG_H_" > "$(DESTDIR)$(includedir)/mio-cfg.h" @echo "#define _MIO_CFG_H_" >> "$(DESTDIR)$(includedir)/mio-cfg.h" diff --git a/mio/lib/Makefile.in b/mio/lib/Makefile.in index e0229bb..85c916d 100644 --- a/mio/lib/Makefile.in +++ b/mio/lib/Makefile.in @@ -89,6 +89,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@ENABLE_MARIADB_TRUE@am__append_1 = mio-maria.h +@ENABLE_MARIADB_TRUE@am__append_2 = maria.c +@ENABLE_MARIADB_TRUE@am__append_3 = +@ENABLE_MARIADB_TRUE@am__append_4 = -lmariadb subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ @@ -99,7 +103,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ +DIST_COMMON = $(srcdir)/Makefile.am $(am__include_HEADERS_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = mio-cfg.h @@ -137,7 +141,15 @@ LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) libmio_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__libmio_la_SOURCES_DIST = chr.c dns.c dns-cli.c ecs.c ecs-imp.h \ + err.c fmt.c fmt-imp.h htb.c htrd.c htre.c http.c http-cgi.c \ + http-svr.c http-thr.c http-txt.c json.c mio-prv.h mio.c nwif.c \ + path.c pipe.c pro.c sck.c skad.c sys.c sys-ass.c sys-err.c \ + sys-log.c sys-mux.c sys-prv.h sys-tim.c thr.c uch-case.h \ + uch-prop.h tmr.c utf8.c utl.c maria.c +@ENABLE_MARIADB_TRUE@am__objects_1 = libmio_la-maria.lo am_libmio_la_OBJECTS = libmio_la-chr.lo libmio_la-dns.lo \ libmio_la-dns-cli.lo libmio_la-ecs.lo libmio_la-err.lo \ libmio_la-fmt.lo libmio_la-htb.lo libmio_la-htrd.lo \ @@ -149,7 +161,7 @@ am_libmio_la_OBJECTS = libmio_la-chr.lo libmio_la-dns.lo \ libmio_la-sys.lo libmio_la-sys-ass.lo libmio_la-sys-err.lo \ libmio_la-sys-log.lo libmio_la-sys-mux.lo libmio_la-sys-tim.lo \ libmio_la-thr.lo libmio_la-tmr.lo libmio_la-utf8.lo \ - libmio_la-utl.lo + libmio_la-utl.lo $(am__objects_1) libmio_la_OBJECTS = $(am_libmio_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -184,10 +196,10 @@ am__depfiles_remade = ./$(DEPDIR)/libmio_la-chr.Plo \ ./$(DEPDIR)/libmio_la-http-thr.Plo \ ./$(DEPDIR)/libmio_la-http-txt.Plo \ ./$(DEPDIR)/libmio_la-http.Plo ./$(DEPDIR)/libmio_la-json.Plo \ - ./$(DEPDIR)/libmio_la-mio.Plo ./$(DEPDIR)/libmio_la-nwif.Plo \ - ./$(DEPDIR)/libmio_la-path.Plo ./$(DEPDIR)/libmio_la-pipe.Plo \ - ./$(DEPDIR)/libmio_la-pro.Plo ./$(DEPDIR)/libmio_la-sck.Plo \ - ./$(DEPDIR)/libmio_la-skad.Plo \ + ./$(DEPDIR)/libmio_la-maria.Plo ./$(DEPDIR)/libmio_la-mio.Plo \ + ./$(DEPDIR)/libmio_la-nwif.Plo ./$(DEPDIR)/libmio_la-path.Plo \ + ./$(DEPDIR)/libmio_la-pipe.Plo ./$(DEPDIR)/libmio_la-pro.Plo \ + ./$(DEPDIR)/libmio_la-sck.Plo ./$(DEPDIR)/libmio_la-skad.Plo \ ./$(DEPDIR)/libmio_la-sys-ass.Plo \ ./$(DEPDIR)/libmio_la-sys-err.Plo \ ./$(DEPDIR)/libmio_la-sys-log.Plo \ @@ -216,12 +228,17 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmio_la_SOURCES) -DIST_SOURCES = $(libmio_la_SOURCES) +DIST_SOURCES = $(am__libmio_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__include_HEADERS_DIST = mio-cfg.h mio-chr.h mio-cmn.h mio-dns.h \ + mio-ecs.h mio-fmt.h mio-htb.h mio-htrd.h mio-htre.h mio-http.h \ + mio-json.h mio-nwif.h mio-pac1.h mio-path.h mio-pipe.h \ + mio-pro.h mio-sck.h mio-skad.h mio-thr.h mio-upac.h mio-utl.h \ + mio.h mio-maria.h HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)mio-cfg.h.in @@ -411,74 +428,22 @@ LIBADD_LIB_COMMON = $(LIBM) #pkgincludedir = $(includedir) #pkglibdir = $(libdir) #pkgbindir = $(bindir) -include_HEADERS = \ - mio-cfg.h \ - mio-chr.h \ - mio-cmn.h \ - mio-dns.h \ - mio-ecs.h \ - mio-fmt.h \ - mio-htb.h \ - mio-htrd.h \ - mio-htre.h \ - mio-http.h \ - mio-json.h \ - mio-nwif.h \ - mio-pac1.h \ - mio-path.h \ - mio-pipe.h \ - mio-pro.h \ - mio-sck.h \ - mio-skad.h \ - mio-thr.h \ - mio-upac.h \ - mio-utl.h \ - mio.h - +include_HEADERS = mio-cfg.h mio-chr.h mio-cmn.h mio-dns.h mio-ecs.h \ + mio-fmt.h mio-htb.h mio-htrd.h mio-htre.h mio-http.h \ + mio-json.h mio-nwif.h mio-pac1.h mio-path.h mio-pipe.h \ + mio-pro.h mio-sck.h mio-skad.h mio-thr.h mio-upac.h mio-utl.h \ + mio.h $(am__append_1) lib_LTLIBRARIES = libmio.la -libmio_la_SOURCES = \ - chr.c \ - dns.c \ - dns-cli.c \ - ecs.c \ - ecs-imp.h \ - err.c \ - fmt.c \ - fmt-imp.h \ - htb.c \ - htrd.c \ - htre.c \ - http.c \ - http-cgi.c \ - http-svr.c \ - http-thr.c \ - http-txt.c \ - json.c \ - mio-prv.h \ - mio.c \ - nwif.c \ - path.c \ - pipe.c \ - pro.c \ - sck.c \ - skad.c \ - sys.c \ - sys-ass.c \ - sys-err.c \ - sys-log.c \ - sys-mux.c \ - sys-prv.h \ - sys-tim.c \ - thr.c \ - uch-case.h \ - uch-prop.h \ - tmr.c \ - utf8.c \ - utl.c - +libmio_la_SOURCES = chr.c dns.c dns-cli.c ecs.c ecs-imp.h err.c fmt.c \ + fmt-imp.h htb.c htrd.c htre.c http.c http-cgi.c http-svr.c \ + http-thr.c http-txt.c json.c mio-prv.h mio.c nwif.c path.c \ + pipe.c pro.c sck.c skad.c sys.c sys-ass.c sys-err.c sys-log.c \ + sys-mux.c sys-prv.h sys-tim.c thr.c uch-case.h uch-prop.h \ + tmr.c utf8.c utl.c $(am__append_2) libmio_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) -libmio_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) -libmio_la_LIBADD = $(LIBADD_LIB_COMMON) $(SSL_LIBS) $(SOCKET_LIBS) $(SENDFILE_LIBS) +libmio_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) $(am__append_3) +libmio_la_LIBADD = $(LIBADD_LIB_COMMON) $(SSL_LIBS) $(SOCKET_LIBS) \ + $(SENDFILE_LIBS) $(am__append_4) all: mio-cfg.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -588,6 +553,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmio_la-http-txt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmio_la-http.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmio_la-json.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmio_la-maria.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmio_la-mio.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmio_la-nwif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmio_la-path.Plo@am__quote@ # am--include-marker @@ -860,6 +826,13 @@ libmio_la-utl.lo: utl.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmio_la-utl.lo `test -f 'utl.c' || echo '$(srcdir)/'`utl.c +libmio_la-maria.lo: maria.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmio_la-maria.lo -MD -MP -MF $(DEPDIR)/libmio_la-maria.Tpo -c -o libmio_la-maria.lo `test -f 'maria.c' || echo '$(srcdir)/'`maria.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmio_la-maria.Tpo $(DEPDIR)/libmio_la-maria.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='maria.c' object='libmio_la-maria.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmio_la-maria.lo `test -f 'maria.c' || echo '$(srcdir)/'`maria.c + mostlyclean-libtool: -rm -f *.lo @@ -1030,6 +1003,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/libmio_la-http-txt.Plo -rm -f ./$(DEPDIR)/libmio_la-http.Plo -rm -f ./$(DEPDIR)/libmio_la-json.Plo + -rm -f ./$(DEPDIR)/libmio_la-maria.Plo -rm -f ./$(DEPDIR)/libmio_la-mio.Plo -rm -f ./$(DEPDIR)/libmio_la-nwif.Plo -rm -f ./$(DEPDIR)/libmio_la-path.Plo @@ -1108,6 +1082,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libmio_la-http-txt.Plo -rm -f ./$(DEPDIR)/libmio_la-http.Plo -rm -f ./$(DEPDIR)/libmio_la-json.Plo + -rm -f ./$(DEPDIR)/libmio_la-maria.Plo -rm -f ./$(DEPDIR)/libmio_la-mio.Plo -rm -f ./$(DEPDIR)/libmio_la-nwif.Plo -rm -f ./$(DEPDIR)/libmio_la-path.Plo diff --git a/mio/lib/err.c b/mio/lib/err.c index 35e00bd..e588b35 100644 --- a/mio/lib/err.c +++ b/mio/lib/err.c @@ -33,33 +33,32 @@ static mio_ooch_t errstr_2[] = {'n', 'o', 't', ' ', 'i', 'm', 'p', 'l', 'e', 'm' static mio_ooch_t errstr_3[] = {'s', 'y', 's', 't', 'e', 'm', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; static mio_ooch_t errstr_4[] = {'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; static mio_ooch_t errstr_5[] = {'i', 'n', 's', 'u', 'f', 'f', 'i', 'c', 'i', 'e', 'n', 't', ' ', 's', 'y', 's', 't', 'e', 'm', ' ', 'm', 'e', 'm', 'o', 'r', 'y', '\0' }; -static mio_ooch_t errstr_6[] = {'i', 'n', 's', 'u', 'f', 'f', 'i', 'c', 'i', 'e', 'n', 't', ' ', 'o', 'b', 'j', 'e', 'c', 't', ' ', 'm', 'e', 'm', 'o', 'r', 'y', '\0' }; -static mio_ooch_t errstr_7[] = {'i', 'n', 'v', 'a', 'l', 'i', 'd', ' ', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', ' ', 'o', 'r', ' ', 'd', 'a', 't', 'a', '\0' }; -static mio_ooch_t errstr_8[] = {'d', 'a', 't', 'a', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', '\0' }; -static mio_ooch_t errstr_9[] = {'e', 'x', 'i', 's', 't', 'i', 'n', 'g', '/', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', ' ', 'd', 'a', 't', 'a', '\0' }; -static mio_ooch_t errstr_10[] = {'s', 'y', 's', 't', 'e', 'm', ' ', 'b', 'u', 's', 'y', '\0' }; -static mio_ooch_t errstr_11[] = {'a', 'c', 'c', 'e', 's', 's', ' ', 'd', 'e', 'n', 'i', 'e', 'd', '\0' }; -static mio_ooch_t errstr_12[] = {'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', ' ', 'n', 'o', 't', ' ', 'p', 'e', 'r', 'm', 'i', 't', 't', 'e', 'd', '\0' }; -static mio_ooch_t errstr_13[] = {'n', 'o', 't', ' ', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\0' }; -static mio_ooch_t errstr_14[] = {'i', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', 'e', 'd', '\0' }; -static mio_ooch_t errstr_15[] = {'p', 'i', 'p', 'e', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; -static mio_ooch_t errstr_16[] = {'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', ' ', 't', 'e', 'm', 'p', 'o', 'r', 'a', 'r', 'i', 'l', 'y', ' ', 'u', 'n', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', '\0' }; -static mio_ooch_t errstr_17[] = {'b', 'a', 'd', ' ', 's', 'y', 's', 't', 'e', 'm', ' ', 'h', 'a', 'n', 'd', 'l', 'e', '\0' }; -static mio_ooch_t errstr_18[] = {'b', 'a', 'd', ' ', 'r', 'e', 'q', 'u', 'e', 's', 't', ' ', 'o', 'r', ' ', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\0' }; +static mio_ooch_t errstr_6[] = {'i', 'n', 'v', 'a', 'l', 'i', 'd', ' ', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', ' ', 'o', 'r', ' ', 'd', 'a', 't', 'a', '\0' }; +static mio_ooch_t errstr_7[] = {'d', 'a', 't', 'a', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', '\0' }; +static mio_ooch_t errstr_8[] = {'e', 'x', 'i', 's', 't', 'i', 'n', 'g', '/', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', ' ', 'd', 'a', 't', 'a', '\0' }; +static mio_ooch_t errstr_9[] = {'s', 'y', 's', 't', 'e', 'm', ' ', 'b', 'u', 's', 'y', '\0' }; +static mio_ooch_t errstr_10[] = {'a', 'c', 'c', 'e', 's', 's', ' ', 'd', 'e', 'n', 'i', 'e', 'd', '\0' }; +static mio_ooch_t errstr_11[] = {'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', ' ', 'n', 'o', 't', ' ', 'p', 'e', 'r', 'm', 'i', 't', 't', 'e', 'd', '\0' }; +static mio_ooch_t errstr_12[] = {'n', 'o', 't', ' ', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\0' }; +static mio_ooch_t errstr_13[] = {'i', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', 'e', 'd', '\0' }; +static mio_ooch_t errstr_14[] = {'p', 'i', 'p', 'e', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; +static mio_ooch_t errstr_15[] = {'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', ' ', 't', 'e', 'm', 'p', 'o', 'r', 'a', 'r', 'i', 'l', 'y', ' ', 'u', 'n', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', '\0' }; +static mio_ooch_t errstr_16[] = {'b', 'a', 'd', ' ', 's', 'y', 's', 't', 'e', 'm', ' ', 'h', 'a', 'n', 'd', 'l', 'e', '\0' }; +static mio_ooch_t errstr_17[] = {'b', 'a', 'd', ' ', 'r', 'e', 'q', 'u', 'e', 's', 't', ' ', 'o', 'r', ' ', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\0' }; +static mio_ooch_t errstr_18[] = {'t', 'o', 'o', ' ', 'm', 'a', 'n', 'y', ' ', 'o', 'p', 'e', 'n', ' ', 'f', 'i', 'l', 'e', 's', '\0' }; static mio_ooch_t errstr_19[] = {'t', 'o', 'o', ' ', 'm', 'a', 'n', 'y', ' ', 'o', 'p', 'e', 'n', ' ', 'f', 'i', 'l', 'e', 's', '\0' }; -static mio_ooch_t errstr_20[] = {'t', 'o', 'o', ' ', 'm', 'a', 'n', 'y', ' ', 'o', 'p', 'e', 'n', ' ', 'f', 'i', 'l', 'e', 's', '\0' }; -static mio_ooch_t errstr_21[] = {'I', '/', 'O', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; -static mio_ooch_t errstr_22[] = {'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 's', 'i', 'o', 'n', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; -static mio_ooch_t errstr_23[] = {'i', 'n', 's', 'u', 'f', 'f', 'i', 'c', 'i', 'e', 'n', 't', ' ', 'd', 'a', 't', 'a', ' ', 'f', 'o', 'r', ' ', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\0' }; -static mio_ooch_t errstr_24[] = {'b', 'u', 'f', 'f', 'e', 'r', ' ', 'f', 'u', 'l', 'l', '\0' }; -static mio_ooch_t errstr_25[] = {'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', ' ', 'r', 'e', 'f', 'u', 's', 'e', 'd', '\0' }; -static mio_ooch_t errstr_26[] = {'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', ' ', 'r', 'e', 's', 'e', 't', '\0' }; -static mio_ooch_t errstr_27[] = {'n', 'o', ' ', 'c', 'a', 'p', 'a', 'b', 'i', 'l', 'i', 't', 'y', '\0' }; -static mio_ooch_t errstr_28[] = {'t', 'i', 'm', 'e', 'd', ' ', 'o', 'u', 't', '\0' }; -static mio_ooch_t errstr_29[] = {'n', 'o', ' ', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\0' }; -static mio_ooch_t errstr_30[] = {'u', 'n', 'a', 'b', 'l', 'e', ' ', 't', 'o', ' ', 'm', 'a', 'k', 'e', ' ', 'd', 'e', 'v', 'i', 'c', 'e', '\0' }; -static mio_ooch_t errstr_31[] = {'d', 'e', 'v', 'i', 'c', 'e', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; -static mio_ooch_t errstr_32[] = {'d', 'e', 'v', 'i', 'c', 'e', ' ', 'h', 'a', 'n', 'g', '-', 'u', 'p', '\0' }; +static mio_ooch_t errstr_20[] = {'I', '/', 'O', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; +static mio_ooch_t errstr_21[] = {'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 's', 'i', 'o', 'n', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; +static mio_ooch_t errstr_22[] = {'i', 'n', 's', 'u', 'f', 'f', 'i', 'c', 'i', 'e', 'n', 't', ' ', 'd', 'a', 't', 'a', ' ', 'f', 'o', 'r', ' ', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\0' }; +static mio_ooch_t errstr_23[] = {'b', 'u', 'f', 'f', 'e', 'r', ' ', 'f', 'u', 'l', 'l', '\0' }; +static mio_ooch_t errstr_24[] = {'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', ' ', 'r', 'e', 'f', 'u', 's', 'e', 'd', '\0' }; +static mio_ooch_t errstr_25[] = {'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', ' ', 'r', 'e', 's', 'e', 't', '\0' }; +static mio_ooch_t errstr_26[] = {'n', 'o', ' ', 'c', 'a', 'p', 'a', 'b', 'i', 'l', 'i', 't', 'y', '\0' }; +static mio_ooch_t errstr_27[] = {'t', 'i', 'm', 'e', 'd', ' ', 'o', 'u', 't', '\0' }; +static mio_ooch_t errstr_28[] = {'n', 'o', ' ', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\0' }; +static mio_ooch_t errstr_29[] = {'u', 'n', 'a', 'b', 'l', 'e', ' ', 't', 'o', ' ', 'm', 'a', 'k', 'e', ' ', 'd', 'e', 'v', 'i', 'c', 'e', '\0' }; +static mio_ooch_t errstr_30[] = {'d', 'e', 'v', 'i', 'c', 'e', ' ', 'e', 'r', 'r', 'o', 'r', '\0' }; +static mio_ooch_t errstr_31[] = {'d', 'e', 'v', 'i', 'c', 'e', ' ', 'h', 'a', 'n', 'g', '-', 'u', 'p', '\0' }; static mio_ooch_t* errstr[] = { errstr_0, errstr_1, errstr_2, errstr_3, errstr_4, @@ -68,7 +67,7 @@ static mio_ooch_t* errstr[] = errstr_15, errstr_16, errstr_17, errstr_18, errstr_19, errstr_20, errstr_21, errstr_22, errstr_23, errstr_24, errstr_25, errstr_26, errstr_27, errstr_28, errstr_29, - errstr_30, errstr_31, errstr_32 + errstr_30, errstr_31 }; diff --git a/mio/lib/mio-cfg.h.in b/mio/lib/mio-cfg.h.in index a845e13..43d214b 100644 --- a/mio/lib/mio-cfg.h.in +++ b/mio/lib/mio-cfg.h.in @@ -765,6 +765,9 @@ /* use libunwind for backtracing stack frames */ #undef MIO_ENABLE_LIBUNWIND +/* build the mariadb device */ +#undef MIO_ENABLE_MARIADB + /* Use the unicode character type as the default character type */ #undef MIO_ENABLE_UNICODE diff --git a/mio/lib/mio-sck.h b/mio/lib/mio-sck.h index edc7450..b825012 100644 --- a/mio/lib/mio-sck.h +++ b/mio/lib/mio-sck.h @@ -221,8 +221,6 @@ typedef enum mio_dev_sck_ioctl_cmd_t mio_dev_sck_ioctl_cmd_t; } while(0) #define MIO_DEV_SCK_GET_PROGRESS(dev) ((dev)->state & MIO_DEV_SCK_ALL_PROGRESS_BITS) -#define MIO_DEV_SCK_GET_TOLERANT(dev) ((dev)->state & MIO_DEV_SCK_ - enum mio_dev_sck_state_t { @@ -240,11 +238,11 @@ enum mio_dev_sck_state_t /* convenience bit masks */ MIO_DEV_SCK_ALL_PROGRESS_BITS = (MIO_DEV_SCK_CONNECTING | - MIO_DEV_SCK_CONNECTING_SSL | - MIO_DEV_SCK_CONNECTED | - MIO_DEV_SCK_LISTENING | - MIO_DEV_SCK_ACCEPTING_SSL | - MIO_DEV_SCK_ACCEPTED) + MIO_DEV_SCK_CONNECTING_SSL | + MIO_DEV_SCK_CONNECTED | + MIO_DEV_SCK_LISTENING | + MIO_DEV_SCK_ACCEPTING_SSL | + MIO_DEV_SCK_ACCEPTED) }; typedef enum mio_dev_sck_state_t mio_dev_sck_state_t; diff --git a/mio/lib/mio.c b/mio/lib/mio.c index 9949b20..a9f17f2 100644 --- a/mio/lib/mio.c +++ b/mio/lib/mio.c @@ -1042,7 +1042,15 @@ int mio_dev_watch (mio_dev_t* dev, mio_dev_watch_cmd_t cmd, int events) * it's different from not hanving MIO_DEV_CAP_IN and MIO_DEV_CAP_OUT. * a non-virtual device without the capabilities still gets attention * of the system multiplexer for hangup and error. */ - if (dev->dev_cap & MIO_DEV_CAP_VIRTUAL) return 0; + if (dev->dev_cap & MIO_DEV_CAP_VIRTUAL) + { + /* UGLY HACK - you may start a device with VIRTUAL set upon creation when START is attempted. + * later, if you mask off VIRTUAL, you may perform normal IO and call + * mio_dev_watch() with UPDATE. if SUSPENDED is set, UPDATE works */ + if (cmd == MIO_DEV_WATCH_START) dev->dev_cap |= MIO_DEV_CAP_WATCH_SUSPENDED; + /* END UGLY HACK */ + return 0; + } /*ev.data.ptr = dev;*/ dev_cap = dev->dev_cap & ~(DEV_CAP_ALL_WATCHED | MIO_DEV_CAP_WATCH_SUSPENDED); /* UGLY to use MIO_DEV_CAP_WATCH_SUSPENDED here */ @@ -1064,7 +1072,7 @@ int mio_dev_watch (mio_dev_t* dev, mio_dev_watch_cmd_t cmd, int events) * output watching is requested only if there're enqueued data for writing. * if you want to enable input watching while renewing, call this function like this. * mio_dev_wtach (dev, MIO_DEV_WATCH_RENEW, MIO_DEV_EVENT_IN); - * if you want input whatching disabled while renewing, call this function like this. + * if you want input watching disabled while renewing, call this function like this. * mio_dev_wtach (dev, MIO_DEV_WATCH_RENEW, 0); */ if (MIO_WQ_IS_EMPTY(&dev->wq)) events &= ~MIO_DEV_EVENT_OUT; else events |= MIO_DEV_EVENT_OUT; @@ -1091,7 +1099,6 @@ int mio_dev_watch (mio_dev_t* dev, mio_dev_watch_cmd_t cmd, int events) /* this function honors MIO_DEV_EVENT_IN and MIO_DEV_EVENT_OUT only * as valid input event bits. it intends to provide simple abstraction * by reducing the variety of event bits that the caller has to handle. */ - if ((events & MIO_DEV_EVENT_IN) && !(dev->dev_cap & (MIO_DEV_CAP_IN_CLOSED | MIO_DEV_CAP_IN_DISABLED))) { if (dev->dev_cap & MIO_DEV_CAP_IN) diff --git a/mio/lib/mio.h b/mio/lib/mio.h index 0a32d71..244f36b 100644 --- a/mio/lib/mio.h +++ b/mio/lib/mio.h @@ -79,7 +79,6 @@ enum mio_errnum_t MIO_ESYSERR, /**< system error */ MIO_EINTERN, /**< internal error */ MIO_ESYSMEM, /**< insufficient system memory */ - MIO_EOOMEM, /**< insufficient object memory */ MIO_EINVAL, /**< invalid parameter or data */ MIO_ENOENT, /**< data not found */ diff --git a/mio/lib/pipe.c b/mio/lib/pipe.c index 50474b3..ffc568e 100644 --- a/mio/lib/pipe.c +++ b/mio/lib/pipe.c @@ -4,21 +4,21 @@ Copyright (c) 2016-2020 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without - modification, are permitted pipevided that the following conditions + modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must repipeduce the above copyright + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the - documentation and/or other materials pipevided with the distribution. + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS pipeVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAfRRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, pipeCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR pipeFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/mio/lib/sck.c b/mio/lib/sck.c index 60268d6..1d00145 100644 --- a/mio/lib/sck.c +++ b/mio/lib/sck.c @@ -1073,6 +1073,7 @@ fcntl (rdev->hnd, F_SETFL, flags | O_NONBLOCK); #if defined(USE_SSL) rdev->ssl_ctx = ssl_ctx; #endif + /* set progress CONNECTING so that the ready handler invokes on_connect() */ MIO_DEV_SCK_SET_PROGRESS (rdev, MIO_DEV_SCK_CONNECTING); return 0; }