1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

deprecate x google mux

Unfortunately this code is beginning to rot due to lack of demand to
provide it and it being disabled by default.

If demand appears we can revert this and resume work on it, otherwise
let's bite the bullet for the moment.

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-01-17 19:53:16 +08:00
parent 706961dbb5
commit 4a673a38ca
6 changed files with 2 additions and 1378 deletions

View file

@ -66,9 +66,6 @@ There are several other possible configure options
may choke in other build contexts, this
lets you cleanly stop it being built
--enable-x-google-mux Enable experimental x-google-mux support
in the build (see notes later in document)
--enable-builtin-getifaddrs if your libc lacks getifaddrs, you can build an
implementation into the library. By default your libc
one is used.
@ -446,31 +443,5 @@ appear in the callback for protocol 0 and allow interface code to
manage socket descriptors in other poll loops.
x-google-mux support
--------------------
Experimental and super-preliminary x-google-mux support is available if
enabled in ./configure with --enable-x-google-mux. Note that when changing
configurations, you will need to do a make distclean before, then the new
configure and then make ; make install. Don't forget the necessary other
flags for your platform as described at the top of the readme.
It has the following notes:
1) To enable it, reconfigure with --enable-x-google-mux
2) It deviates from the google standard by sending full
headers in the addchannel subcommand rather than just
changed ones from original connect
3) Quota is not implemented yet
However despite those caveats, in fact it can run the
test client reliably over one socket (both dumb-increment
and lws-mirror-protocol), you can open a browser on the
same test server too and see the circles, etc.
It also works compatibly with deflate-stream automatically.
2012-04-12 Andy Green <andy@warmcat.com>
2013-01-14 Andy Green <andy@warmcat.com>

View file

@ -59,19 +59,6 @@ LDFLAGS="$LDFLAGS -lcrypto"
fi
AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
#
#
#
AC_ARG_ENABLE(x-google-mux,
[ --enable-x-google-mux Build experimental x-google-mux],
[ x_google_mux=yes
])
if test "x$x_google_mux" = "xyes" ; then
CFLAGS="$CFLAGS -DLWS_EXT_GOOGLE_MUX"
fi
AM_CONDITIONAL(EXT_GOOGLE_MUX, test x$x_google_mux = xyes)
#
#
#
@ -105,6 +92,7 @@ AC_ARG_WITH(daemonize,
AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
#
#
#
AC_ARG_ENABLE(mingw,

View file

@ -27,10 +27,6 @@ if USE_BUILTIN_GETIFADDRS
dist_libwebsockets_la_SOURCES += getifaddrs.c
endif
if EXT_GOOGLE_MUX
dist_libwebsockets_la_SOURCES += extension-x-google-mux.c extension-x-google-mux.h
endif
if LIBCRYPTO
else
dist_libwebsockets_la_SOURCES += md5.c sha-1.c

File diff suppressed because it is too large Load diff

View file

@ -1,96 +0,0 @@
#if 0
#ifdef WIN32
static __inline
#else
static inline
#endif
void muxdebug(const char *format, ...)
{
va_list ap;
va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap);
}
#else
#ifdef WIN32
static __inline
#else
static inline
#endif
void muxdebug(const char *format, ...)
{
}
#endif
#define MAX_XGM_SUBCHANNELS 8192
enum lws_ext_x_google_mux__parser_states {
LWS_EXT_XGM_STATE__MUX_BLOCK_1,
LWS_EXT_XGM_STATE__MUX_BLOCK_2,
LWS_EXT_XGM_STATE__MUX_BLOCK_3,
LWS_EXT_XGM_STATE__ADDCHANNEL_LEN,
LWS_EXT_XGM_STATE__ADDCHANNEL_LEN16_1,
LWS_EXT_XGM_STATE__ADDCHANNEL_LEN16_2,
LWS_EXT_XGM_STATE__ADDCHANNEL_LEN32_1,
LWS_EXT_XGM_STATE__ADDCHANNEL_LEN32_2,
LWS_EXT_XGM_STATE__ADDCHANNEL_LEN32_3,
LWS_EXT_XGM_STATE__ADDCHANNEL_LEN32_4,
LWS_EXT_XGM_STATE__ADDCHANNEL_HEADERS,
LWS_EXT_XGM_STATE__FLOWCONTROL_1,
LWS_EXT_XGM_STATE__FLOWCONTROL_2,
LWS_EXT_XGM_STATE__FLOWCONTROL_3,
LWS_EXT_XGM_STATE__FLOWCONTROL_4,
LWS_EXT_XGM_STATE__DATA,
};
enum lws_ext_x_goole_mux__mux_opcodes {
LWS_EXT_XGM_OPC__DATA,
LWS_EXT_XGM_OPC__ADDCHANNEL,
LWS_EXT_XGM_OPC__DROPCHANNEL,
LWS_EXT_XGM_OPC__FLOWCONTROL,
LWS_EXT_XGM_OPC__RESERVED_4,
LWS_EXT_XGM_OPC__RESERVED_5,
LWS_EXT_XGM_OPC__RESERVED_6,
LWS_EXT_XGM_OPC__RESERVED_7,
};
/* one of these per context (server or client) */
struct lws_ext_x_google_mux_context {
/*
* these are listing physical connections, not children sharing a
* parent mux physical connection
*/
struct libwebsocket *wsi_muxconns[MAX_CLIENTS];
/*
* when this is < 2, we do not do any mux blocks
* just pure websockets
*/
int active_conns;
};
/* one of these per connection (server or client) */
struct lws_ext_x_google_mux_conn {
enum lws_ext_x_goole_mux__mux_opcodes block_subopcode;
int block_subchannel;
unsigned int length;
enum lws_ext_x_google_mux__parser_states state;
/* child points to the mux wsi using this */
struct libwebsocket *wsi_parent;
int subchannel;
struct libwebsocket *wsi_children[MAX_CLIENTS];
int highest_child_subchannel;
char awaiting_POLLOUT;
int count_children_needing_POLLOUT;
int sticky_mux_used;
int defeat_mux_opcode_wrapping;
int original_ch1_closed;
int ignore_cmd;
};
extern int
lws_extension_callback_x_google_mux(struct libwebsocket_context *context,
struct libwebsocket_extension *ext,
struct libwebsocket *wsi,
enum libwebsocket_extension_callback_reasons reason,
void *user, void *in, size_t len);

View file

@ -2,16 +2,8 @@
#include "extension-deflate-frame.h"
#include "extension-deflate-stream.h"
#include "extension-x-google-mux.h"
struct libwebsocket_extension libwebsocket_internal_extensions[] = {
#ifdef LWS_EXT_GOOGLE_MUX
{
"x-google-mux",
lws_extension_callback_x_google_mux,
sizeof (struct lws_ext_x_google_mux_conn)
},
#endif
#ifdef LWS_EXT_DEFLATE_STREAM
{
"deflate-stream",