1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

353 commits

Author SHA1 Message Date
Andy Green
2da89dccb0 bump version to 1.1 and soname to 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-31 11:01:38 +08:00
Andy Green
98feb4be18 clean out remaining mentions of deprecated broadcast
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-31 11:01:35 +08:00
Andy Green
d09d7d45f8 get error from getnameinfo if unable to improve hostname and use hostname
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-31 10:05:43 +08:00
Andy Green
cbb3122ab4 fixes for without server and without client
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-31 09:57:05 +08:00
Jack Mitchell
daed4fbd54 fix unused var if no enable openssl
Signed-off-by: Jack Mitchell <ml@communistcode.co.uk>
2013-01-30 18:53:36 +08:00
Andy Green
467c7ef552 add info about why we close to more places
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 12:28:34 +08:00
Andy Green
96d882a9d8 roubustness handle problems in read loop better
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 12:27:27 +08:00
Andy Green
5fc75a9b6b server allow NULL protocol map to protocol 0
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 12:26:14 +08:00
Andy Green
aaf0b9f514 change get_peer_addresses to use context wsi latency
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 08:49:13 +08:00
Andy Green
e000a709b3 instrument latency
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 08:49:12 +08:00
Andy Green
d636e35c2b introduce lws_latency
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 08:32:15 +08:00
Andy Green
6f520a5195 evict all broadcast support
Libwebsockets is fundamentally singlethreaded... the existence of the
fork and broadcast support, especially in the sample server is
giving the wrong idea about how to use it.

This replaces broadcast in the sample server with
libwebsocket_callback_on_writable_all_protocol().  The whole idea of
'broadcast' is removed.

