mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
25w16d
This commit is contained in:
parent
498266e08e
commit
da89b3f45e
4 changed files with 26 additions and 16 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
25w16d - 2025-03-12
|
||||||
|
---
|
||||||
|
- PRE-RELEASE: 此版本是v2.4.0的预发布版本,请勿在生产环境中使用;
|
||||||
|
- CHANGE: 使用更高性能的Buffer Pool 实现
|
||||||
|
|
||||||
25w16c
|
25w16c
|
||||||
---
|
---
|
||||||
- PRE-RELEASE: 此版本是v2.4.0的预发布版本,请勿在生产环境中使用;
|
- PRE-RELEASE: 此版本是v2.4.0的预发布版本,请勿在生产环境中使用;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
25w16c
|
25w16d
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/WJQSERVER-STUDIO/go-utils/copyb"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -126,7 +127,8 @@ func ChunkedProxyRequest(c *gin.Context, u string, cfg *config.Config, mode stri
|
||||||
|
|
||||||
c.Status(resp.StatusCode)
|
c.Status(resp.StatusCode)
|
||||||
|
|
||||||
_, err = io.CopyBuffer(c.Writer, resp.Body, nil)
|
//_, err = io.CopyBuffer(c.Writer, resp.Body, nil)
|
||||||
|
_, err = copyb.CopyBuffer(c.Writer, resp.Body, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logError("%s %s %s %s %s Failed to copy response body: %v", c.ClientIP(), method, u, c.Request.Header.Get("User-Agent"), c.Request.Proto, err)
|
logError("%s %s %s %s %s Failed to copy response body: %v", c.ClientIP(), method, u, c.Request.Header.Get("User-Agent"), c.Request.Proto, err)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/WJQSERVER-STUDIO/go-utils/copyb"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -96,7 +97,7 @@ func GitReq(c *gin.Context, u string, cfg *config.Config, mode string, runMode s
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Status(resp.StatusCode)
|
c.Status(resp.StatusCode)
|
||||||
|
/*
|
||||||
// 使用固定32KB缓冲池
|
// 使用固定32KB缓冲池
|
||||||
buffer := BufferPool.Get().([]byte)
|
buffer := BufferPool.Get().([]byte)
|
||||||
defer BufferPool.Put(buffer)
|
defer BufferPool.Put(buffer)
|
||||||
|
|
@ -108,16 +109,18 @@ func GitReq(c *gin.Context, u string, cfg *config.Config, mode string, runMode s
|
||||||
} else {
|
} else {
|
||||||
c.Writer.Flush() // 确保刷入
|
c.Writer.Flush() // 确保刷入
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
_, err = copyb.CopyBuffer(c.Writer, resp.Body, nil)
|
_, err = copyb.CopyBuffer(c.Writer, resp.Body, nil)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logError("%s %s %s %s %s Failed to copy response body: %v", c.ClientIP(), method, u, c.Request.Header.Get("User-Agent"), c.Request.Proto, err)
|
logError("%s %s %s %s %s Failed to copy response body: %v", c.ClientIP(), method, u, c.Request.Header.Get("User-Agent"), c.Request.Proto, err)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
c.Writer.Flush() // 确保刷入
|
c.Writer.Flush() // 确保刷入
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// extractParts 从给定的 URL 中提取所需的部分
|
// extractParts 从给定的 URL 中提取所需的部分
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue