dummy http protocol should always do 404
authorAndy Green <andy@warmcat.com>
Fri, 13 May 2016 02:31:52 +0000 (10:31 +0800)
committerAndy Green <andy@warmcat.com>
Fri, 13 May 2016 02:31:52 +0000 (10:31 +0800)
We only got here if no mount matched, so we should
affirmitively send a 404

Signed-off-by: Andy Green <andy@warmcat.com>
lib/context.c

index 6a25e27..0b34ee1 100644 (file)
@@ -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