platform/upstream/libwebsockets.git
8 years agoAdd reject service keywords list
Andy Green [Wed, 12 Oct 2016 22:32:57 +0000 (06:32 +0800)]
Add reject service keywords list

8 years agoadjust_timeout: with default lws_plat_service_tsi allow beings passed 0 timeout
Andy Green [Mon, 10 Oct 2016 12:34:34 +0000 (20:34 +0800)]
adjust_timeout: with default lws_plat_service_tsi allow beings passed 0 timeout

Some people are calling service with zero timeout, taking care of
not busywaiting by some other external arrangements.

Adapt the forced service signalling to survive this.

8 years agosome compilers need void param explicitly
Joerg Pommnitz [Mon, 10 Oct 2016 12:10:39 +0000 (20:10 +0800)]
some compilers need void param explicitly

8 years agoCorrect the library name of LIBHUBBUB_LIBRARIES
Yuchen Xie [Mon, 10 Oct 2016 12:10:34 +0000 (20:10 +0800)]
Correct the library name of LIBHUBBUB_LIBRARIES

It should be `hubbub` in `find_library` to make the function work.

8 years agodocs: explain lws_write handling of truncated sends better
Andy Green [Sat, 8 Oct 2016 10:08:03 +0000 (18:08 +0800)]
docs: explain lws_write handling of truncated sends better

8 years agopublicly document lws_service_fd timeout servicing
Denis Osvald [Fri, 7 Oct 2016 09:27:46 +0000 (11:27 +0200)]
publicly document lws_service_fd timeout servicing

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
8 years agotest-server-extpoll: add 1-per-second timeout servicing
Denis Osvald [Thu, 6 Oct 2016 13:45:25 +0000 (15:45 +0200)]
test-server-extpoll: add 1-per-second timeout servicing

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
8 years agotest-server-extpoll: check for forced service before looping again
Denis Osvald [Fri, 7 Oct 2016 08:57:02 +0000 (10:57 +0200)]
test-server-extpoll: check for forced service before looping again

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
8 years agov2.1.0
Andy Green [Thu, 6 Oct 2016 13:48:20 +0000 (21:48 +0800)]
v2.1.0

Bump soname to 9

8 years agoextpoll: expose forced service apis
Andy Green [Thu, 6 Oct 2016 19:19:17 +0000 (03:19 +0800)]
extpoll: expose forced service apis

8 years agoupdate attack.sh
Andy Green [Thu, 6 Oct 2016 12:40:28 +0000 (20:40 +0800)]
update attack.sh

Lws cares about trailing \n on a lot of these tests now.  Make it check it still cares on one and remove
the trailing \n on the others.

There's 2 changes in the results about /..//?, it seems to apply / to uri arg 1.  But it doesn't seem
to make a problem so just adapt the results for now.

8 years agoubuntu: fix uv detection for lwsws
Andy Green [Wed, 5 Oct 2016 05:49:46 +0000 (13:49 +0800)]
ubuntu: fix uv detection for lwsws

8 years agotravis: explicitly point to openssl on osx
Andy Green [Wed, 5 Oct 2016 01:52:39 +0000 (09:52 +0800)]
travis: explicitly point to openssl on osx

One day this started failing at CMake autofind. This forces it to look at the right place.

8 years agofix cosmetic if end if name tag error
Andy Green [Wed, 5 Oct 2016 02:15:16 +0000 (10:15 +0800)]
fix cosmetic if end if name tag error

8 years agoclosing drops any pending ah rx immediately
Andy Green [Tue, 4 Oct 2016 10:05:10 +0000 (18:05 +0800)]
closing drops any pending ah rx immediately

8 years agoport forced service checking from libuv
Andy Green [Tue, 4 Oct 2016 00:39:14 +0000 (08:39 +0800)]
port forced service checking from libuv

Related to second part of

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

8 years agopost form parsing fix retry as new boundary start needed after mismatching boundary
Andy Green [Tue, 4 Oct 2016 00:24:00 +0000 (08:24 +0800)]
post form parsing fix retry as new boundary start needed after mismatching boundary

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

8 years agoRemove the cleanup functions with OpenSSL 1.1.
Peter Pentchev [Sat, 1 Oct 2016 23:21:20 +0000 (02:21 +0300)]
Remove the cleanup functions with OpenSSL 1.1.

The thread support in OpenSSL has been rewritten almost completely
and the cleanup functions are now executed automatically.

8 years agoSubject: Fix some typographical and grammatical errors.
Peter Pentchev [Sat, 1 Oct 2016 23:21:03 +0000 (02:21 +0300)]
Subject: Fix some typographical and grammatical errors.

8 years agolws_header_table_reset: make caller responsibility to clear down ah rx buffer
Andy Green [Thu, 29 Sep 2016 02:31:06 +0000 (10:31 +0800)]
lws_header_table_reset: make caller responsibility to clear down ah rx buffer

There are two kinds of reaason to call lws_header_table_reset(), one is we are reallocating
a destroyed ah to another wsi, and the other is we are moving to the next pipelined header set
still on the same wsi, and we need a "weaker" reset that only clears down the state related
to the header parsing, not everything about the ah context including the ah rx buffer.

This patch moves the ah rxbuffer rxpos and rxlen resetting out of lws_header_table_reset() and to
be the responsibility of the caller.  Callers who are moving the ah to another wsi are
patched to deal with resetting rxpos and rxlen and lws_http_transaction_completed() who only
resets the ah when moving to the next pipelined headers, no longer wrongly clears the ah rxbuf.

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

8 years agoAdded option to build the static library with PIC
Brown, Matthew [Mon, 26 Sep 2016 21:32:40 +0000 (05:32 +0800)]
Added option to build the static library with PIC

8 years agofix build problem on systems without X509_VERIFY_PARAM type
Benjamin Ness [Mon, 26 Sep 2016 19:18:16 +0000 (14:18 -0500)]
fix build problem on systems without X509_VERIFY_PARAM type

8 years agoAdd SVG to lws_get_mimetype()
Patrick Gansterer [Thu, 22 Sep 2016 22:04:40 +0000 (00:04 +0200)]
Add SVG to lws_get_mimetype()

8 years agolwsws license to cc0
Andy Green [Mon, 19 Sep 2016 11:16:47 +0000 (19:16 +0800)]
lwsws license to cc0

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

8 years agolws_snprintf
Andy Green [Wed, 14 Sep 2016 18:22:57 +0000 (02:22 +0800)]
lws_snprintf

Thanks to Fabrice Gilot for reporting the problem that led to uncovering this.

Due to a misunderstanding of the return value of snprintf (it is not truncated according
to the max size passed in) in several places relying on snprintf to truncate the length
overflows are possible.

This patch wraps snprintf with a new lws_snprintf() which does truncate its length to allow
the buffer limiting scheme to work properly.

All users should update with these fixes.

8 years agohandle rx flow control active when consuming payload
Andy Green [Fri, 9 Sep 2016 20:43:07 +0000 (04:43 +0800)]
handle rx flow control active when consuming payload

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

8 years agogeneric-table: format-security
Andy Green [Fri, 9 Sep 2016 20:27:27 +0000 (04:27 +0800)]
generic-table: format-security

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

8 years agolws_status protect against pss list changing
Andy Green [Fri, 9 Sep 2016 14:15:43 +0000 (22:15 +0800)]
lws_status protect against pss list changing

8 years agoadopt_socket_vhost: error path doesn't remove us from timeout list
Andy Green [Fri, 9 Sep 2016 00:29:32 +0000 (08:29 +0800)]
adopt_socket_vhost: error path doesn't remove us from timeout list

As found by "github user 7"

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

8 years agoDo not use ps fax on Solaris.
Fredrik Skogman [Thu, 8 Sep 2016 22:51:43 +0000 (06:51 +0800)]
Do not use ps fax on Solaris.

8 years agoUpdated test programs to build on Solaris. Some whitespaces cleanup.
Fredrik Skogman [Thu, 8 Sep 2016 22:50:41 +0000 (06:50 +0800)]
Updated test programs to build on Solaris. Some whitespaces cleanup.

8 years agoAdded build support for Solaris.
Fredrik Skogman [Thu, 8 Sep 2016 22:49:44 +0000 (06:49 +0800)]
Added build support for Solaris.

8 years agoCheck for sys/sockio.h.
Fredrik Skogman [Thu, 8 Sep 2016 22:48:24 +0000 (06:48 +0800)]
Check for sys/sockio.h.

8 years agoclient http: extra read notification after close
Andy Green [Tue, 6 Sep 2016 07:36:51 +0000 (15:36 +0800)]
client http: extra read notification after close

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

8 years agowindows: WCHAR in lws_plat_inet_ntop needs double the final allocation
Andy Green [Mon, 5 Sep 2016 07:03:37 +0000 (15:03 +0800)]
windows: WCHAR in lws_plat_inet_ntop needs double the final allocation

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

8 years agocoverity 169276-9 - false positive assuming 8b char: char limits index size
Andy Green [Sun, 28 Aug 2016 01:39:21 +0000 (09:39 +0800)]
coverity 169276-9 - false positive assuming 8b char: char limits index size

8 years agocoverity 169274 - lwsgt dirlisting ignore files that cant be statted
Andy Green [Sun, 28 Aug 2016 01:34:27 +0000 (09:34 +0800)]
coverity 169274 - lwsgt dirlisting ignore files that cant be statted

8 years agocoverity 169273 - off-by-one on cgi chunking swallow limit
Andy Green [Sun, 28 Aug 2016 01:28:55 +0000 (09:28 +0800)]
coverity 169273 - off-by-one on cgi chunking swallow limit

8 years agocoverity 169272 - off-by-one possible on CGI buffer limit
Andy Green [Sun, 28 Aug 2016 01:24:06 +0000 (09:24 +0800)]
coverity 169272 - off-by-one possible on CGI buffer limit

8 years agocoverity 169271 - take care about sockfd of -1 on close
Andy Green [Sun, 28 Aug 2016 01:21:56 +0000 (09:21 +0800)]
coverity 169271 - take care about sockfd of -1 on close

8 years agocoverity 169269 - dont issue NULL cce
Andy Green [Sun, 28 Aug 2016 01:18:17 +0000 (09:18 +0800)]
coverity 169269 - dont issue NULL cce

8 years agocoverity 169268 + 169270- dead code plus repeat NULL check on error path
Andy Green [Sun, 28 Aug 2016 01:15:26 +0000 (09:15 +0800)]
coverity 169268 + 169270- dead code plus repeat NULL check on error path

8 years agocoverity 169275 - lwsgt check string bounds
Andy Green [Sun, 28 Aug 2016 01:12:39 +0000 (09:12 +0800)]
coverity 169275 - lwsgt check string bounds

8 years agocoverity 169267 - lwsgt strncpy may fill buffer without NUL
Andy Green [Sun, 28 Aug 2016 01:10:40 +0000 (09:10 +0800)]
coverity 169267 - lwsgt strncpy may fill buffer without NUL

8 years agoper-vhost headers and lwsws conf support
Andy Green [Sat, 27 Aug 2016 09:07:06 +0000 (17:07 +0800)]
per-vhost headers and lwsws conf support

This l;ets you add per-vhost arbitrary headers on served files, eg

     "headers": [{
        "X-Content-Type-Options": "nosniff",
        "X-XSS-Protection": "1; mode=block",
        "x-frame-options": "SAMEORIGIN"
        }],

8 years agoUpdate badges in README.md
Patrick Gansterer [Fri, 26 Aug 2016 21:42:04 +0000 (23:42 +0200)]
Update badges in README.md

Fix the link to Appveyor and use SVG images.

8 years agoRemove unneeded #include <stdint.h>
Patrick Gansterer [Fri, 26 Aug 2016 08:49:29 +0000 (10:49 +0200)]
Remove unneeded #include <stdint.h>

This fixes the build for Visual Studio 2008.

8 years agotest html: js date uses ms
Andy Green [Tue, 23 Aug 2016 10:29:17 +0000 (18:29 +0800)]
test html: js date uses ms

8 years agocgi-retain-timeout-after-POST-send
Andy Green [Tue, 23 Aug 2016 06:20:11 +0000 (14:20 +0800)]
cgi-retain-timeout-after-POST-send

Sending the POST data isn't enough to let us off the hook for timeout checks, if we
are doing a CGI on it.

