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

4581 commits

Author SHA1 Message Date
Andy Green
19c1a99b59 update version 1.3 soname 4
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 07:34:53 +08:00
Edwin van den Oetelaar
15a38a788f cmake some cosmetic improvementss
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-03-10 07:34:53 +08:00
Edwin van der Oetelaar
2fd02fc0b8 autotools remove INSTALL m4 COPYING
Also get rid of m4/ and COPYING, it's a copy of LGPL2.1 but without the
exceptions we added in LICENSE.

Signed-off-by: Edwin van der Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 06:43:29 +08:00
Andy Green
0097a99082 remove autotools build
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 13:06:37 +08:00
Andy Green
58f214ea0c document revent clearing scheme
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 13:03:53 +08:00
Andy Green
b1a5e6c377 clear down wsi_lookup on allocation and clear pollfd revents if serviced
This should get rid of a valgrind uninitialized report when using extpoll,
and gives a new way to share the poll loop with external sockets.

If a pollfd says it has something, you can just pass it to
libwebsocket_serice_fd() whether it is a socket handled by lws or not.
If it sees it is a lws socket, the traffic will be handled and
pollfd->revents will be zeroed now.

If the socket is foreign to lws, it leaves revents alone.  So you can see
if you should service by checking the pollfd revents after letting
lws try to service it.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 12:56:35 +08:00
Andy Green
25eddab5c8 reduce httpd close debug spew
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 12:56:35 +08:00
Andy Green
63b3b959fc cmake fix install path
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 12:56:35 +08:00
Alex Rhatushnyak
9f2246eb35 correct example lws_write in header
Signed-off-by: Alex Rhatyshnyak <a.rhatushnyak@klervi.com>
2013-03-09 12:01:47 +08:00
Andy Green
38c570c6d2 dont leak when protocol agreement probs
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 11:52:18 +08:00
Henrik Abelsson
2bdbe7a969 Fix printf format error
Signed-off-by: Henrik Abelsson <henrik@abelsson.com>
2013-03-09 09:27:49 +08:00
Andy Green
a83349414f cmake win32 change helper includes to HDR_PUBLIC so they install
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 09:16:41 +08:00
Andy Green
646c98ab42 dont sweat unkknown method for client
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 09:09:55 +08:00
Andy Green
5a4f3ae7d0 POLLOUT during wait for server response not an error
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 09:09:46 +08:00
Arokux B
47f5fa4983 fix win32helpers gettimeofday epoch
Signed-off-by: Arokux B <arokux@gmail.com>
2013-03-05 08:41:47 +08:00
Andy Green
1bc12f9e99 trace 22 fix zero length close from client
close() from javascript api in Chrome and Firefox doesn't do the
right thing.  It's because the payload is zero-length (with a frame
key...)  This fixes it.

Reported-by: 巫书轶
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-28 17:11:29 +08:00
Arokux B
897fec3a89 cmake mingw no need for websock w32
2.  Comment out this line

http://git.warmcat.com/cgi-bin/cgit/libwebsockets/tree/CMakeLists.txt#n279

the file websock-w32.c is already compiled indirectly from libwebsockets.c

Signed-off-by: Arokux B <arokux@gmail.com>
2013-02-28 09:25:02 +08:00
Andy Green
fc90f698b3 normalize formatting in gettimeofday
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-28 09:22:38 +08:00
Arokux B
e5ae9a95fb fix win32 gettimeofday for mingw
here are the problems that I found while compiling libwebsockets with
CMake using as a generator MinGW Makefiles.

1. In http://git.warmcat.com/cgi-bin/cgit/libwebsockets/plain/win32port/win32helpers/gettimeofday.c

Remove spaces around time.h, otherwise it looks for " time.h " and
fails with "No such file ..."

I also needed to comment out

struct timezone
{
  int  tz_minuteswest; /* minutes W of Greenwich */
  int  tz_dsttime;     /* type of dst correction */
};

It is already declared in mingw's time.h

Signed-off-by: Arokux B <arokux@gmail.com>
2013-02-28 09:18:38 +08:00
Andy Green
975423c949 cmake lib lib64 problem
As discussed here, there's a semi-standardized way to inform
cmake that the install target wants its libs in .../lib64

https://code.google.com/p/bullet/issues/detail?id=174