All of the broadcast proxy stuff is removed: data must now be sent
from the callback only.  Doing othherwise is not reliable since the
service loop may close the socket and free the wsi at any time,
invalidating a wsi pointer held by another thread (don't do that!)

Likewise the confirm_legit_wsi api added recently does not help the
other thread case, since if the wsi has been freed dereferencing the
wsi to study if it is legit or not will segfault in that case.  So
this is removed too.

The overall effect is to push user code to only operate inside the
protocol callbacks or external poll loops, ie, single thread context.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-29 22:13:55 +08:00
Matthieu Riviere
5e1b7fff3a FreeBSD compatibility
Seems we just need to take care about __FreeBSD__ along with
__APPLE__ in a couple of places.

Signed-off-by: Matthieu Riviere <matthieu.riviere@leukensis.org>
2013-01-29 06:57:21 +08:00
Andy Green
ea0642abb2 trac 6 expose libwebsockets read with note about not normally needed
Comes in handy if the original application poll loop is the boss,
in this case libwebsockets is optional and can't be the boss poll
loop

Requested-by: ajandhyala@wms.com
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-29 06:52:00 +08:00
Edwin van den Oetelaar
0794af94eb fix ssl bits outside of ifdef coverage
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-01-28 21:53:53 +08:00
Andy Green
c4d05a5fa2 force client ssl bio nonblocking
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-28 17:49:55 +08:00
Andy Green
1167dd4a6e force ssl rw bios nonblocking
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-28 17:49:52 +08:00
Andy Green
ba85a7dbbd timeout coverage for ssl accept
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-28 17:49:51 +08:00
Andy Green
e21607136c break up ssl accept action
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-28 12:19:10 +08:00
Andy Green
6f047eea6c ensure accept is nonblocking
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-28 11:23:52 +08:00
Andy Green
52f28ce67a autocreate foreign broadcast sockets on broadcast
Also introduce libwebsockets_broadcast_foreign() separate from libwebsockets_broadcast()

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-25 17:52:16 +08:00
Andy Green
fefc6585db trac 5 sa_restorer deprecated
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-23 08:32:03 +08:00
Andy Green
d88146da6a trac 3 document write and context_user
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-22 23:09:01 +08:00
Andy Green
75006171d7 trac 4 correct libebsocket_service_fd
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-22 12:32:11 +08:00
Andy Green
35f332bb46 more LWS_NO_DAEMONIZE
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 13:06:38 +08:00
Andy Green
bdd6bf3ccd bind gcc debug generation to_DEBUG
Either generate debug sections in output or optimize aggressively,
controlled by the existing --disable-debug

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 12:19:30 +08:00
Andy Green
623a98dab0 unionize mutually exclusive wsi members
Large chunks of struct libwebsocket members actually have a mutually
exclusive lifecycle, eg, once the http headers are finished they sit
there unused until the instance is destroyed.

This makes a big improvement in memory efficiency by making four
categories of member: always needed, needed for header processing,
needed for http processing, and needed for ws processing.  The last
three are mutually exclusive and bound into a union inside the wsi.

Care needs taking now at "union transitions", although we zeroed down
the struct at init, the other union siblings have been writing the
same memory by the time later member siblings start to use it.  So
it must be cleared down appropriately when we cross from one
mutually-exclusive use to another.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 11:06:34 +08:00
Andy Green
80f168b4ee key_b64 doesnt need to be in wsi
It's only used in some client code and never seen again

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 11:04:49 +08:00
Andy Green
f862463e2e avoid PATH_MAX in bss in daemonize
PATH_MAX is typically 4KB, let's malloc space for the
actual path instead and just have the pointer in bss

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 10:36:12 +08:00
Andy Green
5738c0e838 remove all support for pre v13 protocols
Since v13 was defined as the released ietf version the older versions
are deprecated.  This patch strips out everything to do with the older
versions and gets rid of the option to send stuff unmasked.

The in-tree md5 implementation is then also deleted as nothing needs
it any more, 1280 loc are shed in all

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 09:53:35 +08:00
Andy Green
f5bc1306ef disable private broadcast sockets if enable no fork config option
The whole thing about count_protocols + 1 broadcast sockets and
associated dummy wsis is a workaround for getting a broadcast from
a different process context, if we are running with --enable-no-fork
then we don't need any of it in.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 09:09:52 +08:00
Andy Green
a17c692cd3 log major dynamic allocation info
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-20 20:21:54 +08:00
Andy Green
13ba5bbc63 zlib not needed if no extensions
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-20 18:26:20 +08:00
Andy Green
3182ece3a4 introduce without extensions
The new --without-extensions config flag completely removes all code
and data related to extensions from the build throughout the library
when given.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-20 17:08:31 +08:00
Edwin van den Oetelaar
f6eeabc749 syslog requires format string
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-01-19 20:01:01 +08:00
Andy Green
24cba92c7e make use of lock file
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 14:39:24 +08:00
FNA
0bf3ef605d windows compatibility changes for private libwebsockets
Signed-off-by: FNA <aqiruse@gmail.com>
2013-01-19 13:58:06 +08:00
Andy Green
fd6764a1fb test server add daemonization flag
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 13:13:48 +08:00
Andy Green
058ba81017 test server use syslog logging
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 13:11:26 +08:00
Andy Green
69e436444e allow_use_of_lwsl_logging in user code
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 13:11:24 +08:00
Andy Green
c11db201cf helper api: log through syslog
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 13:11:10 +08:00
Andy Green
b3a614add9 logging select some lwsl_info usage to be lwsl_notice
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 13:08:17 +08:00
Andy Green
7c19c34f9a add lwsl_notice
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 12:18:07 +08:00
Andy Green
0b31909cce expose log level in emit
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 11:53:45 +08:00
Andy Green
3662b663bc change bitfield setting to avoid gcc warnings
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 11:53:41 +08:00
Andy Green
10601c1fba improve frame_is_binary setting
Gregory Junker <ggjunker@gmail.com> noticed the binary flag is not
getting set right, or at all on client side.  This should improve
matters.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-19 10:39:35 +08:00
Andy Green
acbaee649a add lws_confirm_legit_wsi
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-18 22:00:22 +08:00
Andy Green
a1ce6be947 refactor and introduce without server configure option
Move server-only stuff into their own files and make building
that depend on not having --without-server on the configure

Make fragments in other places conditional as well

Remove client-related members from struct libwebscket when
building LWS_NO_CLIENT

Apps:

normal: build test server, client, fraggle, ping
--without-client: build test server
--without-server: build test client, ping

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-18 11:43:21 +08:00
Andy Green
2fd3f2f78f introdice tracking if frame is binary
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-18 09:49:20 +08:00
Edwin van den Oetelaar
759c9ac465 different compiler warning fixes
Solve some unchecked return codes in the new daemonization file

AG adapted a bit

Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-18 09:20:54 +08:00