mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-07 18:50:27 +08:00
优化HTTP参数
This commit is contained in:
@@ -208,6 +208,9 @@ func (this *FileStorage) OpenReader(key string) (Reader, error) {
|
|||||||
return this.openReader(key, true)
|
return this.openReader(key, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cacheMap = map[string][]*os.File{}
|
||||||
|
var cacheMapLocker = ysnc.
|
||||||
|
|
||||||
func (this *FileStorage) openReader(key string, allowMemory bool) (Reader, error) {
|
func (this *FileStorage) openReader(key string, allowMemory bool) (Reader, error) {
|
||||||
// 先尝试内存缓存
|
// 先尝试内存缓存
|
||||||
if allowMemory && this.memoryStorage != nil {
|
if allowMemory && this.memoryStorage != nil {
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ func (this *HTTPListener) Serve() error {
|
|||||||
this.httpServer = &http.Server{
|
this.httpServer = &http.Server{
|
||||||
Addr: this.addr,
|
Addr: this.addr,
|
||||||
Handler: this,
|
Handler: this,
|
||||||
ReadHeaderTimeout: 2 * time.Second, // TODO 改成可以配置
|
ReadHeaderTimeout: 3 * time.Second, // TODO 改成可以配置
|
||||||
IdleTimeout: 2 * time.Minute, // TODO 改成可以配置
|
IdleTimeout: 75 * time.Second, // TODO 改成可以配置
|
||||||
ConnState: func(conn net.Conn, state http.ConnState) {
|
ConnState: func(conn net.Conn, state http.ConnState) {
|
||||||
switch state {
|
switch state {
|
||||||
case http.StateNew:
|
case http.StateNew:
|
||||||
|
|||||||
Reference in New Issue
Block a user