Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken page (using setroot) #83

Open
StephaneTy-Pro opened this issue Oct 22, 2024 · 4 comments
Open

broken page (using setroot) #83

StephaneTy-Pro opened this issue Oct 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@StephaneTy-Pro
Copy link

StephaneTy-Pro commented Oct 22, 2024

Description

page load but was broken (corrupted)

Expected Behavior

page is correctly loaded

Reproduction Steps

No response

Error Logs

No response

Possible Solution

in _webui_http_send_file() replace

/*
    if (WEBUI_FILE_OPEN(file, path, "rb") != 0 || !file) {
        #ifdef WEBUI_LOG
        printf("[Core]\t\t_webui_http_send_file() -> Can't open file [%s]\n", path);
        #endif
        return;
    }
*/
	if (WEBUI_FILE_OPEN(file, path, "rb") == NULL) {
        #ifdef WEBUI_LOG
        printf("[Core]\t\t_webui_http_send_file() -> Can't open file [%s]\n", path);
        #endif
	}

Version

2.5.0-beta2

Environment Details (OS name, version, etc.)

linux 5.10.0-12
@StephaneTy-Pro StephaneTy-Pro added the bug Something isn't working label Oct 22, 2024
@AlbertShown
Copy link
Contributor

I don't know what you mean by corrupted... do you mean like content of file is corrupted?

@StephaneTy-Pro
Copy link
Author

StephaneTy-Pro commented Oct 22, 2024

a blank white webpage is shown with text "Message Corrupt"

using log i could see that loading fail in _webui_http_send_file() ; it's the reason why i propose to correct the test

@AlbertShown
Copy link
Contributor

You removed return;, that's mean the execution will continue even if opening the file is failed.
How did this fix your issue?

@StephaneTy-Pro
Copy link
Author

StephaneTy-Pro commented Oct 24, 2024

houps i forget the return, but the original problem was with expression

WEBUI_FILE_OPEN(file, path, "rb") != 0 || !file

Perhaps i m wrong but

WEBUI_FILE_OPEN(file, path, "rb") != 0 => check if file is open and we return if it was opened

i juste modifiy the test to return if WEBUI_FILE_OPEN was null (function return null or pointer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants