Router is returning incorrect files from http get
Bug in http-libwebsockets code. A partial HTTP handler such as we have needs to
call lws_callback_http_dummy() to fill in default HTTP behaviours. Without that
the LWS library was not properly informed of termination of HTTP transactions
causing confusion if a connection was re-used.
@@ -340,20 +340,14 @@ static int callback_http(struct lws *wsi, enum lws_callback_reasons reason,
void *user, void *in, size_t len)
{
switch (reason) {
-
case LWS_CALLBACK_PROTOCOL_DESTROY:
qd_http_listener_free(wsi_listener(wsi));
- return -1;
-
- case LWS_CALLBACK_HTTP: {
- /* Called if file mount can't find the file */
- lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, (char*)in);
- return -1;
- }
-
+ break;
default:
- return 0;
+ break;
}
+ /* Do default HTTP handling for all the cases we don't care about. */
+ return lws_callback_http_dummy(wsi, reason, user, in, len);
}
/* Wake up a connection managed by the http server thread */
