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

559 commits

Author SHA1 Message Date
Andy Green
81bbae0375 remove one more mention of broadcast callback
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-01 11:17:02 +08:00
Andy Green
7b40545e92 introduce library version plus git hash
This exposes the library version and git head hash it was built from
into LWS_LIBRARY_VERSION and LWS_BUILD_HASH.

These are combined into a version string that's both printed as a
notice log by the library and made available to the app using a new
api lws_get_library_version().  The version looks like

 1.1 178d78c

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-01 10:50:15 +08:00
Andy Green
2d7acec9b2 remove stray reference to max broadcast size from readme.build
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-01 08:48:41 +08:00
Andy Green
36eb70d7a9 additional casts allow test server build as cpp
With these explicit casts that are not needed in C, it's possible to build
the test server using g++ like this, after building and installing the
library.

g++ -DINSTALL_DATADIR=\"/usr/share\" -ocpptest test.cpp -lwebsockets

Add a small documentation to README.coding

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-01 08:42:15 +08:00
Andy Green
bd1132f9ac update changelog tag chrome 26 firefox 18
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-31 19:53:05 +08:00
Andy Green
c51823a418 renovate test html
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-31 19:50:57 +08:00
Andy Green
a35c86f115 add changelog v1.0 to v1.1
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-31 11:01:39 +08:00
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
769153ec5d introduce test echo
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 12:28:44 +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
3b228c5470 fix docs about protocol version supported
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 08:31:43 +08:00
Andy Green
08f2c017e8 test server terminate cleanly on ctrl c
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-30 08:02:26 +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
ab40eaa8db update numbers for minimal build footprint
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 13:20:33 +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
5c54d622ff use correct LWS_NO_DAEMONIZE on test server
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-21 12:58:04 +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
Edwin van den Oetelaar
596b220c40 align test server extpoll with library dynamic approach
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-01-20 20:51:14 +08:00
Andy Green
5c81e804fa document memory efficiency
This puts some numbers of library size with the various --without
and --disable options and about dynamic memory allocation
performance

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-20 20:24:30 +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
Andy Green
6c1f64e992 refactor README
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-20 11:28:06 +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