Decode broken when multiple calls same time
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- php
- 领域
- networking
调研方向
首先定位 issue 中所示的 private 函数 decode($msg),并用快速连续发送的两个帧重现该情况。跟踪消息长度和 payload 边界的处理方式,然后验证这两个帧会产生彼此独立的解码输出。
由索引模型根据 Issue 内容生成。
描述
What steps will reproduce the problem?
Send two frames in a very short time
socket.send('message1')
socket.send('message2')
As result, the decoding function does not understand when first frame end and
second one start, which causes it handle two frame as single. This lead broken
output.
Decode function is:
private function decode ($msg) {
$len = $data = $decoded = $index = null;
$len = $msg[1] & 127;
if ($len === 126) {
$this->masks = substr ($msg, 4, 4);
$data = substr ($msg, 8);
$this->initFrame = substr ($msg, 0, 4);
}
else if ($len === 127) {
$this->masks = substr ($msg, 10, 4);
$data = substr ($msg, 14);
$this->initFrame = substr ($msg, 0, 10);
}
else {
$this->masks = substr ($msg, 2, 4);
$data = substr ($msg, 6);
$this->initFrame = substr ($msg, 0, 2);
}
for ($index = 0; $index < strlen ($data); $index++) {
$decoded .= $data[$index] ^ $this->masks[$index % 4];
}
return $decoded;
}
----------------
Should there be some regonizion when frame end and then attach rest of the
message to second frame?
Original issue reported on code.google.com by [email protected] on 15 Nov 2012 at 9:35
- 主要语言
- PHP
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
et-nik/phpwebsocket 的其他 Issue
-
auto-migrated Priority-Medium Type-Defect
难度 4/5 3-5 天 新手友好度 20/100
et-nik/phpwebsocket#77 ·
-
auto-migrated Priority-Medium Type-Defect
难度 3/5 1-2 天 新手友好度 20/100
et-nik/phpwebsocket#78 ·
-
auto-migrated Type-Patch
难度 5/5 一周以上 新手友好度 15/100
et-nik/phpwebsocket#72 ·
-
auto-migrated Type-Patch
难度 3/5 1-2 天 新手友好度 35/100
et-nik/phpwebsocket#73 ·
-
auto-migrated Type-Patch
难度 5/5 一周以上 新手友好度 10/100
et-nik/phpwebsocket#74 ·
查看 et-nik/phpwebsocket 的全部 Issue
相似的 Issue
-
Recognise PHP_CodeSniffer (`phpcs`) as a linter可能已有人在做 @HarshRajSinghania 今天认领。 未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
MustacheCase/zanadir#507 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
jwage/phpamqplib-messenger#163 ·
-
Newsletter subscription page logs Undefined array key "nw_error" on every GET可能已有人在做 @Codencode 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 82/100
PrestaShop/ps_emailsubscription#145 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 82/100