From: Andy Green Date: Fri, 13 May 2016 02:31:52 +0000 (+0800) Subject: dummy http protocol should always do 404 X-Git-Tag: accepted/tizen/4.0/unified/20171012.191640~464 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9c095db47de22f83fce2cda551823b2fbc217db;p=platform%2Fupstream%2Flibwebsockets.git dummy http protocol should always do 404 We only got here if no mount matched, so we should affirmitively send a 404 Signed-off-by: Andy Green --- diff --git a/lib/context.c b/lib/context.c index 6a25e27..0b34ee1 100644 --- a/lib/context.c +++ b/lib/context.c @@ -191,6 +191,9 @@ callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, switch (reason) { case LWS_CALLBACK_HTTP: #ifndef LWS_NO_SERVER + if (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL)) + return -1; + if (lws_http_transaction_completed(wsi)) #endif return -1; @@ -206,6 +209,7 @@ callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, break; } #endif + break; #ifdef LWS_WITH_CGI @@ -268,7 +272,7 @@ static const struct lws_protocols protocols_dummy[] = { "http-only", /* name */ callback_http_dummy, /* callback */ 0, /* per_session_data_size */ - 0, /* max frame size / rx buffer */ + 4096, /* max frame size / rx buffer */ }, /* * the other protocols are provided by lws plugins