diff --git a/lib/Makefile.am b/lib/Makefile.am index 3100645c..3c17de6c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -6,13 +6,15 @@ dist_libwebsockets_la_SOURCES=libwebsockets.c \ libwebsockets.h \ base64-decode.c \ client-handshake.c \ + extension.c \ private-libwebsockets.h if LIBCRYPTO else dist_libwebsockets_la_SOURCES += md5.c sha-1.c endif -libwebsockets_la_CFLAGS:=-rdynamic -fPIC -Wall -Werror -std=gnu99 -pedantic -c -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\" +libwebsockets_la_CFLAGS:=-rdynamic -fPIC -Wall -Werror -std=gnu99 -pedantic -c \ + -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\" libwebsockets_la_LDFLAGS=-version-info 0:3 all-local: diff --git a/lib/Makefile.in b/lib/Makefile.in index 33be33f7..be10d3d0 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -73,13 +73,14 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libwebsockets_la_LIBADD = am__dist_libwebsockets_la_SOURCES_DIST = libwebsockets.c handshake.c \ parsers.c libwebsockets.h base64-decode.c client-handshake.c \ - private-libwebsockets.h md5.c sha-1.c + extension.c private-libwebsockets.h md5.c sha-1.c @LIBCRYPTO_FALSE@am__objects_1 = libwebsockets_la-md5.lo \ @LIBCRYPTO_FALSE@ libwebsockets_la-sha-1.lo dist_libwebsockets_la_OBJECTS = libwebsockets_la-libwebsockets.lo \ libwebsockets_la-handshake.lo libwebsockets_la-parsers.lo \ libwebsockets_la-base64-decode.lo \ - libwebsockets_la-client-handshake.lo $(am__objects_1) + libwebsockets_la-client-handshake.lo \ + libwebsockets_la-extension.lo $(am__objects_1) libwebsockets_la_OBJECTS = $(dist_libwebsockets_la_OBJECTS) libwebsockets_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libwebsockets_la_CFLAGS) \ @@ -220,9 +221,11 @@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libwebsockets.la include_HEADERS = libwebsockets.h dist_libwebsockets_la_SOURCES = libwebsockets.c handshake.c parsers.c \ - libwebsockets.h base64-decode.c client-handshake.c \ + libwebsockets.h base64-decode.c client-handshake.c extension.c \ private-libwebsockets.h $(am__append_1) -libwebsockets_la_CFLAGS := -rdynamic -fPIC -Wall -Werror -std=gnu99 -pedantic -c -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\" +libwebsockets_la_CFLAGS := -rdynamic -fPIC -Wall -Werror -std=gnu99 -pedantic -c \ + -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\" + libwebsockets_la_LDFLAGS = -version-info 0:3 all: all-am @@ -300,6 +303,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebsockets_la-base64-decode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebsockets_la-client-handshake.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebsockets_la-extension.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebsockets_la-handshake.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebsockets_la-libwebsockets.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebsockets_la-md5.Plo@am__quote@ @@ -362,6 +366,13 @@ libwebsockets_la-client-handshake.lo: client-handshake.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebsockets_la_CFLAGS) $(CFLAGS) -c -o libwebsockets_la-client-handshake.lo `test -f 'client-handshake.c' || echo '$(srcdir)/'`client-handshake.c +libwebsockets_la-extension.lo: extension.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebsockets_la_CFLAGS) $(CFLAGS) -MT libwebsockets_la-extension.lo -MD -MP -MF $(DEPDIR)/libwebsockets_la-extension.Tpo -c -o libwebsockets_la-extension.lo `test -f 'extension.c' || echo '$(srcdir)/'`extension.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libwebsockets_la-extension.Tpo $(DEPDIR)/libwebsockets_la-extension.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extension.c' object='libwebsockets_la-extension.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebsockets_la_CFLAGS) $(CFLAGS) -c -o libwebsockets_la-extension.lo `test -f 'extension.c' || echo '$(srcdir)/'`extension.c + libwebsockets_la-md5.lo: md5.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebsockets_la_CFLAGS) $(CFLAGS) -MT libwebsockets_la-md5.lo -MD -MP -MF $(DEPDIR)/libwebsockets_la-md5.Tpo -c -o libwebsockets_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libwebsockets_la-md5.Tpo $(DEPDIR)/libwebsockets_la-md5.Plo diff --git a/lib/extension.c b/lib/extension.c new file mode 100644 index 00000000..16d62d98 --- /dev/null +++ b/lib/extension.c @@ -0,0 +1,7 @@ +#include "private-libwebsockets.h" + +struct libwebsocket_extension libwebsocket_internal_extensions[] = { + { /* terminator */ + NULL, NULL, 0 + } +}; diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 21b99b1c..23adf3ae 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -631,6 +631,8 @@ extern void libwebsocket_close_and_free_session(struct libwebsocket_context *context, struct libwebsocket *wsi, enum lws_close_status); +extern struct libwebsocket_extension libwebsocket_internal_extensions[]; + #ifdef WIN32 #ifdef __cplusplus } diff --git a/test-server/test-client.c b/test-server/test-client.c index 0f67c122..90341d89 100644 --- a/test-server/test-client.c +++ b/test-server/test-client.c @@ -227,8 +227,8 @@ int main(int argc, char **argv) */ context = libwebsocket_create_context(CONTEXT_PORT_NO_LISTEN, NULL, - protocols, NULL, - NULL, NULL, -1, -1, 0); + protocols, libwebsocket_internal_extensions, + NULL, NULL, -1, -1, 0); if (context == NULL) { fprintf(stderr, "Creating libwebsocket context failed\n"); return 1; diff --git a/test-server/test-ping.c b/test-server/test-ping.c index 7bbaf24d..672f62cc 100644 --- a/test-server/test-ping.c +++ b/test-server/test-ping.c @@ -401,7 +401,8 @@ int main(int argc, char **argv) screen_width = w.ws_col; context = libwebsocket_create_context(CONTEXT_PORT_NO_LISTEN, NULL, - protocols, NULL, + protocols, + libwebsocket_internal_extensions, NULL, NULL, -1, -1, 0); if (context == NULL) { fprintf(stderr, "Creating libwebsocket context failed\n"); diff --git a/test-server/test-server-extpoll.c b/test-server/test-server-extpoll.c index 023ee96d..3616f554 100644 --- a/test-server/test-server-extpoll.c +++ b/test-server/test-server-extpoll.c @@ -474,7 +474,7 @@ int main(int argc, char **argv) cert_path = key_path = NULL; context = libwebsocket_create_context(port, interface, protocols, - NULL, + libwebsocket_internal_extensions, cert_path, key_path, -1, -1, opts); if (context == NULL) { fprintf(stderr, "libwebsocket init failed\n"); diff --git a/test-server/test-server.c b/test-server/test-server.c index 1035fe5e..5b2bf000 100644 --- a/test-server/test-server.c +++ b/test-server/test-server.c @@ -426,7 +426,7 @@ int main(int argc, char **argv) cert_path = key_path = NULL; context = libwebsocket_create_context(port, interface, protocols, - NULL, + libwebsocket_internal_extensions, cert_path, key_path, -1, -1, opts); if (context == NULL) { fprintf(stderr, "libwebsocket init failed\n");