Skip to content

ui: fix ETag truncation with MSVC compiler#23917

Open
EZForever wants to merge 1 commit into
ggml-org:masterfrom
EZForever:ui-etag-cast
Open

ui: fix ETag truncation with MSVC compiler#23917
EZForever wants to merge 1 commit into
ggml-org:masterfrom
EZForever:ui-etag-cast

Conversation

@EZForever
Copy link
Copy Markdown
Contributor

Overview

In the process of generating ETags for embedded web UI files, the uint64_t file hash is casted into a unsigned long value before being converted into a 64-bit hexadecimal string. MSVC compiler uses 32 bit long values, and thus will truncate the hash value. This don't really affect anything (aside for some ridiculous hypothetical load-balancing setup with servers running different OSes), but hey, why do a type cast when you can use the full value just like on Linux?

For consistency, type cast on the size_t value above is also removed. I don't really believe we will have 4GB+ of static files, though.

Additional information

Tested on Windows 11 with Visual Studio 2026.

Current master:

C:\Users\EZForever>curl -I http://127.0.0.1:9070/bundle.js
HTTP/1.1 200 OK
Server: llama.cpp
Access-Control-Allow-Origin:
ETag: "0x000000002639b40d"
Content-Type: application/javascript; charset=utf-8
Content-Length: 5285413
Accept-Ranges: bytes
Keep-Alive: timeout=5, max=100

This PR:

C:\Users\EZForever>curl -I http://127.0.0.1:9070/bundle.js
HTTP/1.1 200 OK
Server: llama.cpp
Access-Control-Allow-Origin:
ETag: "0xf0f916632639b40d"
Content-Type: application/javascript; charset=utf-8
Content-Length: 5285413
Accept-Ranges: bytes
Keep-Alive: timeout=5, max=100

Requirements

@EZForever EZForever requested a review from a team as a code owner May 30, 2026 17:48
Copy link
Copy Markdown
Contributor

@allozaur allozaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sth is causing ubuntu Server jobs to fail... not sure if this is caused by changes from this PR or sth else..?

@aldehir please take a look

@aldehir
Copy link
Copy Markdown
Contributor

aldehir commented May 31, 2026

@allozaur seems unrelated to this PR, for example #23913 (comment) also fails. Probably needs to be bisected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants