From 8160059182fbb6ff359d45b9565aef305167b68d Mon Sep 17 00:00:00 2001 From: jianzhiyao Date: Tue, 16 Jun 2020 14:56:58 +0800 Subject: [PATCH] big size file lead to memory leak --- staticfile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staticfile.go b/staticfile.go index 464c1175..84e9aa7b 100644 --- a/staticfile.go +++ b/staticfile.go @@ -68,6 +68,10 @@ func serverStaticRouter(ctx *context.Context) { http.ServeFile(ctx.ResponseWriter, ctx.Request, filePath) } return + } else if fileInfo.Size() > int64(BConfig.WebConfig.StaticCacheFileSize) { + //over size file serve with http module + http.ServeFile(ctx.ResponseWriter, ctx.Request, filePath) + return } var enableCompress = BConfig.EnableGzip && isStaticCompress(filePath)