8 years agoquench logging
Andy Green [Sun, 21 Aug 2016 23:07:10 +0000 (07:07 +0800)]
quench logging

8 years agocgi: deal with all methods correctly
Andy Green [Fri, 19 Aug 2016 22:34:46 +0000 (06:34 +0800)]
cgi: deal with all methods correctly

8 years agouv: dont handle SIGSEGV, SIGFPE
Andy Green [Fri, 19 Aug 2016 21:47:29 +0000 (05:47 +0800)]
uv: dont handle SIGSEGV, SIGFPE

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

8 years agoRemove context from lws_context_per_thread for non-libuv builds
Patrick Gansterer [Sun, 14 Aug 2016 12:04:56 +0000 (14:04 +0200)]
Remove context from lws_context_per_thread for non-libuv builds

The variable is never read when built without libuv.

8 years agoAdd error handling for SSL_new() of clients
Patrick Gansterer [Sun, 14 Aug 2016 10:51:15 +0000 (12:51 +0200)]
Add error handling for SSL_new() of clients

Do not access wsi->ssl if SSL_new() failed and log the error.

8 years agoFix signature of lws_create_vhost() in README.coding.md
Patrick Gansterer [Sun, 14 Aug 2016 10:38:03 +0000 (12:38 +0200)]
Fix signature of lws_create_vhost() in README.coding.md

8 years agoAllow serving files without known mimetype
Patrick Gansterer [Sat, 13 Aug 2016 09:17:53 +0000 (11:17 +0200)]
Allow serving files without known mimetype

RFC2616 only says that any HTTP/1.1 message containing an entity-body
SHOULD include a Content-Type header field defining the media type of
that body.
RFC2119 defines SHOULD as: This word mean that there may exist valid
reasons in particular circumstances to ignore a particular item, but
the full implications must be understood and carefully weighed before
choosing a different course.

AG: this isn't an oversight, it's paranoia about sending out /etc/passwd
or /etc/shadow accidentally.

I agree it should be allowed if people really want to override it.  But
the default should remain like it is I think.

I adapted the patch to allow the extra mimetype "*": "" to be declared on
a mount, as a wildcard match that serves the file without a Content-Type.

8 years agoserver max protocol element 64
Andy Green [Wed, 10 Aug 2016 21:36:08 +0000 (05:36 +0800)]
server max protocol element 64

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

8 years agoclient-add-PUSH-http-body-capability
Andy Green [Mon, 8 Aug 2016 13:54:30 +0000 (21:54 +0800)]
client-add-PUSH-http-body-capability

Support HTTP body sending on client connections.

Add demo to test-client.

Run the normal test server, then

$ libwebsockets-test-client http://localhost:7681/formtest -o

It will post the string "hello" to the POST test using application/x-www-form-urlencoded

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

Also ensures any of the Client HTTP transient modes will call back LWS_CALLBACK_CLOSED_CLIENT_HTTP
if they close

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

8 years agoclient fixups after esp8266
Andy Green [Sun, 7 Aug 2016 00:33:08 +0000 (08:33 +0800)]
client fixups after esp8266

8 years agoesp8266 initial support
Andy Green [Sat, 23 Jul 2016 06:18:25 +0000 (14:18 +0800)]
esp8266 initial support

8 years agobase64 decode fix lengths
Andy Green [Wed, 3 Aug 2016 19:18:36 +0000 (03:18 +0800)]
base64 decode fix lengths

8 years agoah detach: don't print held time if actually detached
Andy Green [Tue, 19 Jul 2016 01:38:48 +0000 (09:38 +0800)]
ah detach: don't print held time if actually detached

Confusingly an ah held time was printed for a previously detached ah.

Clear down the time field when detaching the ah so this can't happen any more.

8 years agows ping pong on idle connections
Andy Green [Fri, 15 Jul 2016 05:41:38 +0000 (13:41 +0800)]
ws ping pong on idle connections

This adds a new member to the context creation info struct "ws_ping_pong_interval".

If nonzero, it sets the number of seconds that established ws connections are
allowed to be idle before a PING is forced to be sent.  If zero (the default) then
tracking of idle connection is disabled for backwards compatibility.

Timeouts cover both the period between decision to send the ping and it being
sent (because it needs the socket to become writeable), and the period between
the ping being sent and the PONG coming back.

INFO debug logs are issues when the timeout stuff is operating.

You can test the server side by running the test server hacked to set ws_ping_pong_interval
and debug log mask of 15.  Both the mirror protocol and the server-status protocol are
idle if nothing is happening and will trigger the PING / PONG testing.  (You can also
test using lwsws and /etc/lwsws/conf with "ws-pingpong-secs": "20" in the global section)

For client, run the test client with -n -P 20 for 20s interval.  -n stops the test client
writing using the mirror protocol, so it will be idle and trigger the PING / PONGs.

The timeout interval may be up to +10s late, as lws checks for affected connections every
10s.

8 years agoPlugin server-status cleanup
Andy Green [Wed, 13 Jul 2016 03:35:16 +0000 (11:35 +0800)]
Plugin server-status cleanup

8 years agoplugins-dim-webpage-when-connection-lost
Andy Green [Wed, 13 Jul 2016 00:45:22 +0000 (08:45 +0800)]
plugins-dim-webpage-when-connection-lost

8 years agoplugin table dirlisting
Andy Green [Sat, 25 Jun 2016 22:29:20 +0000 (06:29 +0800)]
plugin table dirlisting

8 years agodoxygen use sections
Andy Green [Wed, 13 Jul 2016 00:14:57 +0000 (08:14 +0800)]
doxygen use sections

8 years agoRecheck slot when an FD gets closed and make formatting consistent
Mike Messina [Mon, 11 Jul 2016 13:17:48 +0000 (21:17 +0800)]
Recheck slot when an FD gets closed and make formatting consistent

8 years agoUse one event for all sockets to avoid 64 limit and fix the single dispatch issue
mmessina [Mon, 11 Jul 2016 13:17:21 +0000 (21:17 +0800)]
Use one event for all sockets to avoid 64 limit and fix the single dispatch issue

8 years agoSNI-vhost-matching-fallback-to-wildcard
Andy Green [Mon, 11 Jul 2016 01:44:17 +0000 (09:44 +0800)]
SNI-vhost-matching-fallback-to-wildcard

8 years agoah change default header len to 4096 and pool size 4
Andy Green [Sun, 10 Jul 2016 23:48:53 +0000 (07:48 +0800)]
ah change default header len to 4096 and pool size 4

Users are starting to appear with clients sending more than the default max header
content buffer of 1024... with the advent of the ah pool the old reasons for keeping this
modest no longer apply, so up it to 4096 and reduce the default pool size to 4 from 16 to
keep the overall memory usage the same.

8 years agoEXTPOLL export LWS_POLLXXX and document .events must be .revents
Andy Green [Sun, 10 Jul 2016 23:28:23 +0000 (07:28 +0800)]
EXTPOLL export LWS_POLLXXX and document .events must be .revents

8 years agoclient ssl add flag to control server cert hostname check
Andy Green [Thu, 7 Jul 2016 00:14:26 +0000 (08:14 +0800)]
client ssl add flag to control server cert hostname check

8 years agodefer ESTABLISHED until after mode is WS_SERVING
Andy Green [Wed, 6 Jul 2016 09:42:19 +0000 (17:42 +0800)]
defer ESTABLISHED until after mode is WS_SERVING

8 years agolejp-conf: substitute _lws_ddir_ with install dir
Andy Green [Wed, 6 Jul 2016 02:48:41 +0000 (10:48 +0800)]
lejp-conf: substitute _lws_ddir_ with install dir

8 years agolejp_conf: pmo as alias for cgi-env
Andy Green [Tue, 5 Jul 2016 23:37:34 +0000 (07:37 +0800)]
lejp_conf: pmo as alias for cgi-env

Since cgi-env only applies for cgi types, we can
re-use it for generic per-mount options (pmo)

8 years agowin32-clean-and-use-do-while
Andy Green [Tue, 5 Jul 2016 10:40:40 +0000 (18:40 +0800)]
win32-clean-and-use-do-while

8 years agolws_get_mimetype
Andy Green [Sun, 3 Jul 2016 01:20:11 +0000 (09:20 +0800)]
lws_get_mimetype

