1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

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 <andy@warmcat.com>
This commit is contained in:
Andy Green 2016-05-13 10:31:52 +08:00
parent 97164368dd
commit b9c095db47

View file

@ -191,6 +191,9 @@ callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
switch (reason) { switch (reason) {
case LWS_CALLBACK_HTTP: case LWS_CALLBACK_HTTP:
#ifndef LWS_NO_SERVER #ifndef LWS_NO_SERVER
if (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL))
return -1;
if (lws_http_transaction_completed(wsi)) if (lws_http_transaction_completed(wsi))
#endif #endif
return -1; return -1;
@ -206,6 +209,7 @@ callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
break; break;
} }
#endif #endif
break; break;
#ifdef LWS_WITH_CGI #ifdef LWS_WITH_CGI
@ -268,7 +272,7 @@ static const struct lws_protocols protocols_dummy[] = {
"http-only", /* name */ "http-only", /* name */
callback_http_dummy, /* callback */ callback_http_dummy, /* callback */
0, /* per_session_data_size */ 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 * the other protocols are provided by lws plugins