mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
introduce internal extensions array
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
2366b1c997
commit
4cd87a0bd9
8 changed files with 33 additions and 10 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
7
lib/extension.c
Normal file
7
lib/extension.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include "private-libwebsockets.h"
|
||||
|
||||
struct libwebsocket_extension libwebsocket_internal_extensions[] = {
|
||||
{ /* terminator */
|
||||
NULL, NULL, 0
|
||||
}
|
||||
};
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue