websockets: serious code uglification to support versions prior to 0291eb3..d764e84.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Wed, 13 Feb 2013 16:12:37 +0000 (18:12 +0200)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Wed, 13 Feb 2013 16:44:16 +0000 (18:44 +0200)
commitab962f60dad99144b80f90c53f88c2d6b54b3e68
tree2b94caa17f8b10143d5625aa1e6cad8aa6c80928
parentf42a0ef74d4b267003836d549c015d391ab704a9
websockets: serious code uglification to support versions prior to 0291eb3..d764e84.

In some environments we might be forced to run with really old
versions of libwebsockets. This causes some amount of pain as
as some of those features are quite essential for building a
reasonable abstraction on top of libwebsockets.

Most notably, versions prior to 0291eb3..d764e84 (Oct 19 2012)
do not support per-context user data. Since we need to associate
our context with that of libwebsockets we have to build an extra
mechanism for mapping between the two when user data support is
not available. We use an extra hash table to store our context
and use directly the (low 32-bits of the) libwebsocket context
pointer as the key to store and fetch it.
src/common/websocklib.c
src/common/websocklib.h