create user alloc for http if requested 04/3104/1
authorAndy Green <andy.green@linaro.org>
Thu, 14 Feb 2013 15:18:10 +0000 (23:18 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:36 +0000 (13:01 -0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/handshake.c
libwebsockets-api-doc.html

index 0c2cecf..74e67cd 100644 (file)
@@ -118,6 +118,13 @@ libwebsocket_read(struct libwebsocket_context *context,
 
                        lwsl_info("HTTP request for '%s'\n", lws_hdr_simple_ptr(wsi, WSI_TOKEN_GET_URI));
 
+                       if (libwebsocket_ensure_user_space(wsi) == NULL) {
+                               /* drop the header info */
+                               if (wsi->u.hdr.ah)
+                                       free(wsi->u.hdr.ah);
+                               goto bail;
+                       }
+
                        wsi->state = WSI_STATE_HTTP;
                        n = 0;
                        if (wsi->protocol->callback)
index 17d9e5b..b041e74 100644 (file)
@@ -611,6 +611,11 @@ That's important because it uses a slot in the
 total number of client connections allowed set
 by MAX_CLIENTS.
 </blockquote>
+<h3>LWS_CALLBACK_HTTP_WRITEABLE</h3>
+<blockquote>
+you can write more down the http protocol
+link now.
+</blockquote>
 <h3>LWS_CALLBACK_HTTP_FILE_COMPLETION</h3>
 <blockquote>
 a file requested to be send down