[Libwebsockets] Very minor bugs(?) in protocol_post_demo.c

Colin Adams colinpauladams at gmail.com
Sat May 21 09:08:23 CEST 2016


First the header line:

ws protocol handler plugin for "dumb increment"

s/dumb increment/post demo/

I wouldn't have nothered reporting that if I wasn't also going to mention
this code:

case LWS_CALLBACK_HTTP:
lwsl_debug("LWS_CALLBACK_HTTP\n");
if (lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI))
return 0;
break;

This appears to me to be a big no-op (modulo debugging message), as:

Should the conditional evaluate to true, then we return 0. Otherwise we
fall out of the switch and return 0. So the whole thing is equivalent to
the default case.

Or does lws_hdr_total_length have necessary side effects?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20160521/01532ee7/attachment.html>


More information about the Libwebsockets mailing list