From 3d2eeaa94dfcd514d7d53cb06ba75209729b33e0 Mon Sep 17 00:00:00 2001 From: henri Date: Sun, 21 Oct 2012 20:21:01 +0000 Subject: [PATCH] Finally added a function to list the available nsock engines. --- nsock/include/nsock.h | 3 +++ nsock/src/nsock_engines.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/nsock/include/nsock.h b/nsock/include/nsock.h index 01cf67632..ccb1431dd 100644 --- a/nsock/include/nsock.h +++ b/nsock/include/nsock.h @@ -204,6 +204,9 @@ nsock_ssl_ctx nsp_ssl_init_max_speed(nsock_pool ms_pool); * Pass NULL to reset to default (use most efficient engine available). */ void nsock_set_default_engine(char *engine); +/* Get a comma-separated list of available engines. */ +const char *nsock_list_engines(void); + /* And here is how you create an nsock_pool. This allocates, initializes, and * returns an nsock_pool event aggregator. In the case of error, NULL will be * returned. If you do not wish to immediately associate any userdata, pass in diff --git a/nsock/src/nsock_engines.c b/nsock/src/nsock_engines.c index f26fec9d2..1adead059 100644 --- a/nsock/src/nsock_engines.c +++ b/nsock/src/nsock_engines.c @@ -128,3 +128,11 @@ void nsock_set_default_engine(char *engine) { } } +const char *nsock_list_engines(void) { + return +#if HAVE_EPOLL + "epoll," +#endif + "select"; +} +