404 processing
This commit is contained in:
parent
65f87efca9
commit
8d79eaf124
3 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue