remove lws_ensure_user_space from public api change return 22/3122/1
authorAndy Green <andy.green@linaro.org>
Mon, 18 Feb 2013 08:30:10 +0000 (16:30 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:37 +0000 (13:01 -0800)
commit3ef5491212322199d4ae983ed2a9360dde8949b9
treea052256d1f167d254cfb39446791c0a3cd37ca0a
parent5322780c934c98b48d9968f8111c94bf5d351eb9
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>
lib/client.c
lib/handshake.c
lib/libwebsockets.c
lib/libwebsockets.h
lib/private-libwebsockets.h
lib/server-handshake.c
libwebsockets-api-doc.html