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

fix pointer dereference when no lastupdate time stamp #166

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

pivilartisant
Copy link
Collaborator

@pivilartisant pivilartisant commented Nov 14, 2024

This pr fixes a server crash when the last updated time stamp is not present.

It's a quick win but we should discuss how to handle this gracefully (like redirect to a specific error page)

goroutine 8 [running]:
net/http.(*conn).serve.func1()
        /usr/local/go/src/net/http/server.go:1947 +0xb0
panic({0x1032b8040?, 0x1037297c0?})
        /usr/local/go/src/runtime/panic.go:785 +0x124
github.com/massalabs/deweb-server/pkg/webmanager.isFileOutdated(0x1400001f8b0, 0xff?, {0x140003861c0, 0x34}, {0x10314e7e1, 0xa})
        /Users/pivi/Code/massa/DeWeb/server/pkg/webmanager/manager.go:106 +0x17c
github.com/massalabs/deweb-server/pkg/webmanager.RequestFile({0x140003861c0, 0x34}, 0x140003b6098, {0x10314e7e1, 0xa})
        /Users/pivi/Code/massa/DeWeb/server/pkg/webmanager/manager.go:38 +0x164
github.com/massalabs/deweb-server/pkg/webmanager.GetWebsiteResource(0x140003b6098, {0x140003861c0, 0x34}, {0x10314e7e1, 0xa})
        /Users/pivi/Code/massa/DeWeb/server/pkg/webmanager/manager.go:18 +0xc8
github.com/massalabs/deweb-server/int/api.getWebsiteResource(0x140003b6098, {0x140003861c0, 0x34}, {0x10314e7e1, 0xa})
        /Users/pivi/Code/massa/DeWeb/server/int/api/middlewares.go:171 +0x144
github.com/massalabs/deweb-server/int/api.serveContent(0x140003861c0?, {0x140003861c0, 0x34}, {0x10314e7e1, 0xa}, {0x103357f98, 0x140001502a0})
        /Users/pivi/Code/massa/DeWeb/server/int/api/middlewares.go:75 +0x44
github.com/massalabs/deweb-server/int/api.(*API).Start.SubdomainMiddleware.func3({0x103357f98, 0x140001502a0}, 0x14000204000)
        /Users/pivi/Code/massa/DeWeb/server/int/api/middlewares.go:69 +0x280
net/http.HandlerFunc.ServeHTTP(0x0?, {0x103357f98?, 0x140001502a0?}, 0x140000a3b60?)
        /usr/local/go/src/net/http/server.go:2220 +0x38
net/http.serverHandler.ServeHTTP({0x1400038cf30?}, {0x103357f98?, 0x140001502a0?}, 0x6?)
        /usr/local/go/src/net/http/server.go:3210 +0xbc
net/http.(*conn).serve(0x140005acab0, {0x103359030, 0x140004001b0})
        /usr/local/go/src/net/http/server.go:2092 +0x4fc
created by net/http.(*Server).Serve in goroutine 29
        /usr/local/go/src/net/http/server.go:3360 +0x3dc

@pivilartisant pivilartisant changed the title fix pointer dereferebce when no lastupdated time stamp fix pointer dereference when no lastupdated time stamp Nov 14, 2024
@pivilartisant pivilartisant marked this pull request as draft November 14, 2024 12:35
@pivilartisant pivilartisant marked this pull request as ready for review November 18, 2024 16:03
@pivilartisant pivilartisant changed the title fix pointer dereference when no lastupdated time stamp fix pointer dereference when no lastupdate time stamp Nov 18, 2024
@thomas-senechal thomas-senechal merged commit fd61384 into main Nov 18, 2024
11 checks passed
@thomas-senechal thomas-senechal deleted the fix-lastupdated branch November 21, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants