HTTPD_ERR_RET(req, 404, http_fin_err_req(con, req));
HTTPD_ERR_MSG_RET(req, 404, xmsg, http_fin_err_req(con, req));
static int http_req_chk_file(struct Con *con, Httpd_req_data *req){  Vstr_base *fname = req->fname;  size_t len = 0;    /* fname == what was just passed to open() */  ASSERT(fname->len);  if (!req->policy->use_friendly_dirs)    HTTPD_ERR_RET(req, 404, http_fin_err_req(con, req));  else if (!req->conf_friendly_dirs)  { /* check if file exists before redirecting without leaking info. */    const char *fname_cstr = NULL;    struct stat64 d_stat[1];    len = vstr_cspn_cstr_chrs_rev(fname, 1, fname->len, "/") + 1;    /* must be a filename, can't be toplevel */    if ((len <= 1) || (len >= (fname->len - req->vhost_prefix_len)))      HTTPD_ERR_RET(req, 404, http_fin_err_req(con, req));    vstr_sc_reduce(fname, 1, fname->len, len);        fname_cstr = vstr_export_cstr_ptr(fname, 1, fname->len);    if (fname->conf->malloc_bad)      return (http_fin_errmem_req(con, req));        if ((stat64(fname_cstr, d_stat) == -1) && !S_ISREG(d_stat->st_mode))      HTTPD_ERR_RET(req, 404, http_fin_err_req(con, req));  }    vstr_sub_cstr_ptr(fname, 1, fname->len, "./");  httpd_req_absolute_uri(con, req, fname, 1, fname->len);  assert(VSUFFIX(fname, 1, fname->len, "/"));  vstr_sc_reduce(fname, 1, fname->len, strlen("/"));  HTTPD_ERR_301(req);    if (fname->conf->malloc_bad)    return (http_fin_errmem_req(con, req));    return (http_fin_err_req(con, req));}