Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the dropped break statement in the function jsiEvalCodeSub. #103

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions lws/lws-master/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
lws and included programs are provided under the terms of the
MIT license shown below, with the exception that some sources are under
a similar permissive license like BSD, or are explicitly CC0 / public
domain to remove any obstacles from basing differently-licensed code on
them.

Original liberal license retained:

- src/sha-1.c - 3-clause BSD license retained, link to original
- src/base64-decode.c - already MIT

Relicensed to MIT:

- src/daemonize.c - relicensed from Public Domain to MIT,
link to original Public Domain version
- lib/plat/windows/windows-resolv.c - relicensed from "Beerware v42" to MIT

Although lws is available under a permissive license, it does not
change the reality of dealing with large lumps of external code... if your
copy diverges it is guaranteed to contain security problems after a while
and can be very painful to pick backports (especially since historically,
we are very hot on cleaning and refactoring the codebase). The least
painful and lowest risk way remains sending your changes and fixes upstream
to us so you can easily use later releases and fixes.

MIT License applied to lws:

https://opensource.org/licenses/MIT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

102 changes: 102 additions & 0 deletions lws/lws-master/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Makefile to create lwsOne.c and liblws.a
# TODO: create miniz.c
LWS_VER=2.0202
LWS_SSL=0
LWS_MINIZ=0 # 1=external provide, 2=internally provided
LWS_CFLAGS=

TARGET=unix
LWSBASE=src
CFLAGS=-g -Wall -I$(SD) $(LWS_CFLAGS)

SD=$(LWSBASE)
LWSINT=$(LWSBASE)
LWS_LIBNAME=liblws.a

SOURCES = $(SD)/base64-decode.c $(SD)/handshake.c $(SD)/lws.c \
$(SD)/service.c $(SD)/pollfd.c $(SD)/output.c $(SD)/parsers.c \
$(SD)/context.c $(SD)/alloc.c $(SD)/header.c $(SD)/client.c \
$(SD)/client-handshake.c $(SD)/client-parser.c $(SD)/sha-1.c \
$(SD)/server.c $(SD)/server-handshake.c \
$(SD)/extension.c $(SD)/extension-permessage-deflate.c $(SD)/ranges.c



ifeq ($(LWS_MINIZ),1)
CFLAGS += -Iminiz
endif
ifeq ($(LWS_MINIZ),2)
CFLAGS += -DLWS_MINIZ=1
endif

SSLSOURCES += $(SD)/ssl.c $(SD)/ssl-client.c $(SD)/ssl-server.c
#$(SD)/ssl-http2.c $(SD)/http2.c

ifeq ($(LWS_SSL),1)
CFLAGS += -DLWS_OPENSSL_SUPPORT=1 -DLWS_WITH_SSL=1
#-DLWS_USE_HTTP2=1
CFLAGS += -I$(HOME)/usr/openssl/include
endif


WFILES = $(SD)/lws-plat-win.c
UFILES = $(SD)/lws-plat-unix.c

ifeq ($(WIN),1)
CFLAGS += -D__USE_MINGW_ANSI_STDIO -I$(SD)/../win32port/win32helpers
endif

all: lwsOne.c liblws

# Create the single amalgamation file lwsSingle.c
lwsSingle.c: $(SD)/lws.h $(SOURCES) $(SSLSOURCES) $(MAKEFILE)
cat $(SD)/lws.h > $@
echo "#ifndef LWS_IN_AMALGAMATION" >> $@
echo "#define LWS_IN_AMALGAMATION" >> $@
echo "#define _GNU_SOURCE" >> $@
echo "#define LWS_AMALGAMATION" >> $@
echo "#if LWS_MINIZ==1" >> $@
cat miniz/miniz.c >> $@
echo "#endif //LWS_MINIZ==1 " >> $@
cat $(SOURCES) | grep -v '^#line' >> $@
echo "#if LWS_WITH_SSL==1" >> $@
cat $(SSLSOURCES) | grep -v '^#line' >> $@
echo "#endif //LWS_WITH_SSL==1 " >> $@
echo "#ifndef WIN32" >> $@
cat $(WFILES) >> $@
echo "#else // WIN32" >> $@
cat $(UFILES) >> $@
echo "#endif //WIN32" >> $@
echo "#endif //LWS_IN_AMALGAMATION" >> $@

# Create the single compile file lwsOne.c
lwsOne.c: $(SD)/lws.h $(SOURCES) $(SSLSOURCES) $(MAKEFILE)
echo '#include "$(SD)/lws.h"' > $@
echo "#define LWS_AMALGAMATION" >> $@
echo "#if LWS_MINIZ==1" >> $@
echo '#include "'miniz/miniz.c'"' >> $@
echo "#endif //LWS_MINIZ==1" >> $@
for ii in $(SOURCES); do echo '#include "'$$ii'"' >> $@; done
echo "#if LWS_WITH_SSL==1" >> $@
for ii in $(SSLSOURCES); do echo '#include "'$$ii'"' >> $@; done
echo "#endif //LWS_WITH_SSL==1" >> $@
echo "#ifdef WIN32" >> $@
for ii in $(WFILES); do echo '#include "'$$ii'"' >> $@; done
echo "#else // WIN32" >> $@
for ii in $(UFILES); do echo '#include "'$$ii'"' >> $@; done
echo "#endif //WIN32" >> $@


liblws: $(LWS_LIBNAME)

$(LWS_LIBNAME): lwsOne.c
$(CC) -c -o $@ lwsOne.c $(CFLAGS)


clean:
rm -f liblws*.a

cleanall: clean
rm -f lwsOne.c lwsSingle.c

.PHONY: all depend remake clean cleanall
20 changes: 20 additions & 0 deletions lws/lws-master/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
lws is a small websocket library for embedded applications, and in particular, jsish.
This is fork/refactor of Andy Green's https://github.com/warmcat/libwebsockets/tree/v2.2-stable
If you need more a feature-full library, you should use libwebsockets instead.

Goals of this refactor are:

- support only glibc/mingw/musl and openssl
- simplified application integration via lwsOne.c
- remove unused features
- fix bugs and memory leaks

One line download/build:

wget http://jsish.org/fossil/lws/zip/lws?r=ver-2.0202 -O lws.zip && unzip -oq lws.zip && make -C lws

For the latest release simply omit the ? query.

Source is https://jsish.org/fossil/lws, but report bugs to mirror site: https://github.com/pcmacdon/lws

Peter MacDonald
Binary file added lws/lws-master/liblws_unix-2.0202.a
Binary file not shown.
34 changes: 34 additions & 0 deletions lws/lws-master/lwsOne.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "src/lws.h"
#define LWS_AMALGAMATION
#if LWS_MINIZ==1
#include "miniz/miniz.c"
#endif //LWS_MINIZ==1
#include "src/base64-decode.c"
#include "src/handshake.c"
#include "src/lws.c"
#include "src/service.c"
#include "src/pollfd.c"
#include "src/output.c"
#include "src/parsers.c"
#include "src/context.c"
#include "src/alloc.c"
#include "src/header.c"
#include "src/client.c"
#include "src/client-handshake.c"
#include "src/client-parser.c"
#include "src/sha-1.c"
#include "src/server.c"
#include "src/server-handshake.c"
#include "src/extension.c"
#include "src/extension-permessage-deflate.c"
#include "src/ranges.c"
#if LWS_WITH_SSL==1
#include "src/ssl.c"
#include "src/ssl-client.c"
#include "src/ssl-server.c"
#endif //LWS_WITH_SSL==1
#ifdef WIN32
#include "src/lws-plat-win.c"
#else // WIN32
#include "src/lws-plat-unix.c"
#endif //WIN32
Loading