- RELEASE: v2.0.5正式版发布;
- CHANGE: 优化响应体分块复制实现
- ADD: 加入缓存池
- CHANGE: 改进缓存实现
- CHANGE: 部分杂项改进
This commit is contained in:
WJQSERVER 2025-01-27 15:00:19 +08:00 committed by GitHub
parent 6e787ced6e
commit 5d08993cbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 56 additions and 59 deletions

View file

@ -86,13 +86,8 @@ func GitReq(c *gin.Context, u string, cfg *config.Config, mode string, runMode s
CopyResponseHeaders(resp, c, cfg)
c.Status(resp.StatusCode)
if err := gitCopyResponseBody(c, resp.Body); err != nil {
if _, err := io.Copy(c.Writer, resp.Body); err != nil {
logError("%s %s %s %s %s Response-Copy-Error: %v", c.ClientIP(), method, u, c.Request.Header.Get("User-Agent"), c.Request.Proto, err)
}
}
// 复制响应体
func gitCopyResponseBody(c *gin.Context, respBody io.Reader) error {
_, err := io.Copy(c.Writer, respBody)
return err
}