-
Notifications
You must be signed in to change notification settings - Fork 7
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
关于Guzzle http请求连接失败异常 #35
Comments
可以提交一份版本信息吗? |
body传入base64图片 会有很大的几率导致请求失败 $socketStream 会提前被close掉 在$connection->stream->onReadable的时候读取不到buffer 就会一直产生 response code 码异常的error |
具体场景是 请求完成之前服务端主动断开连接, 从而导致频繁提示 调用guzzle的终端是否启用了这类配置?如果有,建议对照关闭后的结果
|
是的 正常请求,未配置代理 |
大致情况了解了,据描述问题发生在: 请求完成之前服务端主动断开连接 据调试得知问题发生于 public function tick(string|false $content): ResponseInterface|null
{
if ($content === false) {
if (!$this->headers) {
throw new RuntimeException('Response header is required');
} elseif (isset($this->headers['CONTENT-LENGTH'])) {
throw new RuntimeException('Response content length is required');
} elseif ($this->chunk) {
throw new RuntimeException('Response chunked is required');
} else {
$this->step = 2;
}
}
// more..... 该问题已被记录并在下次发行时解决,感谢支持💗 |
还有就是body的内容很长的话 很容易导致断开连接,相同Body参数使用Guzzle默认handler 请求没问题,使用Ripple的Client就会出现连接断开的现象 |
收到 |
该模块已移至 https://github.com/cloudtay/ripple-http 并得到解决 |
请求Body字符过长 比如上传一张base64的图片 会导致$connection->stream->write($content); 这里把链接提前close 导致读取不到响应。从而导致 异常提示 Status code must be an integer value between 1xx and 5xx 。 这里会一直tick 直到timeout为止
The text was updated successfully, but these errors were encountered: