Commit graph

2143 commits

Author SHA1 Message Date
Andrew Cooks
cdcf5fc9c0 From 7f39ea761e98ea96f79a7e69d4cdeee0c39d316e Mon Sep 17 00:00:00 2001
Subject: [PATCH] fix missing ${LIB_SUFFIX} on cmake config dir
2016-01-18 12:09:43 +08:00
Peter Pentchev
2a0dbcf7ee 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.
2016-01-18 12:07:07 +08:00
Andy Green
9a9d5eaeeb avoid using deallocated things during context dedtroy
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-18 12:07:07 +08:00
Andy Green
4319b4d78d 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.
2016-01-18 11:16:25 +08:00
Andy Green
a547554aa2 cleaning
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-18 11:16:20 +08:00
Andy Green
1d719ec87f lws_interface_to_sa
Expose interface handling code as an api
2016-01-16 12:09:38 +08:00
Andy Green
d5060d25a1 use lws_close not raw close
https://github.com/warmcat/libwebsockets/issues/400

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-16 11:14:46 +08:00
David Andrade
ec1296a667 Subject: [PATCH] Make echo test app option consistent with the other test
options
2016-01-15 22:48:17 +08:00
Andy Green
29cfeebcde permessage deflate male callback VISIBLE
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-15 22:16:54 +08:00
Andy Green
7c507e4700 fix client getting hung up on at negotiation
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-15 19:34:33 +08:00
Andy Green
809d69aa85 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>
2016-01-15 19:32:47 +08:00
Andy Green
7a0fcf2fc5 parse_uri
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-15 19:32:47 +08:00
Vijay Khurdiya
e73d446461 ssl add ECDH server support
(AG clean style add option flag and docs)
2016-01-15 16:21:51 +08:00
Andy Green
7c15eb1e42 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>
2016-01-14 11:38:31 +08:00
Andy Green
389a4bb9f0 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>
2016-01-13 18:48:50 +08:00
Andy Green
8308073464 fuzzer eliminate hsecond ah free path firing assert sentinel
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-13 05:01:17 +08:00
Andy Green
9928cccdb6 fuzzer rx overflow mitigate
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-12 23:05:02 +08:00
Andy Green
5b3736682d lws_client_connect_via_info
https://github.com/warmcat/libwebsockets/issues/396

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-12 17:22:06 +08:00
Andy Green
b6289d1153 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>
2016-01-12 08:46:56 +08:00
Andy Green
6711266a50 extension permessage deflate
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-11 11:34:01 +08:00
Andy Green
58ad3d6e09 clean libev.c style
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-09 08:13:55 +08:00
Andy Green
5783b1a169 libev set events to match revents
https://github.com/warmcat/libwebsockets/issues/393

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-09 04:12:46 +08:00
Andy Green
5eeb4bd0d3 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>
2016-01-08 21:52:47 +08:00
Denis Osvald
27174e64de properly skip protocols with NULL name
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2016-01-07 06:57:59 +08:00
Denis Osvald
034e514a0d 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>
2016-01-07 06:44:38 +08:00
Andy Green
0c7e5a9418 doc improve docs around header access apis
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-30 14:53:50 +08:00
Andy Green
2b35e123f4 ext negotiation tolerate semicolon args
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-30 12:12:58 +08:00
Andy Green
86c1ef1e7c utf8 check compatible with extensions
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-30 11:43:36 +08:00
Andy Green
9b81d3c967 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>
2015-12-29 12:28:48 +08:00
Andy Green
44a7f65e1a introduce LWS_SERVER_OPTION_VALIDATE_UTF8
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-29 11:20:09 +08:00
Andy Green
0c7b38b144 autobahn check utf8 on TEXT and CLOSE
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-29 09:46:03 +08:00
Andy Green
7c2868486e 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>
2015-12-28 22:29:57 +08:00
Andy Green
fde3684384 autobahn README.test apps.md
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-28 22:29:57 +08:00
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