platform/upstream/libwebsockets.git
8 years agoclean windows warnings
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>
8 years agotest server libev
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>
8 years agoclarify changelog
Andy Green [Sat, 26 Dec 2015 12:26:11 +0000 (20:26 +0800)]
clarify changelog

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoupdate api docs
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>
8 years agoclose add api to control sent close frame contents
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>
8 years agoclose add callback to get peer close reason
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>
8 years agombed3 remove forcing _DEBUG
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>
8 years agombed3 remove unused allocations
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>
8 years agodeprecate LWS_SEND_BUFFER_POST_PADDING
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>
8 years agooutput eliminate redundant post calculation
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>
8 years agoremove MAX_MUX_RECURSION from PRE padding
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>
8 years agorearrange private struct packing 2
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>
8 years agoRecognize Debian GNU/kFreeBSD as FreeBSD-ish.
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.

8 years agorearrange struct packing
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>
8 years agohttp header malloc pool implement pool
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>
8 years agohttp header malloc pool allow listen accept flow control
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>
8 years agows ping buffer allocate in wsi ws union member
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>
8 years agoinfo struct add padding pool
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>
8 years agodetect service tid once and use wsi with valid context to do it
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>
8 years agolibev complete unix plat context init
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>
8 years agolibev context destroy
gaby64 [Tue, 22 Dec 2015 04:41:12 +0000 (12:41 +0800)]
libev context destroy

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

8 years agotest ping android compatibility
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>
8 years agoSubject: [PATCH] Typo in macro name.
Roger A. Light [Sat, 19 Dec 2015 01:26:53 +0000 (01:26 +0000)]
Subject: [PATCH] Typo in macro name.

8 years agouridecoding lws_hdr_fragment_length
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>
8 years agowhitespace tidy
Andy Green [Fri, 18 Dec 2015 23:18:55 +0000 (07:18 +0800)]
whitespace tidy

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agouridecode no need to require length plus 2
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>
8 years agouridecoding disallow uriencoded equals in name part
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>
8 years agouridecoding handle plus chars as space
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>
8 years agouridecoding support optional semicolon as delimiter
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>
8 years agoversion 1.6.0
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>
8 years agoapi doc v1.6.0
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>
8 years agochangelog pre v1.6.0
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>
8 years agoclean uri arg dump
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>
8 years agocontext protocol destroy provide nonnull wsi with context
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>
8 years agoserver check cb return during establish
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>
8 years agoclient check cb return during establish
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>
8 years agolws_get_context not _ctx
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>
8 years agoclean internal refactor
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>
8 years agowin cover clearing sock_send_blocking when external poll
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>
8 years agowin solve various cranky problems with msvc
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>
8 years agoclean misc 1
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>
8 years agopublic api remove context from user callback API BREAK
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>
8 years agowindows fix wsapoll conflict on some toolchains
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>
8 years agopublic api remove superfluous context params API BREAK
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>
8 years agoadd LWS_INLINE to deal with crappy msvc
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>
8 years agohttp uri arguments process in fragments
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>
8 years agoURIPS_ARGUMENTS is redundant
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>
8 years agodocument how the header fragments work
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>
8 years agointroduce lws_hdr_copy_fragment
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>
8 years agorefactor needless context with wsi paramater passing
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>
8 years agoSubject: [PATCH] Add LWS_LIBRARY_VERSION_NUMBER to lws_config.h.
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.

8 years agoFix corruption of close reason code in close frame
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

8 years agombed3 use new upstream mbed3 nagle disable
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>
8 years agouriencoding deal with0uriencoded question mark properly
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>
8 years agowin align to recent changes
Andy Green [Mon, 14 Dec 2015 03:34:00 +0000 (11:34 +0800)]
win align to recent changes

These were warnings seen on Appveyor

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agombed3 align to recent changes
Andy Green [Mon, 14 Dec 2015 03:17:16 +0000 (11:17 +0800)]
mbed3 align to recent changes

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoRefactoring conditional directives for if wrappers
wmarquesr [Sun, 13 Dec 2015 23:36:41 +0000 (20:36 -0300)]
Refactoring conditional directives for if wrappers

8 years agowhitespace trailing mass cleanout
Andy Green [Mon, 14 Dec 2015 00:52:03 +0000 (08:52 +0800)]
whitespace trailing mass cleanout

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agolibev take care about const context where possible
Andy Green [Sun, 13 Dec 2015 23:51:15 +0000 (07:51 +0800)]
libev take care about const context where possible

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agochangelog update file api about wsi
Andy Green [Sun, 13 Dec 2015 23:21:42 +0000 (07:21 +0800)]
changelog update file api about wsi

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agointroduce lws_wsi_user
Andy Green [Sun, 13 Dec 2015 23:16:32 +0000 (07:16 +0800)]
introduce lws_wsi_user

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agochangelog explain protocols related api changes
Andy Green [Sun, 13 Dec 2015 23:02:51 +0000 (07:02 +0800)]
changelog explain protocols related api changes

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agolws_plat_fd add wsi to fops and helpers
Andy Green [Fri, 11 Dec 2015 05:12:58 +0000 (13:12 +0800)]
lws_plat_fd add wsi to fops and helpers

Having the lws_context alone doesn't let us track state or act different
by wsi, which is the most interesting usecase.  Eg not only simply track
file position / decompression state per wsi but also act differently
according to wsi authentication state / associated cookies.

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agomake protocols const require explicit context API BREAK
Andy Green [Fri, 11 Dec 2015 02:45:35 +0000 (10:45 +0800)]
make protocols const require explicit context API BREAK

The user protocols struct has not been const until now.

This has been painful for a while because the semantics of the protocols
struct look like it's going to be treated as const.

At context creation, the protocols struct has been getting marked with the context,
and three apis exploited that to only need to be passed a pointer to a protocol to
get access to the context.

This patch removes the two writeable members in the context (these were never directly
used by user code), changes all pointers to protocols to be const, and adds an explicit
first argument to the three affected apis so they can have access to context.

The three affected apis are these

 LWS_VISIBLE LWS_EXTERN int
-lws_callback_on_writable_all_protocol(const struct lws_protocols *protocol);
+lws_callback_on_writable_all_protocol(const struct lws_context *context,
+                                     const struct lws_protocols *protocol);

 LWS_VISIBLE LWS_EXTERN int
-lws_callback_all_protocol(const struct lws_protocols *protocol, int reason);
+lws_callback_all_protocol(struct lws_context *context,
+                         const struct lws_protocols *protocol, int reason);

 LWS_VISIBLE LWS_EXTERN void
-lws_rx_flow_allow_all_protocol(const struct lws_protocols *protocol);
+lws_rx_flow_allow_all_protocol(const struct lws_context *context,
+                              const struct lws_protocols *protocol);

unfortunately the original apis can no longer be emulated and users of them must update.

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agolws_get_ctx conversion
Andy Green [Fri, 11 Dec 2015 01:36:14 +0000 (09:36 +0800)]
lws_get_ctx conversion

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agowin open flags 3 lsb are not bitfields
Andy Green [Sun, 13 Dec 2015 22:40:53 +0000 (06:40 +0800)]
win open flags 3 lsb are not bitfields

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

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoRevert using AI_V4MAPPED flag to getaddrinfo for Android
Yusuke Ishiguro [Fri, 11 Dec 2015 09:10:02 +0000 (18:10 +0900)]
Revert using AI_V4MAPPED flag to getaddrinfo for Android

Because getaddrinfo will return error on Android when
AI_V4MAPPED is specified. So we should use old implemntation.
Android support of IPv6 is very poor.

8 years agowindows fcntl.h
Andy Green [Thu, 10 Dec 2015 05:21:07 +0000 (13:21 +0800)]
windows fcntl.h

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoLWS_O_RDONLY to hide perversions
Andy Green [Thu, 10 Dec 2015 05:03:10 +0000 (13:03 +0800)]
LWS_O_RDONLY to hide perversions

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoosx fix unsigned signed compare error 2
Andy Green [Thu, 10 Dec 2015 05:00:15 +0000 (13:00 +0800)]
osx fix unsigned signed compare error 2

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agowindows use right perversion flgs
Andy Green [Thu, 10 Dec 2015 04:56:46 +0000 (12:56 +0800)]
windows use right perversion flgs

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoosx fix unsigned signed compare error
Andy Green [Thu, 10 Dec 2015 04:50:10 +0000 (12:50 +0800)]
osx fix unsigned signed compare error

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agolws_plat_fd implement platform default handlers
Andy Green [Wed, 9 Dec 2015 23:58:58 +0000 (07:58 +0800)]
lws_plat_fd implement platform default handlers

This is a rewrite of the patch from Soapyman here

https://github.com/warmcat/libwebsockets/pull/363

The main changes compared to Soapyman's original patch are

 - There's no new stuff in the info struct user code does any overrides
   it may want to do explicitly after lws_context_create returns

 - User overrides for file ops can call through (subclass) to the original
   platform implementation using lws_get_fops_plat()

 - A typedef is provided for plat-specific fd type

 - Public helpers are provided to allow user code to be platform-independent
   about file access, using the lws platform file operations underneath:

static inline lws_filefd_type
lws_plat_file_open(struct lws_plat_file_ops *fops, const char *filename,
   unsigned long *filelen, int flags)

static inline int
lws_plat_file_close(struct lws_plat_file_ops *fops, lws_filefd_type fd)

static inline unsigned long
lws_plat_file_seek_cur(struct lws_plat_file_ops *fops, lws_filefd_type fd,
       long offset_from_cur_pos)

static inline int
lws_plat_file_read(struct lws_plat_file_ops *fops, lws_filefd_type fd,
   unsigned long *amount, unsigned char *buf, unsigned long len)

static inline int
lws_plat_file_write(struct lws_plat_file_ops *fops, lws_filefd_type fd,
    unsigned long *amount, unsigned char *buf, unsigned long len)

There's example documentation and implementation in the test server.

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agolws_plat_fd introduce struct
SoapyMan [Wed, 9 Dec 2015 23:52:31 +0000 (07:52 +0800)]
lws_plat_fd introduce struct

Originally from

https://github.com/warmcat/libwebsockets/pull/363

Modified by AG to change the emphasis to exporting lws plat
handlers for use by the user code portably

8 years agotest client remove spamming delays
Andy Green [Thu, 10 Dec 2015 03:01:20 +0000 (11:01 +0800)]
test client remove spamming delays

Chrome seems to be able to deal with this (or my machine is now
muscular enough it doesn't care, anyway)

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoclean comment style in libwebsockets.h
Andy Green [Wed, 9 Dec 2015 23:50:51 +0000 (07:50 +0800)]
clean comment style in libwebsockets.h

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoarmour libwebsockets.h also put notices on abi structs in there
Andy Green [Wed, 9 Dec 2015 23:24:20 +0000 (07:24 +0800)]
armour libwebsockets.h also put notices on abi structs in there

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoplat combine inits into single lws_plat_init and provide info
Andy Green [Wed, 9 Dec 2015 23:14:16 +0000 (07:14 +0800)]
plat combine inits into single lws_plat_init and provide info

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoSubject: [PATCH] fixed not to use IPv4-mapped address for IPv6 only node
Yusuke Ishiguro [Wed, 9 Dec 2015 10:24:44 +0000 (19:24 +0900)]
Subject: [PATCH] fixed not to use IPv4-mapped address for IPv6 only node

Since IPv6 only node can not connect with IPv4-mapped address.

8 years agotest client bit more cleaning
Andy Green [Wed, 9 Dec 2015 00:07:38 +0000 (08:07 +0800)]
test client bit more cleaning

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoAccess to wsi->ssl at LWS_CALLBACK_ESTABLISHED
Alexander Bruines [Tue, 8 Dec 2015 22:31:37 +0000 (23:31 +0100)]
Access to wsi->ssl at LWS_CALLBACK_ESTABLISHED

8 years agotest client reconnect if server disappears
Andy Green [Tue, 8 Dec 2015 23:10:03 +0000 (07:10 +0800)]
test client reconnect if server disappears

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agofixed to initialize sockaddr_in6 by zero
Yusuke Ishiguro [Tue, 8 Dec 2015 10:57:19 +0000 (19:57 +0900)]
fixed to initialize sockaddr_in6 by zero

Some environment has field of sin6_scope_id inside sockaddr_in6
and it should be set to zero.

8 years agosoname bump
Andy Green [Tue, 8 Dec 2015 03:06:28 +0000 (11:06 +0800)]
soname bump

See

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-December/002052.html

for the reason

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoarmour libwebsockets.h against careless enum changes affecting abi
Andy Green [Tue, 8 Dec 2015 03:04:19 +0000 (11:04 +0800)]
armour libwebsockets.h against careless enum changes affecting abi

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agocmake additionally install cmake config
Charles Prevot [Tue, 8 Dec 2015 02:26:57 +0000 (10:26 +0800)]
cmake additionally install cmake config

8 years agocoverity 155650 medium possible write to null pointer
Andy Green [Sun, 6 Dec 2015 03:07:41 +0000 (11:07 +0800)]
coverity 155650 medium possible write to null pointer

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agocoverity 155649 medium possible write to null pointer
Andy Green [Sun, 6 Dec 2015 03:04:05 +0000 (11:04 +0800)]
coverity 155649 medium possible write to null pointer

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agocoverity 155648 low dead code daemonize disabled
Andy Green [Sun, 6 Dec 2015 03:00:36 +0000 (11:00 +0800)]
coverity 155648 low dead code daemonize disabled

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agotravis coverity update
Andy Green [Sun, 6 Dec 2015 02:43:02 +0000 (10:43 +0800)]
travis coverity update

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoclean more whitespace 5
Andy Green [Sun, 6 Dec 2015 02:05:37 +0000 (10:05 +0800)]
clean more whitespace 5

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoclean more whitespace 4
Andy Green [Sun, 6 Dec 2015 01:15:27 +0000 (09:15 +0800)]
clean more whitespace 4

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoclean more whitespace 3
Andy Green [Sun, 6 Dec 2015 00:40:00 +0000 (08:40 +0800)]
clean more whitespace 3

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoclean reduce windows build warnings
Andy Green [Sun, 6 Dec 2015 00:00:03 +0000 (08:00 +0800)]
clean reduce windows build warnings

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agomore server close processing error handling precisions
Andy Green [Sat, 5 Dec 2015 22:39:51 +0000 (06:39 +0800)]
more server close processing error handling precisions

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoserver socket service close when detected do right thing
Andy Green [Sat, 5 Dec 2015 21:55:52 +0000 (05:55 +0800)]
server socket service close when detected do right thing

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoclean more whitespace 2
Andy Green [Sat, 5 Dec 2015 21:52:09 +0000 (05:52 +0800)]
clean more whitespace 2

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoclean more whitespace
Andy Green [Sat, 5 Dec 2015 13:51:47 +0000 (21:51 +0800)]
clean more whitespace

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agoserver socket service close fix fail detect
Andy Green [Sat, 5 Dec 2015 13:52:16 +0000 (21:52 +0800)]
server socket service close fix fail detect

Signed-off-by: Andy Green <andy.green@linaro.org>
8 years agowindows align lws_service_fd return processing with unix
Andy Green [Sat, 5 Dec 2015 01:38:50 +0000 (09:38 +0800)]
windows align lws_service_fd return processing with unix

Signed-off-by: Andy Green <andy.green@linaro.org>