Andy Green [Mon, 18 Jan 2016 20:32:14 +0000 (04:32 +0800)]
timeout move to doubly linked list
In the case we have a lot of connections, checking them all for timeout state
once a second becomes burdensome. At the moment if you have 100K connections,
once a second they all get checked for timeout in a loop.
This patch adds a doubly-linked list based in the context to each wsi, and
only wsi with pending timeouts appear on it. At checking time, we traverse
the list, which costs nothing if empty because nobody has a pending timeout.
Similarly adding and removing from the list costs almost nothing since no
iteration is required no matter how big the list.
The extra 8 or 16 bytes in the wsi are offset a little bit by demoting .pps
from int to char (save 3 bytes). And trim max act exts to 2, since we only
provide one, saving 8 /16 bytes by itself if exts enabled.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andrew Cooks [Sun, 17 Jan 2016 06:23:55 +0000 (14:23 +0800)]
From
8dc784c121fb387f1871245b3194eae662bddfa3 Mon Sep 17 00:00:00 2001
Subject: [PATCH] bump version in rpm spec file.
Andrew Cooks [Sun, 17 Jan 2016 06:08:59 +0000 (14:08 +0800)]
From
1e933db07bed7a0b5ac8dc49146815348ae37ded Mon Sep 17 00:00:00 2001
Subject: [PATCH] rpm specfile fixes: group, license, build requires, files
Andrew Cooks [Sun, 17 Jan 2016 05:54:13 +0000 (13:54 +0800)]
From
7f39ea761e98ea96f79a7e69d4cdeee0c39d316e Mon Sep 17 00:00:00 2001
Subject: [PATCH] fix missing ${LIB_SUFFIX} on cmake config dir
Peter Pentchev [Sun, 17 Jan 2016 00:03:10 +0000 (02:03 +0200)]
Generate the API documentation in a reproducible way.
Sort the list of source files before passing them to the kernel-doc
script so that it always outputs the discovered functions and
structures in the same order.
Andy Green [Mon, 18 Jan 2016 03:49:41 +0000 (11:49 +0800)]
avoid using deallocated things during context dedtroy
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Jan 2016 01:24:35 +0000 (09:24 +0800)]
fuzxy
This is the initial push of a fuzzing proxy we will use for testing lws.
Run libwebsockets-test-fuzxy and the test server if it's local.
Then run the test client with
http_proxy=localhost:8880 libwebsockets-test-client localhost (or whatever)
Right now he only fuzzes one thing but he is operational as a proxy.
Andy Green [Mon, 18 Jan 2016 01:49:24 +0000 (09:49 +0800)]
cleaning
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 16 Jan 2016 04:09:38 +0000 (12:09 +0800)]
lws_interface_to_sa
Expose interface handling code as an api
Andy Green [Sat, 16 Jan 2016 03:14:46 +0000 (11:14 +0800)]
use lws_close not raw close
https://github.com/warmcat/libwebsockets/issues/400
Signed-off-by: Andy Green <andy.green@linaro.org>
David Andrade [Fri, 15 Jan 2016 14:45:30 +0000 (09:45 -0500)]
Subject: [PATCH] Make echo test app option consistent with the other test
options
Andy Green [Fri, 15 Jan 2016 14:16:54 +0000 (22:16 +0800)]
permessage deflate male callback VISIBLE
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Jan 2016 07:17:28 +0000 (15:17 +0800)]
fix client getting hung up on at negotiation
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Jan 2016 03:37:56 +0000 (11:37 +0800)]
redirect
This adds redirect support to the client side. Lws will follow
server redirects (301) up to three deep.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Jan 2016 05:39:02 +0000 (13:39 +0800)]
parse_uri
Signed-off-by: Andy Green <andy.green@linaro.org>
Vijay Khurdiya [Fri, 15 Jan 2016 08:21:51 +0000 (16:21 +0800)]
ssl add ECDH server support
(AG clean style add option flag and docs)
Andy Green [Thu, 14 Jan 2016 03:38:31 +0000 (11:38 +0800)]
only report CLIENT_CONNECTION_ERROR once on some paths
In most cases the close api will see it should send the CCE because
we are still in the waiting server reply state until the end of the
interpretation. Only if we completed the interpretation and moved
on to ESTABLISHED do we need to handle sending it ourselves.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 13 Jan 2016 10:48:50 +0000 (18:48 +0800)]
remove double free attempts from no ACCEPT server response cleanup path
The generic wsi close code is smart enough to clean up after these allocations itself
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 12 Jan 2016 21:01:17 +0000 (05:01 +0800)]
fuzzer eliminate hsecond ah free path firing assert sentinel
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 12 Jan 2016 15:05:02 +0000 (23:05 +0800)]
fuzzer rx overflow mitigate
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 12 Jan 2016 09:22:06 +0000 (17:22 +0800)]
lws_client_connect_via_info
https://github.com/warmcat/libwebsockets/issues/396
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 12 Jan 2016 00:46:56 +0000 (08:46 +0800)]
test client remove abs modulo
llvm and gcc 5.3 do different things with it
https://github.com/warmcat/libwebsockets/issues/395
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 11 Jan 2016 03:34:01 +0000 (11:34 +0800)]
extension permessage deflate
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Jan 2016 00:13:55 +0000 (08:13 +0800)]
clean libev.c style
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 8 Jan 2016 20:12:46 +0000 (04:12 +0800)]
libev set events to match revents
https://github.com/warmcat/libwebsockets/issues/393
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 8 Jan 2016 13:52:47 +0000 (21:52 +0800)]
partial always use partial buffering if send incomplete
After "rerelease"
https://github.com/warmcat/libwebsockets/issues/392#issuecomment-
170003294
Since we introduced partial buffering a long while ago,
user code shold never see partial sends and very few
user callbsck attempt to deal with them.
Let's just eliminate the whole concept of user callback
partial send handling under any circumstances.
Signed-off-by: Andy Green <andy.green@linaro.org>
Denis Osvald [Mon, 21 Dec 2015 15:39:59 +0000 (16:39 +0100)]
properly skip protocols with NULL name
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
Denis Osvald [Mon, 21 Dec 2015 17:06:38 +0000 (18:06 +0100)]
fix callback typedefs and declarations
Remove declarations of callback and extension_callback as these are
functions declared in header but not defined anywhere.
Also rename typedefs callback_function and extension_callback_function
to lws_callback_function and lws_extension_callback_function so all
symbolx exported by header have lws prefix;
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
Andy Green [Wed, 30 Dec 2015 06:53:50 +0000 (14:53 +0800)]
doc improve docs around header access apis
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 30 Dec 2015 04:12:58 +0000 (12:12 +0800)]
ext negotiation tolerate semicolon args
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 30 Dec 2015 03:43:36 +0000 (11:43 +0800)]
utf8 check compatible with extensions
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 29 Dec 2015 04:28:48 +0000 (12:28 +0800)]
optimize utf8 check tests into state bit
Considering we go through it once per incoming char, the tests to see if we
should be checking utf-8 are too expensive... move them to a bit that lives
in the wsi and set them once per frame (except for CLOSE who has to update
after the close code has been skipped).
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 29 Dec 2015 03:20:09 +0000 (11:20 +0800)]
introduce LWS_SERVER_OPTION_VALIDATE_UTF8
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 29 Dec 2015 01:46:03 +0000 (09:46 +0800)]
autobahn check utf8 on TEXT and CLOSE
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 10:29:06 +0000 (18:29 +0800)]
autobahn reject forbidden close code ranges
Complain like autobahn expects if we get a funny close code
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 09:11:31 +0000 (17:11 +0800)]
autobahn README.test apps.md
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 09:05:40 +0000 (17:05 +0800)]
autobahn reject noncontinuation based on pending FIN state
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 08:51:08 +0000 (16:51 +0800)]
autobahn detect disordered continuation
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 06:24:49 +0000 (14:24 +0800)]
autobahn add same serverside rxflow cache to client
Server side has had immediate RX flow control for quite a while.
But client side made do with RX continuing until what had been received was exhausted.
For what Autobahn tests, that's not enough.
This patch gives clientside RX flow control the same immediate effect as the server
side enjoys, re-using the same code.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 06:12:10 +0000 (14:12 +0800)]
autobahn reject on reserved opcode or bits
Because extensions may use them, we didn't reject on reserved opc or bits set,
just ignored. But the standard does say we should, so now we do.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 04:45:05 +0000 (12:45 +0800)]
autobahn test echo extend max echo and follow message boundary
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 05:40:54 +0000 (13:40 +0800)]
autobahn extend max ping pong close payload to 125
We only supported those specific control packet payloads up to 124.
125 is the correct limit.
Lws was consistent about the wrong limit so there are no other
issues. It doesn't affect user ABI correcting it either.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 04:45:52 +0000 (12:45 +0800)]
autobahn report final frag only on final rx bufload
If the final message fragment contains a payload that has to be
handled in multiple RX callbacks, until now we reported the ws
fragment header FIN state in lws_is_final_fragment().
That was correct, but it's kind of not useful to hear that the
intermediate bufferloads are "final". So now we delay
reporting the logical ws fragment FIN until the final part of
his payload is delivered.
This gets us Autobahn 1.1.6 working.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 03:14:04 +0000 (11:14 +0800)]
autobahn requires zero length tx allowed
Again we treat user code sending zero length things as a bug in user code.
But Autobahn insists to be able to do it, so now we allow it.
That buys us a pass on Autobahn test 1.1.1 (the first of a bazillion)
Reproduce with
libwebsockets-test-echo --client localhost --port 9001 -u "/runCase?case=1&agent=libwebsockets" -v -d 65535 -n 1
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 03:11:55 +0000 (11:11 +0800)]
autobahn requires zero length rx allowed
We suppress zero length rx from getting to userland, but autobahn
requires it... oh well.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 28 Dec 2015 03:11:06 +0000 (11:11 +0800)]
autobahn test echo meddling
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 27 Dec 2015 10:16:32 +0000 (18:16 +0800)]
clean windows warnings
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 27 Dec 2015 01:43:44 +0000 (09:43 +0800)]
test server libev
If we enabled libev support, generate a test server variant that uses it.
Libev has sets its face against fixing its warnings and says -Werror is
"stupid". So we work around it for the problems their apis cause in
Travis.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 12:26:11 +0000 (20:26 +0800)]
clarify changelog
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 09:36:29 +0000 (17:36 +0800)]
update api docs
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 09:20:34 +0000 (17:20 +0800)]
close add api to control sent close frame contents
This adds an api lws_close_reason() which lets you control what will
be sent in the close frame when the connection is closed by returning
nonzero from the user callback.
The test server demo is extended to prove it works in both directions.
With this, we should have nice close support.
https://github.com/warmcat/libwebsockets/issues/196
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 07:47:06 +0000 (15:47 +0800)]
close add callback to get peer close reason
https://github.com/warmcat/libwebsockets/issues/196
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 07:07:45 +0000 (15:07 +0800)]
mbed3 remove forcing _DEBUG
It saves us ~4KB of lwsl_info / _debug etc strings.
The test app comes in at 114KB then, including 19KB of html, png and ico assets.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 05:23:11 +0000 (13:23 +0800)]
mbed3 remove unused allocations
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 04:03:06 +0000 (12:03 +0800)]
deprecate LWS_SEND_BUFFER_POST_PADDING
The only guy who cared about this for a long while
(since I eliminated the pre-standard protocol variants)
was sending a close frame.
- Set it to 0 so old code remains happy. It only affects
user code buffer commit, if there's overcommit no harm
done so no effect directly on user ABI.
- Remove all uses inside the library. The sample apps
don't have it any more and that's the recommendation now.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 02:07:17 +0000 (10:07 +0800)]
output eliminate redundant post calculation
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 01:08:06 +0000 (09:08 +0800)]
remove MAX_MUX_RECURSION from PRE padding
The old google mux thing is long dead
This only affects app buffer sizing, if old apps overcommit, no worries.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 26 Dec 2015 00:56:58 +0000 (08:56 +0800)]
rearrange private struct packing 2
Further reduces lws size to 512 on x86_64 "for free"
Both this and the last patch only rearrange private struct members.
Also convert win32-specific member from BOOL to bitfield:1.
Signed-off-by: Andy Green <andy.green@linaro.org>
Peter Pentchev [Fri, 25 Dec 2015 11:35:40 +0000 (13:35 +0200)]
Recognize Debian GNU/kFreeBSD as FreeBSD-ish.
Some of the FreeBSD-specific code in libwebsockets is related to
the FreeBSD kernel, not the general build environment. Thus, it is
important to make this distinction, especially when building on
platforms that have a FreeBSD kernel and a non-FreeBSD userland build
environment, such as Debian GNU/kFreeBSD.
When checking for FreeBSD kernel features, also check for the newly
introduced __FreeBSD_kernel__ preprocessor constant; it is present in
the GNU/kFreeBSD kernel and also in FreeBSD itself since the 9.1 release
about three years ago.
Andy Green [Fri, 25 Dec 2015 05:48:20 +0000 (13:48 +0800)]
rearrange struct packing
Surprisingly it's enough to reduce wsi from 536 to 520 on x86_64
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 25 Dec 2015 04:44:12 +0000 (12:44 +0800)]
http header malloc pool implement pool
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 25 Dec 2015 01:12:08 +0000 (09:12 +0800)]
http header malloc pool allow listen accept flow control
Add a private api to enable and disable server listen socket POLLIN
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 25 Dec 2015 05:14:09 +0000 (13:14 +0800)]
ws ping buffer allocate in wsi ws union member
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 25 Dec 2015 01:17:15 +0000 (09:17 +0800)]
info struct add padding pool
The info struct is too fragile against additions being able to keep soname.
Because if we add something, the library can't count on the user code being
built against latest headers with largest info struct size. Then the user
code may not have zeroed down enough of the struct and give us junk in the
new members.
Add a pool at the end of the info struct that exists so it will be zeroed
down even though no current use for those future members, then later
library versions can compatibly use them without breaking soname if it is
understood 0 means default.
Because keeping sizeof info straight if you add something is now a thing,
also add an lwsl_info letting you confirm it easily.
It's fine if the size of info differs on different platforms. But when
we add things to the struct we need to balance the padding using a scheme
like
short new_member;
unsigned char _padding1[sizeof(void *) - sizeof(short)];
which is immune to differences in platform differences in sizeof void *.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 24 Dec 2015 05:00:54 +0000 (13:00 +0800)]
detect service tid once and use wsi with valid context to do it
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 23 Dec 2015 03:55:06 +0000 (11:55 +0800)]
libev complete unix plat context init
https://github.com/warmcat/libwebsockets/issues/381
Signed-off-by: Andy Green <andy.green@linaro.org>
gaby64 [Tue, 22 Dec 2015 04:41:12 +0000 (12:41 +0800)]
libev context destroy
https://github.com/warmcat/libwebsockets/issues/380
Andy Green [Tue, 22 Dec 2015 00:17:34 +0000 (08:17 +0800)]
test ping android compatibility
After "emptyVoid" at
https://github.com/warmcat/libwebsockets/issues/379
Signed-off-by: Andy Green <andy.green@linaro.org>
Roger A. Light [Sat, 19 Dec 2015 01:26:53 +0000 (01:26 +0000)]
Subject: [PATCH] Typo in macro name.
Andy Green [Fri, 18 Dec 2015 23:35:23 +0000 (07:35 +0800)]
uridecoding lws_hdr_fragment_length
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 23:18:55 +0000 (07:18 +0800)]
whitespace tidy
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 08:40:02 +0000 (16:40 +0800)]
uridecode no need to require length plus 2
length + 1 (for the '\0' is enough)
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 07:40:03 +0000 (15:40 +0800)]
uridecoding disallow uriencoded equals in name part
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 07:23:31 +0000 (15:23 +0800)]
uridecoding handle plus chars as space
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 07:20:09 +0000 (15:20 +0800)]
uridecoding support optional semicolon as delimiter
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 02:35:11 +0000 (10:35 +0800)]
version 1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 03:18:56 +0000 (11:18 +0800)]
api doc v1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 03:01:03 +0000 (11:01 +0800)]
changelog pre v1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 18 Dec 2015 02:46:24 +0000 (10:46 +0800)]
clean uri arg dump
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 17:08:14 +0000 (01:08 +0800)]
context protocol destroy provide nonnull wsi with context
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 16:56:31 +0000 (00:56 +0800)]
server check cb return during establish
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 16:50:14 +0000 (00:50 +0800)]
client check cb return during establish
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 10:25:25 +0000 (18:25 +0800)]
lws_get_context not _ctx
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 09:03:59 +0000 (17:03 +0800)]
clean internal refactor
- Mainly symbol length reduction
- Whitespace clean
- Code refactor for linear flow
- Audit @Context for API docs vs changes
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 07:35:41 +0000 (15:35 +0800)]
win cover clearing sock_send_blocking when external poll
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 07:15:12 +0000 (15:15 +0800)]
win solve various cranky problems with msvc
After emptyVoid at --->
https://github.com/warmcat/libwebsockets/issues/374
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 17 Dec 2015 00:09:13 +0000 (08:09 +0800)]
clean misc 1
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 16 Dec 2015 23:54:44 +0000 (07:54 +0800)]
public api remove context from user callback API BREAK
Since struct lws (wsi) now has his own context pointer,
we were able to remove the need for passing context
almost everywhere in the apis.
In turn, that means there's no real use for context being
passed to every callback; in the rare cases context is
needed user code can get it with lws_get_ctx(wsi)
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 16 Dec 2015 11:51:12 +0000 (19:51 +0800)]
windows fix wsapoll conflict on some toolchains
After EmptyVoid at github
https://github.com/warmcat/libwebsockets/issues/374
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 16 Dec 2015 10:19:08 +0000 (18:19 +0800)]
public api remove superfluous context params API BREAK
Extend the cleanout caused by wsi having a context pointer
into the public api.
There's no point keeping the 1.5 compatibility work,
we have changed the api in several places and
rebuilt wasn't going to be enough a while ago.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 16 Dec 2015 07:02:47 +0000 (15:02 +0800)]
add LWS_INLINE to deal with crappy msvc
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 15 Dec 2015 14:57:19 +0000 (22:57 +0800)]
http uri arguments process in fragments
This makes the URI argument processing split each parameter into
a "fragment". Processing header content as fragments already exists
in lws, because it's legal to deliver header content by repeating
the header.
Now there's an api to access individual fragments, also add the
code to the test server to print each URI argument separately.
Adapt attack.sh to parse the fragments.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 15 Dec 2015 15:05:23 +0000 (23:05 +0800)]
URIPS_ARGUMENTS is redundant
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 15 Dec 2015 15:03:29 +0000 (23:03 +0800)]
document how the header fragments work
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 15 Dec 2015 14:59:23 +0000 (22:59 +0800)]
introduce lws_hdr_copy_fragment
This adds a public API variant of the header copy api that lets you
choose which fragment you want copied.
Normally you want the existing one that aggregates the fragments.
But it can be useful to get each part in turn (that corresponds to
the content provided by each duplicated header normally).
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 15 Dec 2015 13:15:58 +0000 (21:15 +0800)]
refactor needless context with wsi paramater passing
Now we bit the bullet and gave each wsi an lws_context *, many
internal apis that take both a context and wsi parameter only
need the wsi.
Also simplify parser code by making a temp var for
allocated_headers * instead of the longwinded
dereference chain everywhere.
Signed-off-by: Andy Green <andy.green@linaro.org>
Roger A. Light [Mon, 14 Dec 2015 17:25:29 +0000 (17:25 +0000)]
Subject: [PATCH] Add LWS_LIBRARY_VERSION_NUMBER to lws_config.h.
This changeset adds a few preprocessor macros to lws_config.h to allow
a user of libwebsockets to determine at compile time which version of
lws they are compiling against.
This exposes the already existing LWS_LIBRARY_VERSION_MAJOR and _MINOR
values, and adds LWS_LIBRARY_VERSION_PATCH. This suggests that future
minor bugfix release versions of lws would be e.g. 1.6.0 -> 1.6.1 rather
than the style used previously: 1.2 -> 1.21.
The way this is currently set up means new minor revisions (with
_PATCH==0) always end with .0 but I could change this if preferred.
The most important addition is LWS_LIBRARY_VERSION_NUMBER, which
produces a number of the form 1005001 for version 1.5.1 - i.e. each part
major, minor, patch can extend from 0-999. This macro allows a very easy
compile time comparison of version numbers.
Andrejs Hanins [Tue, 15 Dec 2015 11:31:23 +0000 (13:31 +0200)]
Fix corruption of close reason code in close frame
According to specification, close reason code is part of body
Andy Green [Tue, 15 Dec 2015 11:46:28 +0000 (19:46 +0800)]
mbed3 use new upstream mbed3 nagle disable
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 14 Dec 2015 11:42:26 +0000 (19:42 +0800)]
uriencoding deal with0uriencoded question mark properly
Signed-off-by: Andy Green <andy.green@linaro.org>