Commit graph

2010 commits

Author SHA1 Message Date
Andy Green
91d624e38a autobahn reject noncontinuation based on pending FIN state
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-28 22:29:57 +08:00
Andy Green
977734ee07 autobahn detect disordered continuation
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-28 22:29:57 +08:00
Andy Green
44e0b088fa 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>
2015-12-28 21:47:46 +08:00
Andy Green
f05167dee6 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>
2015-12-28 20:53:43 +08:00
Andy Green
d5be3bf749 autobahn test echo extend max echo and follow message boundary
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-28 13:43:59 +08:00
Andy Green
7dbf21efc2 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>
2015-12-28 13:40:54 +08:00
Andy Green
41434fad53 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>
2015-12-28 12:45:52 +08:00
Andy Green
4c9d895768 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>
2015-12-28 11:14:04 +08:00
Andy Green
20db310908 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>
2015-12-28 11:12:05 +08:00
Andy Green
e7d8e20f56 autobahn test echo meddling
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-28 11:12:05 +08:00
Andy Green
07f194686f clean windows warnings
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-27 18:16:32 +08:00
Andy Green
40e607b876 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>
2015-12-27 09:43:44 +08:00
Andy Green
4e2ac7685d clarify changelog
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 20:26:11 +08:00
Andy Green
daa6b8ff25 update api docs
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 17:36:29 +08:00
Andy Green
1fb95e8084 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>
2015-12-26 17:20:34 +08:00
Andy Green
066a7a1801 close add callback to get peer close reason
https://github.com/warmcat/libwebsockets/issues/196

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 15:47:06 +08:00
Andy Green
a24b40860f 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>
2015-12-26 15:07:45 +08:00
Andy Green
5b85e39d99 mbed3 remove unused allocations
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 13:23:11 +08:00
Andy Green
3246ebb3f5 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>
2015-12-26 12:03:06 +08:00
Andy Green
de1a6a539f output eliminate redundant post calculation
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 10:07:17 +08:00
Andy Green
87bac69f55 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>
2015-12-26 09:08:06 +08:00
Andy Green
aa775fd9b0 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>
2015-12-26 08:56:58 +08:00
Peter Pentchev
da2eab3f66 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.
2015-12-25 21:15:21 +08:00
Andy Green
de132b94b1 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>
2015-12-25 14:49:54 +08:00
Andy Green
3df580066b http header malloc pool implement pool
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-25 14:34:20 +08:00
Andy Green
b3d21f164d 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>
2015-12-25 14:34:13 +08:00
Andy Green
ba38a7e6b4 ws ping buffer allocate in wsi ws union member
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-25 14:34:10 +08:00
Andy Green
a4244f08ad 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>
2015-12-25 09:23:25 +08:00
Andy Green
c35b36b1cf detect service tid once and use wsi with valid context to do it
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-24 13:00:54 +08:00
Andy Green
400e5a7fed libev complete unix plat context init
https://github.com/warmcat/libwebsockets/issues/381

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-23 11:55:06 +08:00
gaby64
d8383ca5fc libev context destroy
https://github.com/warmcat/libwebsockets/issues/380
2015-12-22 12:41:12 +08:00
Andy Green
8933eaf2f3 test ping android compatibility
After "emptyVoid" at

https://github.com/warmcat/libwebsockets/issues/379

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-22 08:17:34 +08:00
Roger A. Light
cc5dff9bb1 Subject: [PATCH] Typo in macro name. 2015-12-19 10:47:12 +08:00
Andy Green
e974f0c252 uridecoding lws_hdr_fragment_length
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-19 07:35:23 +08:00
Andy Green
ab5ed3c8e1 whitespace tidy
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-19 07:18:55 +08:00
Andy Green
9f54c1ff73 uridecode no need to require length plus 2
length + 1 (for the '\0' is enough)

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 16:40:02 +08:00
Andy Green
3ba035dc2c uridecoding disallow uriencoded equals in name part
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 15:40:03 +08:00
Andy Green
8b9fe99dee uridecoding handle plus chars as space
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 15:23:31 +08:00
Andy Green
03d7e9d331 uridecoding support optional semicolon as delimiter
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 15:20:09 +08:00
Andy Green
f1cf5bec53 version 1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 11:19:45 +08:00
Andy Green
1849e5e74a api doc v1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 11:18:56 +08:00
Andy Green
9e8d148912 changelog pre v1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 11:01:03 +08:00
Andy Green
4588e4e415 clean uri arg dump
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 10:46:24 +08:00
Andy Green
e70c63ba8f context protocol destroy provide nonnull wsi with context
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 01:08:14 +08:00
Andy Green
77ec61e44f server check cb return during establish
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 00:56:31 +08:00
Andy Green
da46eeea6b client check cb return during establish
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 00:50:14 +08:00
Andy Green
6d64539fcb lws_get_context not _ctx
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-17 18:25:25 +08:00
Andy Green
54806b1541 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>
2015-12-17 17:03:59 +08:00
Andy Green
ddd79cbbb5 win cover clearing sock_send_blocking when external poll
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-17 15:35:41 +08:00
Andy Green
eee0d8af5f 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>
2015-12-17 15:15:12 +08:00