8 years agopeer closes during partial buffered just hang up
Andy Green [Sat, 2 Jul 2016 01:23:15 +0000 (09:23 +0800)]
peer closes during partial buffered just hang up

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

8 years agoCLIENT_CONNECTION_ERROR add strings
Andy Green [Fri, 1 Jul 2016 00:54:39 +0000 (08:54 +0800)]
CLIENT_CONNECTION_ERROR add strings

This clears up a couple of issues with client connect.

 - if CLIENT_CONNECTION_ERROR is coming, which of the many
   ways the rejection may have happened is documented in the
   in argument.  It's still possible if it just got hung up on
   in will be NULL, but now it has MANY more canned strings
   describing the issue available at the callback

"getaddrinfo (ipv6) failed"
"unknown address family"
"getaddrinfo (ipv4) failed"
"set socket opts failed"
"insert wsi failed"
"lws_ssl_client_connect1 failed"
"lws_ssl_client_connect2 failed"
"Peer hung up"
"read failed"
"HS: URI missing"
"HS: Redirect code but no Location"
"HS: URI did not parse"
"HS: Redirect failed"
"HS: Server did not return 200"
"HS: OOM"
"HS: disallowed by client filter"
"HS: disallowed at ESTABLISHED"
"HS: ACCEPT missing"
"HS: ws upgrade response not 101"
"HS: UPGRADE missing"
"HS: Upgrade to something other than websocket"
"HS: CONNECTION missing"
"HS: UPGRADE malformed"
"HS: PROTOCOL malformed"
"HS: Cannot match protocol"
"HS: EXT: list too big"
"HS: EXT: failed setting defaults"
"HS: EXT: failed parsing defaults"
"HS: EXT: failed parsing options"
"HS: EXT: Rejects server options"
"HS: EXT: unknown ext"
"HS: Accept hash wrong"
"HS: Rejected by filter cb"
"HS: OOM"
"HS: SO_SNDBUF failed"
"HS: Rejected at CLIENT_ESTABLISHED"

 - until now the user code did not get the new wsi that was created
    in the client connection action until it returned.  However the
    client connection action may provoke callbacks like
    CLIENT_CONNECTION_ERROR before then, if multiple client connections
    are initiated it makes it unknown to user code which one the callback
    applies to.  The wsi is provided in the callback but it has not yet
    returned from the client connect api to give that wsi to the user code.

    To solve that there is a new member added to client connect info struct,
    pwsi, which lets you pass a pointer to a struct wsi * in the user code
    that will get filled in with the new wsi.  That happens before any
    callbacks could be provoked, and it is updated to NULL if the connect
    action fails before returning from the client connect api.

8 years agoremove polarssl mbedtls support
Andy Green [Thu, 30 Jun 2016 02:21:23 +0000 (10:21 +0800)]
remove polarssl mbedtls support

Just remove it from cmake

8 years agoreduce log spew and document test-server variants
Andy Green [Thu, 30 Jun 2016 02:11:59 +0000 (10:11 +0800)]
reduce log spew and document test-server variants

8 years agofix __x86_64__ check
Robin Rowe [Wed, 29 Jun 2016 18:02:08 +0000 (02:02 +0800)]
fix __x86_64__ check

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

8 years agotest-libev add server-status protocol
Andy Green [Tue, 28 Jun 2016 22:04:25 +0000 (06:04 +0800)]
test-libev add server-status protocol

8 years agoclient confirm server hostname in cert
Andy Green [Tue, 28 Jun 2016 11:50:40 +0000 (19:50 +0800)]
client confirm server hostname in cert

Openssl v1.0.2 and above have support for checking the hostname
the client side connected to against the hostname on the cert the
server presented.

This enables that feature if the necessary API is available in the
openssl version, meaning the connection will fail at ssl negotiation if the
cert isn't for the requested server

It's very easy to test, add a fake entry to /etc/hosts for the server IP with
a different name, using that will fail at ssl but using the correct dns name
matching the certificate will work.

8 years agowindows detect client connection error
Andy Piper [Tue, 28 Jun 2016 11:01:20 +0000 (19:01 +0800)]
windows detect client connection error

8 years agodlfcn h only if plugins
Andy Green [Sun, 26 Jun 2016 21:53:38 +0000 (05:53 +0800)]
dlfcn h only if plugins

Signed-off-by: None <andy@warmcat.com>
8 years agodocumentation convert to doxygen
Andy Green [Mon, 20 Jun 2016 09:05:31 +0000 (17:05 +0800)]
documentation convert to doxygen

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agoprotocol-lws-messageboard
Andy Green [Wed, 15 Jun 2016 04:24:38 +0000 (12:24 +0800)]
protocol-lws-messageboard

This is a simple messageboard built on top of lwsgs

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agolws_bind_protocol
Andy Green [Sat, 18 Jun 2016 01:00:04 +0000 (09:00 +0800)]
lws_bind_protocol

When using http/1.1+ keepalive and mounts, the relationship between
a connection and a protocol becomes dynamic.  The same connection might
visit different bits of the url space served by different mounts using
different protocols.

This patch ensures protocols can cleanly manage their per-connection
allocations by using the following callbacks when the protocol changes

 LWS_CALLBACK_HTTP_BIND_PROTOCOL
 LWS_CALLBACK_HTTP_DROP_PROTOCOL

For example if the pss wants to malloc stuff at runtime, it should do it
in LWS_CALLBACK_HTTP_BIND_PROTOCOL or later, and clean it up in
...DROP_PROTOCOL.

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agoprotocol generic sessions
Andy Green [Thu, 19 May 2016 07:28:31 +0000 (15:28 +0800)]
protocol generic sessions

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agolws_json_escape
Andy Green [Fri, 17 Jun 2016 02:05:23 +0000 (10:05 +0800)]
lws_json_escape

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agolejp conf report human readable errors
Andy Green [Fri, 17 Jun 2016 22:36:37 +0000 (06:36 +0800)]
lejp conf report human readable errors

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agolws_now_secs
Andy Green [Fri, 17 Jun 2016 01:41:22 +0000 (09:41 +0800)]
lws_now_secs

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agoModified the 64 connections "backup" so that there is no wait if any event
OndraCo [Thu, 16 Jun 2016 05:02:31 +0000 (13:02 +0800)]
Modified the 64 connections "backup" so that there is no wait if any event
is already ready.

8 years agoAdded a back-up in case of more than 64 connections.
OndraCo [Thu, 16 Jun 2016 05:02:20 +0000 (13:02 +0800)]
Added a back-up in case of more than 64 connections.

8 years agolws_callback_vhost_protocols
Andy Green [Wed, 15 Jun 2016 02:46:58 +0000 (10:46 +0800)]
lws_callback_vhost_protocols

This gives protocols a way to talk to each other via per-vhost callbacks,
one per protocol (including the sender).

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agolws_process_html_args
Andy Green [Sun, 12 Jun 2016 01:56:39 +0000 (09:56 +0800)]
lws_process_html_args

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agointroduce urlencode decode and sql escape public apis
Andy Green [Wed, 8 Jun 2016 02:07:02 +0000 (10:07 +0800)]
introduce urlencode decode and sql escape public apis

This adds

 - simple lws_urlencode()
 - simple lws_urldecode()
 - simple lws_sql_purify

Those expect the data to all be there and process it up until
the first '\0'.

There is also a larger opaque apis for handling POST_BODY urldecode.  To
enable these, you need to give cmake -DLWS_WITH_STATEFUL_URLDECODE=1 (or
arrange any larger feature that relies on it sets that in CMakeLists.txt)

 - stateful urldecode with parameter array

These have create / process / destroy semantics on a struct that maintains
decode state.

Stateful urldecode is capable of dealing with large POST data in multiple
POST_BODY callbacks cleanly, eg, file transfer by POST.

Stateful urldecode with parameter array wraps the above with a canned
callback that stores the urldecoded data and indexes them in a pointer
array matching an array of parameter names.

You may also pass it an optional callback when creating it, that will recieve
uploaded file content.

The test html is updated to support both urlencoded and multipart forms,
with some javascript to do clientside validation of an arbitrary 100KB
file size limit (there is no file size limit in the apis).

Signed-off-by: Andy Green <andy@warmcat.com>
8 years agofix for https connection code
Gadkari Mugdha [Mon, 13 Jun 2016 09:23:44 +0000 (17:23 +0800)]
fix for https connection code