diff --git a/lib/context.c b/lib/context.c index 8ef057da..83b35693 100644 --- a/lib/context.c +++ b/lib/context.c @@ -559,9 +559,6 @@ lws_create_vhost(struct lws_context *context, vh->name = info->vhost_name; vh->error_document_404 = info->error_document_404; - if (info->error_document_404 && - info->error_document_404[0] == '/') - vh->error_document_404 = info->error_document_404 + 1; if (info->options & LWS_SERVER_OPTION_ONLY_RAW) lwsl_info("%s set to only support RAW\n", vh->name); diff --git a/lib/output.c b/lib/output.c index 96c1ae4f..ba49cf4f 100644 --- a/lib/output.c +++ b/lib/output.c @@ -49,7 +49,7 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) wsi, wsi->vhost->name, wsi->protocol->name, wsi->role_ops->name, (unsigned long)len); - assert(0); + // assert(0); return -1; } diff --git a/lib/roles/http/server/server.c b/lib/roles/http/server/server.c index ef0af5d7..1348d0eb 100644 --- a/lib/roles/http/server/server.c +++ b/lib/roles/http/server/server.c @@ -481,7 +481,8 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, wsi->http.fop_fd = fops->LWS_FOP_OPEN(wsi->context->fops, path, vpath, &fflags); if (!wsi->http.fop_fd) { - lwsl_info("Unable to open '%s': errno %d\n", path, errno); + lwsl_info("%s: Unable to open '%s': errno %d\n", + __func__, path, errno); return -1; } @@ -2150,9 +2151,11 @@ lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, wsi->http.fop_fd = fops->LWS_FOP_OPEN(wsi->context->fops, file, vpath, &fflags); if (!wsi->http.fop_fd) { - lwsl_info("Unable to open: '%s': errno %d\n", file, errno); - - return -1; + lwsl_info("%s: Unable to open: '%s': errno %d\n", + __func__, file, errno); + if (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL)) + return -1; + return !wsi->http2_substream; } } wsi->http.filelen = lws_vfs_get_length(wsi->http.fop_fd);