canonical libwebsockets.org websocket library
Find a file
Andrew Canaday afe26cf4a6 HTTP Version, Keep-alive support, No-copy POST
This is a squashed commit from https://github.com/andrew-canaday/libwebsockets,
dev/http_keepalive branch (strategies changed a few times, so the commit
history is clutteread). This branch is submitted for clarity, but the other
can be used as a reference or alternative.

 * added **enum http_version** to track HTTP/1.0 vs HTTP/1.1 requests
 * added **enum http_connection_type** to track keep-alive vs close
 * replaced content_length_seen and body_index with **content_remain**
 * removed **post_buffer** (see handshake.c modifications)

 * removed post_buffer free

 * switch state to WSI_TOKEN_SKIPPING after URI is complete to store version
 * delete *spill* label (unused)

 * add vars to track HTTP version and connection type
 * HTTP version defaults to 1.0
 * connection type defaults to 'close' for 1.0, keep-alive for 1.1
 * additional checks in **cleanup:** label:
   * if HTTP version string is present and valid, set enum val appropriately
   * override connection default with the "Connection:" header, if present
 * set state to WSI_STATE_HTTP_BODY if content_length > 0
 * return 0 on HTTP requests, unless LWS_CALLBACK_HTTP indicates otherwise

 * add vars to track remaining content_length and body chunk size
 * re-arrange switch case order to facilitate creation of jump-table
 * added new labels:
   * **read_ok**: normal location reach on break from switch; just return 0
   * **http_complete**: check for keep-alive + init state, mode, hdr table
   * **http_new**: jump location for keep-alive when http_complete sees len>0
 * after libwebsocket_parse, jump to one of those labels based on state
 * POST body handling:
   * don't bother iterating over input byte-by-byte or using memcpy
   * just pass the relevant portion of the context->service_buffer to callback
2014-07-14 20:19:43 +08:00
cmake add missing CMake pieces 2014-02-16 01:52:50 +08:00
lib HTTP Version, Keep-alive support, No-copy POST 2014-07-14 20:19:43 +08:00
scripts add CMake find function for libwebsockets 2013-06-29 10:18:52 +08:00
test-server test server dumb increment fix once per second duplicate 2014-07-06 09:36:44 +08:00
win32port Remove websock-w32.h 2014-03-29 08:25:58 +01:00
.gitignore cmake and other fixes 2014-02-15 13:48:56 +08:00
Android.mk android include gregorys example makefile 2013-03-10 07:34:53 +08:00
changelog update changelog for 1.3 2014-07-06 09:56:11 +08:00
CMakeLists.txt Turn off IPv6 in windows for now 2014-04-28 07:32:14 +08:00
config.h.cmake Fix include statement of in6addr.h 2014-04-15 18:38:54 +02:00
cross-arm-linux-gnueabihf.cmake cmake improve cross documentation 2013-03-30 10:30:03 +08:00
cross-ming.cmake Trac 53 minw update 2013-12-18 10:17:25 +08:00
cross-openwrt-makefile openwrt: add cyassl options, update to LWS_ cmake syntax 2014-03-07 08:29:07 +08:00
libwebsockets-api-doc.html introduce api for unthrottle all connections of protocol 2013-03-16 12:43:22 +08:00
libwebsockets.spec cmake update specfile 2013-03-10 08:12:12 +08:00
LICENSE add static linking exception to LICENSE 2013-02-07 23:44:21 +08:00
README add README 2013-02-06 16:07:27 +09:00
README.build refactor add ssl read write single implementation 2014-04-06 06:26:35 +01:00
README.coding truncated send always callback on writeable 2014-04-10 11:23:18 +08:00
README.test-apps introduce test echo 2013-01-30 12:28:44 +08:00

This is the libwebsockets C library for lightweight websocket clients and
servers.  For support, visit

 http://libwebsockets.org

and consider joining the project mailing list at

 http://ml.libwebsockets.org/mailman/listinfo/libwebsockets

You can get the latest version of the library from git

http://git.libwebsockets.org
https://github.com/warmcat/libwebsockets

for more information:

README.build      - information on building the library
README.coding     - information for writing code using the library
README.test-apps  - information about the test apps built with the library