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

deadline 无效 #58

Open
SuperXiaoxiong opened this issue Aug 21, 2024 · 8 comments
Open

deadline 无效 #58

SuperXiaoxiong opened this issue Aug 21, 2024 · 8 comments

Comments

@SuperXiaoxiong
Copy link

image

不知道是waf原因,还是其他连接原因
超时设置无效

@SuperXiaoxiong
Copy link
Author

具体无法结束的原因
响应未设置 cl

测试如下
image
image

理解兜底 deadline 没起效果

@M09Ic
Copy link
Contributor

M09Ic commented Aug 26, 2024

我无法复现这个问题, 找到了一个疑似bug的地方, 不是很确定.

加上 -c standard 手动指定标准http库看看是否还会存在这个问题?

@SuperXiaoxiong
Copy link
Author

一个开发老师傅说

ea5218b

修 tcp 连接 超时失效的时候,把 read timeout 搞没了

师傅看看是不是这里出错了

@SuperXiaoxiong
Copy link
Author

SuperXiaoxiong commented Aug 27, 2024

我无法复现这个问题, 找到了一个疑似bug的地方, 不是很确定.

加上 -c standard 手动指定标准http库看看是否还会存在这个问题?

使用curl 会出现这个问题,库标准是这样的。

一般响应中都有 content-length 字段
image

当非常规响应中没有 content-length 字段时 就会出现这个问题,请求不会关闭

@M09Ic
Copy link
Contributor

M09Ic commented Aug 28, 2024

我猜测的原因也是这个,fasthttp的timeout文档上说是全局生效, 但是似乎对tcp需要单独声明, 之前这一块的代码被我注释了。

fastClient: &fasthttp.Client{
TLSConfig: &tls.Config{
Renegotiation: tls.RenegotiateOnceAsClient,
InsecureSkipVerify: true,
},
Dial: customDialFunc(config.ProxyAddr, config.Timeout),
MaxConnsPerHost: config.Thread * 3 / 2,
MaxIdleConnDuration: config.Timeout,
//MaxConnWaitTimeout: time.Duration(timeout) * time.Second,
//ReadTimeout: config.Timeout * time.Second,
//WriteTimeout: config.Timeout * time.Second,
ReadBufferSize: 16384, // 16k
MaxResponseBodySize: int(DefaultMaxBodySize),
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
DisableHeaderNamesNormalizing: true,
},

M09Ic added a commit that referenced this issue Aug 28, 2024
@M09Ic
Copy link
Contributor

M09Ic commented Aug 29, 2024

尝试在 https://github.com/chainreactors/spray/releases/tag/v1.1.1 中进行了修复, 但是我无法确定问题是否已被解决, 是否可以帮忙测试下

@SuperXiaoxiong
Copy link
Author

image
还是没有解决这个问题

找到一个简单的测试方案
nc -lvp 48080 监听 48080 端口

然后使用spray 扫描该ip:port , 设置deadline

M09Ic added a commit that referenced this issue Sep 10, 2024
@M09Ic
Copy link
Contributor

M09Ic commented Sep 10, 2024

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

No branches or pull requests

2 participants