Commit graph

1193 commits

Author SHA1 Message Date
Andy Green
f27034201f account for context in static allocation figure
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-08 13:11:50 +08:00
Andy Green
9b09dc0213 remove all PATH_MAX or MAX_PATH
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-08 13:11:47 +08:00
Andy Green
e84652c4ea use context service buf in place of large stack arrays
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-08 13:01:02 +08:00
Andy Green
b8b247d3e1 remove need for filepath buffer on http file serve
This gets rid of the stack buffer while serving files, and the
PATH_MAX char array that used to hold the filepath in the wsi.

It holds an extra file descriptor open while serving the file,
however it attempts to stuff the socket with as much of the
file as it can take.  For files of a few KB, that typically
completes (without blocking) in the call to
libwebsockets_serve_http_file() and then closes the file
descriptor before returning.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-08 12:19:01 +08:00
Andy Green
c11b587aed add static linking exception to LICENSE
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 23:44:21 +08:00
Andy Green
750200121e add unchanged lgpl 2.1 in LICENSE
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 23:43:56 +08:00
Peter Pentchev
3b233cbc24 Fix memory leaks when creating a context. 2013-02-07 23:36:52 +08:00
Peter Pentchev
4d46cb5a3f Generate the API reference in text format, too. 2013-02-07 23:36:37 +08:00
Peter Pentchev
c74964ec44 Fix two typos. 2013-02-07 23:23:10 +08:00
Andy Green
ed334463e8 changelog header lifecycle
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 21:14:33 +08:00
Andy Green
23c5f2ecd0 add autotools bits for cyassl
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:30:56 +08:00
Andy Green
68a672bb44 unionize header token array
This reduces the size of struct libwebscocket from 4840 to 4552
on x86_64

There are also big benefits on malloc pool fragmentation and
allocation, the header allocations only exist between the first
peer communication and websocket connection establishment for
both server and client.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:30:56 +08:00
Andy Green
a2b3a36e44 document header lifecycle change
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:30:56 +08:00
Andy Green
2b57a34677 headers deleted after websocket established
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:30:56 +08:00
Andy Green
e4dffc99df leverage TOKEN_SKIPPING better in parser
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:30:56 +08:00
Andy Green
177ca78921 simplify parsing complete
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:30:56 +08:00
Andy Green
3455e676d8 act on fatal parse problems
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:30:56 +08:00
Andy Green
c5dc32ab48 remove deprecated vcxproj
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:25:28 +08:00
Andy Green
df60b0c089 update changelog about cmake
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-07 20:25:28 +08:00
Joakim Soderberg
7df9908148 Added build instructions for CMake.
Also changed it so that specifying the include directories for CyaSSL is nicer.
2013-02-07 20:24:19 +08:00
Andy Green
039ce8fc7f add README
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-06 16:07:27 +09:00
Joakim Soderberg
f57751f92b Fixed compilation on NetBSD. 2013-02-06 15:49:13 +09:00
Joakim Söderberg
cb4156d437 Cleaned up the CyaSSL linking in the CMake project a bit.
Separated the CyaSSL linking and OpenSSL linking for more clearity.
Now tested on both OSX and Windows as well.
2013-02-06 15:49:13 +09:00
Joakim Soderberg
91de93391c Fixed windows build.
- Fixed the original visual studio project so that inline gets defined.
- Fix error in CMake with zlib.
2013-02-06 15:49:13 +09:00
Joakim Soderberg
e9a42119f6 Added some minor changes to CMake build file.
- Added options for compiling without server/client parts.
- Fixed a syntax error on printing an error on CyaSSL compilation.
- Don't compile server-extpoll either when the server isn't compiled.
2013-02-06 15:49:12 +09:00
Joakim Soderberg
b378ce9d18 Added support for CyaSSL replacement of OpenSSL.
http://www.yassl.com/yaSSL/Products-cyassl.html
- Small Size: 20-100kB
- Runtime Memory:  1-36kB
- 20X smaller than OpenSSL

So far only tested on Linux.

Note that this requires a bugfix in cyassl, otherwise it will crash. Pull request has been made to the official repos, in the meantime the following repos can be used: git://github.com/JoakimSoderberg/cyassl.git
2013-02-06 15:49:12 +09:00
Joakim Soderberg
4f4a38bae0 Added check for inline keyword availability.
Both to CMake project and Autoconf. inline will be defined to whatever inline replacement exists on the system, such as __inline or __inline__
2013-02-06 15:49:12 +09:00
Joakim Söderberg
68e8d730b8 Fixed build on OSX.
- For some reason the "extern int pid_daemon" usage in libwebsockets.c would cause an "undefined symbols" linker error for the test-apps. This only happens with the CMake project, not the normal Makefiles. I have no clue why this is. Fixed it by getting the pid via a function instead.

- Added test-server-extpoll

- Renamed the library from libwebsocket -> libwebsockets
2013-02-06 15:49:12 +09:00
Joakim Soderberg
d2edfec5fa Fixed linux compilation and added more compile options.
- Tested and works on Linux now also, including SSL support.
- Look for ZLIB not zlib.
- Added CMake options for setting all LWS_ defines.
2013-02-06 15:49:12 +09:00
Joakim Soderberg
4c53123677 CMake support + fixed windows build.
- Finalized CMake support (tested on windows only so far).
  - Uses a generated lws_config.h that is included in
  private-libwebsocket to pass defines, only used if CMAKE_BUILD is set.
  - Support for SSL on Windows.
  - Initial support for CyaSSL replacement of OpenSSL (This has been added
    to my older CMake-fork but haven't been tested on this version yet).
- Fixed windows build (see below for details).
- Fixed at least the 32-bit Debug build for the existing Visual Studio
  Project. (Not to keen fixing all the others when we have CMake support
  anyway (which can generate much better project files)...)
- BUGFIXES:
  - handshake.c
    - used C99 definition of handshake_0405 function
  - libwebsocket.c
    - syslog not available on windows, put in ifdefs.
    - Fixed previous known crash bug on Windows where WSAPoll in
      Ws2_32.dll would not be present, causing the poll function pointer
      being set to NULL.
    - Uninitialized variable context->listen_service_extraseen would
      result in stack overflow because of infinite recursion. Fixed by
      initializing in libwebsocket_create_context
    - SO_REUSADDR means something different on Windows compared to Unix.
    - Setting a socket to nonblocking is done differently on Windows.
      (This should probably broken out into a helper function instead)
    - lwsl_emit_syslog -> lwsl_emit_stderr on Windows.
  - private-libwebsocket.h
    - PATH_MAX is not available on Windows, define as MAX_PATH
    - Always define LWS_NO_DAEMONIZE on windows.
    - Don't define lws_latency as inline that does nothing. inline is not
      support by the Microsoft compiler, replaced with an empty define
      instead. (It's __inline in MSVC)
  - server.c
    - Fixed nonblock call on windows
  - test-ping.c
    - Don't use C99 features (Microsoft compiler does not support it).
    - Move non-win32 headers into ifdefs.
    - Skip use of sighandler on Windows.
  - test-server.c
    - ifdef syslog parts on Windows.
2013-02-06 15:49:12 +09:00
Joakim Soderberg
add3926b17 Some more Cmake stuff. 2013-02-06 15:49:12 +09:00
Joakim Soderberg
08e434eb66 Started redoing CMake support based on the up to date repos 2013-02-06 15:49:12 +09:00
Andy Green
0d49c8d1a0 improve test server poll loop docs
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-02 23:02:56 +08:00
Andy Green
a2156aa863 add note about MIPS opewrt configure options
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-02 18:10:29 +08:00
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