1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

http server: allow serving files with special unicode path

This commit is contained in:
xionghui 2021-09-09 22:14:07 +08:00 committed by Andy Green
parent cced56b2ad
commit 365328c4d3

View file

@ -720,9 +720,13 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin,
}
#else
#if defined(LWS_HAVE__STAT32I64)
if (_stat32i64(path, &st)) {
lwsl_info("unable to stat %s\n", path);
goto notfound;
{
WCHAR buf[MAX_PATH];
MultiByteToWideChar(CP_UTF8, 0, path, -1, buf, LWS_ARRAY_SIZE(buf));
if (_wstat32i64(buf, &st)) {
lwsl_info("unable to stat %s\n", path);
goto notfound;
}
}
#else
if (stat(path, &st)) {