this patch adds the necessary fiddling

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-26 11:58:45 +08:00
Luc
e46043cb8c fix mime type on leaf header
Signed-off-by: Luc <luc@honk-honk.com>
2013-02-23 11:01:21 +08:00
Andy Green
fc7c5e4539 reflect send completeness in lws_write return
under load, writing packet sizes to the socket that are normally fine
can do partial writes, eg asking to write 4096 may only take 2800 of
it and return 2800 from the actual send.

Until now lws assumed that if it was safe to send, it could take any
size buffer, that's not the case under load.

This patch changes lws_write to return the amount actually taken...
that and the meaning of it becomes tricky when dealing with
compressed links, the amount taken and the amount sent differ.  Also
there is no way to recover at the moment from a protocol-encoded
frame only being partially accepted... however for http file send
content it can and does recover now.

Small frames don't have to take any care about it but large atomic
sends (> 2K) have been seen to fail under load.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-23 10:50:10 +08:00
Andy Green
2672fb2d68 move ssl cipher list from compiletime to context creation time option
More flexible this way... NULL for the new member means use
the ssl library default set of ciphers, so as long as your info
struct is zerod by bss or memset, you don't need to do anything
about this change unless you want to set the cipher list.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-22 09:54:35 +08:00
Andy Green
8699cec50f remove MAX_HEADER_NAME_LENGTH from header
Still lurking aound as a ghost after all real usess of it
were removed with the minilex changes.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-22 09:38:54 +08:00
Joakim Soderberg
c7ed2be638 Fix running test programs from within visual studio.
Copy test-server data to a path so that we can run the test-server from
within visual studio without having to copy stuff around.
2013-02-22 09:28:17 +08:00
Joakim Soderberg
b82b0dd118 Print SSL error codes as well as the string.
CYASSL doesn't compile with the error strings in some configurations, so
it is nice to have the error code on SSL errors as well.
2013-02-22 09:28:15 +08:00
Joakim Söderberg
51197c0d6f Set the _DEBUG macro for CMake also. 2013-02-22 09:28:13 +08:00
Joakim Soderberg
20aedc89c1 Fixed ssl cert generation on Windows. 2013-02-22 09:28:11 +08:00
Joakim Soderberg
b37827b651 Added CPack support + some more.
- "make dist" will now produce a tar.gz file. This includes everything (not really what we want but a start).
- Got rid of a bunch of defines and variables that aren't used.
- Added the option LINK_TESTAPPS_DYNAMIC that enables linking to the shared library version of the lib for the test apps, instead of doing it statically like the default is.
- Fixed proper support for the --prefix stuff (-DCMAKE_INSTALL_PREFIX for cmake). (Don't specify /usr/local explicitly, that is the default anyway and will break other platforms).

- Note: I noticed a problem with the "INSTALL_DATADIR" define used by the test-apps. Since we hard code the path to the certs using this, doing "DESTDIR=/bla make install" will result in not being able to use the SSL mode for the test-apps since they won't find the certs. (This also applies to the autoconf project). Fixed this by setting "../share" as the default location instead of using the prefix.
2013-02-22 09:28:08 +08:00
Joakim Soderberg
11a8cda204 BUGFIX: Fixed bug for installing test-apps for CMake.
Appending to the TEST_APP_LIST variable function did not work from within the create_test_app function (It would create a function scope variable with the same name and discard it). We instead need to use a macro for this.

The previous commit also removed the duplicate install for the test-apps (because we want all the install steps in one place in the file for clarity). That change made it obvious that the TEST_APP_LIST never gets populated.
2013-02-22 09:28:06 +08:00
Joakim Soderberg
7eadd586b1 Fixed CMake compile options.
Fixed so that the build options for the CMake project works:

- The test apps used the LWS_NO_EXTENSIONS define, so they needed lws_config.h included when building using CMake.
- Rename some options so that individual test apps can be turned off.
- Separate building the test-client/test-server and compiling the server/client parts into the lib.
- Don't include server or client specific sources into the build if they shouldn't be built.
- Added an error if both client and server parts are excluded at the same time (makes no sense).
- Removed duplicate install targets for the test apps.
- Commented out the WITH_LIBCRYPTO option since it isn't used at the moment.
2013-02-22 09:28:04 +08:00
Joakim Soderberg
fcec61c576 getifaddrs missing more user friendly in CMake.
Don't require the user to enable using the built-in BSD getifaddrs implementation on systems such as uclibc that lacks it manually.

Instead if getifaddrs doesn't exist, use the BSD one automatically, except if the user explicitly tells the user not to do this using WITHOUT_BUILTIN_GETIFADDRS (which will result in a compilation error, but at least with a nice error message explaining why).
2013-02-22 09:28:02 +08:00
Joakim Soderberg
3baa08cac3 Fix LWS_NO_SERVER build.
"int n" was used also when server parts are not compiled, so don't put it inside the LWS_NO_SERVER ifdef.
2013-02-22 09:27:59 +08:00
Joakim Soderberg
fe2dae759d Bugfix compiling for cross compiling.
! does not mean NOT, use NOT instead :)
2013-02-22 09:27:57 +08:00
Larry Hayes
bb66ac6ec1 keepalive swap interval and probes
The interval and probes members for setting keepalive options
per-connection on Linux were swapped.

Signed-off-by: Larry Hayes <lhayesg@gmail.com>
2013-02-22 09:16:20 +08:00
Edwin van den Oetelaar
8c8a8e149d provide socketfd at in param for LWS_CALLBACK_FILTER_NETWORK_CONNECTION
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-20 20:56:59 +08:00
Andy Green
1c6e1422e6 trac 18 deal with service connection timing out
While looking at http://libwebsockets.org/trac/ticket/18
noticed the flow for timeout in service_fd will do bad things
if the fd we came to service has timed out.  It gets freed and
then "serviced'.

Reported-by: Joakim Soderberg <joakim.soderberg@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-20 19:11:31 +08:00
Edwin van den Oetelaar
d75076eaea cmake fix for older cmake
AG this wasn't needed on cmake 2.8.10.2 but did not make any
problem either

Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-02-20 02:08:51 +08:00
Andy Green
0c2f4d865a update missed extpoll calls to use correct args for ssl
http://libwebsockets.org/trac/ticket/15#comment:16

Reported-by: Joakim Soderberg <joakim.soderberg@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-19 19:19:51 +08:00
Andy Green
799ecbf773 cmake docs add note about prefix
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-19 10:26:39 +08:00
Joakim Söderberg
455e45150a Create the "doc" dir before generating docs.
The documentation wouldn't be generated if the path didn't exist.
2013-02-19 10:14:54 +08:00
Joakim Söderberg
6ac9709790 Added "make install" support to the CMake project.
- Does everything as the autoconf script does (I think).
- Generates SSL certs for the test-server
- Installs all test apps.
- Defaults to /usr/local/
- "DESTDIR=/bla make install" works
- Append "libwebsockets" to start of the test-app names like the autoconf stuff does.
- Only tested on OSX so far...
2013-02-19 10:14:37 +08:00
Andy Green
c6511a08b4 trac 17 update set_log_level api notice
http://libwebsockets.org/trac/ticket/17

Reported-by: dbrnz
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-19 10:01:48 +08:00
Edwin van den Oetelaar
d6bf73c224 move cms cmake addition to cmake module paths earlier
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-02-18 20:20:05 +08:00
Andy Green
d169bb7de9 add FindGit.cmake
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-18 18:34:10 +08:00
Andy Green
dc914cfebb document ensure_user_space going private
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-18 16:54:26 +08:00
Andy Green
2af4d5b2e2 remove lws_ensure_user_space from public api change return
The function has a logical problem when the size of the requested
allocation is 0, it will return NULL which is overloaded as
failure.

Actually the whole function is evil as an api, this patch moves
it out of the public API space and fixes it to return 0 for
success or 1 for fail.  Private code does not need to to return
wsi->user_space and public code should only get that from the
callback as discussed on trac recently.

Thanks to Edwin for debugging the problem.

Reported-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-18 16:30:10 +08:00
Andy Green
cb8febdda2 update arm build stats
Clean out the historical numbers, update info

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-18 12:08:15 +08:00
Andy Green
8dac94da67 trim proxy ads plus hostname stg
128 should be fine for hostname and proxy ads

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-18 12:02:18 +08:00
Andy Green
73a820a989 restrict http send buffer to 4096
send() is able to complete but not send everything asked...
we don't deal with that yet.  On an ARM9 board, leaf.jpg
failed because the send() only accepted 7240 of 8192... not
a failure but it implies reporting partial send to the
caller.  Work around by keeping the send buffer at 4096.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-18 11:32:49 +08:00