create user alloc for http if requested
Signed-off-by: Andy Green <andy.green@linaro.org>
diff --git a/lib/handshake.c b/lib/handshake.c
index 0c2cecf..74e67cd 100644
--- a/lib/handshake.c
+++ b/lib/handshake.c
@@ -118,6 +118,13 @@
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)
diff --git a/libwebsockets-api-doc.html b/libwebsockets-api-doc.html
index 17d9e5b..b041e74 100644
--- a/libwebsockets-api-doc.html
+++ b/libwebsockets-api-doc.html
@@ -611,6 +611,11 @@
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