Commit graph

1880 commits

Author SHA1 Message Date
Andy Green
d1c6d0bb06 windows use right perversion flgs
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-10 12:56:46 +08:00
Andy Green
95181d96a7 osx fix unsigned signed compare error
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-10 12:50:10 +08:00
Andy Green
4e442b7743 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>
2015-12-10 11:01:59 +08:00
SoapyMan
11260dac18 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
2015-12-10 11:01:59 +08:00
Andy Green
4e512dd3a9 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>
2015-12-10 11:01:20 +08:00
Andy Green
510c3c86c0 clean comment style in libwebsockets.h
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-10 07:50:51 +08:00
Andy Green
4fd5ce3361 armour libwebsockets.h also put notices on abi structs in there
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-10 07:24:20 +08:00
Andy Green
4386e36b0b plat combine inits into single lws_plat_init and provide info
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-10 07:14:16 +08:00
Yusuke Ishiguro
4fee9de6bc Subject: [PATCH] fixed not to use IPv4-mapped address for IPv6 only node
Since IPv6 only node can not connect with IPv4-mapped address.
2015-12-09 19:04:17 +08:00
Andy Green
cb0cbfaec1 test client bit more cleaning
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-09 08:07:38 +08:00
Alexander Bruines
8266450ba2 Access to wsi->ssl at LWS_CALLBACK_ESTABLISHED 2015-12-09 07:27:15 +08:00
Andy Green
e97378960f test client reconnect if server disappears
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-09 07:10:03 +08:00
Yusuke Ishiguro
ee435adb7c 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.
2015-12-08 19:57:00 +08:00
Andy Green
ac19bf6801 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>
2015-12-08 11:06:28 +08:00
Andy Green
dc0731b3a5 armour libwebsockets.h against careless enum changes affecting abi
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-08 11:04:19 +08:00
Charles Prevot
90a0dd6b75 cmake additionally install cmake config 2015-12-08 10:26:57 +08:00
Andy Green
0fd63763f6 coverity 155650 medium possible write to null pointer
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 11:07:41 +08:00
Andy Green
e96b2c680a coverity 155649 medium possible write to null pointer
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 11:04:05 +08:00
Andy Green
ef951221d6 coverity 155648 low dead code daemonize disabled
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 11:00:36 +08:00
Andy Green
9b780806f0 travis coverity update
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 10:43:02 +08:00
Andy Green
576d3ec0df clean more whitespace 5
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 10:05:37 +08:00
Andy Green
dc8a3a817a clean more whitespace 4
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 09:15:27 +08:00
Andy Green
d478fb8c38 clean more whitespace 3
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 08:40:00 +08:00
Andy Green
1cc03887f4 clean reduce windows build warnings
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 08:00:03 +08:00
Andy Green
6ab6ee2c0f more server close processing error handling precisions
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 06:39:51 +08:00
Andy Green
819d418bf2 server socket service close when detected do right thing
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 05:55:52 +08:00
Andy Green
d607bb9bfe clean more whitespace 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 05:52:09 +08:00
Andy Green
e53f2ed5e6 clean more whitespace
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-05 21:52:41 +08:00
Andy Green
f012c4423c server socket service close fix fail detect
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-05 21:52:16 +08:00
Andy Green
dd6aaa898f windows align lws_service_fd return processing with unix
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-05 09:38:50 +08:00
Andy Green
dc6e47cafc cleanups after api changes and mbed update
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 16:54:12 +08:00
Andy Green
9c9f2180f3 attack.sh update for test server changes
Currently he can survive all the tests correctly

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 12:04:59 +08:00
Andy Green
cef609df80 fix Uri Args header name
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:57:48 +08:00
Andy Green
02d60d6d21 api rationalization fix replaces in compatibility defines
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:34:49 +08:00
Andy Green
5c9660da61 clean tidy the worst whitespace alignment probs due to mass token name length changes
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:30:53 +08:00
Andy Green
4b85c1d4ac api rationalization: eliminate all libwebsocket[s]_ prefixes
This nukes all the oldstyle prefixes except in the compatibility code.

struct libwebsockets becomes struct lws too.

The api docs are updated accordingly as are the READMEs that mention
those apis.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:08:32 +08:00
Andy Green
6d41720233 api rationalization add cmake switch to export old api wrappers
This is off by default, use

 -D LWS_WITH_OLD_API_WRAPPERS=1

on cmake to get the old api names exported from the library as wrappers
around the new api names.

This allows the library to continue to be compatible with apps that are
not rebuilt with the new libwebsockets.h api compatibility defines.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 10:39:23 +08:00
Andy Green
3ef579b4f9 api rationalization eliminate oldstyle internal api names
Between changing to lws_ a few years ago and the previous two
patches migrating the public apis, there are only a few
internal functions left using libwebsocket_*.

Change those to also use lws_ without regard to compatibility
since they were never visible outside the library.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 09:23:56 +08:00
Andy Green
6230476455 api rationalization use new names internally
Change all internal uses of rationalized public apis to reflect the
new names.

Theer are a few things that got changed as side effect of search/replace
matches, but these are almost all internal.  I added a compatibility define
for the public enum that got renamed.

Theoretically existing code should not notice the difference from these
two patches.  And new code will find the new names.

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 08:43:54 +08:00
Andy Green
29a44cf2ab api rationalization: introduce public api compatibility defines
Just this is enough to be buildable and allow usage of new defines
for the public api.

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 07:55:17 +08:00
Andy Green
112f9806ac assert.h move to private header
https://github.com/warmcat/libwebsockets/issues/356

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 07:22:44 +08:00
Peter Pentchev
bb085dab04 Fix some minor typos. 2015-12-03 22:32:59 +08:00
Andy Green
972eaf91a0 ssl zero return indicates shutdown
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-03 21:37:34 +08:00
Andrew Canaday
622d9f2ff3 Handle pending SSL reads which would otherwise not trigger a POLLIN. 2015-12-03 09:45:18 +08:00
Andrew Canaday
ad2248a207 ssl set ssl to NULL on close 2015-12-03 09:44:15 +08:00
Andrejs Hanins
765914cab1 Allow zero-length pong to be received by server
Client code already allows zero-length pongs
2015-12-01 20:59:52 +08:00
Andy Green
abc8635824 osx clang blows up if pthreads flag at link time 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-29 20:17:49 +08:00
Andy Green
09b8a71b14 osx clang blows up if pthreads flag at link time
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-29 19:41:13 +08:00
Andrew Canaday
f411d8e1d8 Define 'daemonize' flag if LWS_NO_DAEMONIZE is not defined. 2015-11-29 19:32:02 +08:00
Andrew Canaday
ffe64567da C89 tweaks as per #348. 2015-11-29 19:26:01 +08:00