benoitc / benoitc/http-parser

HttpParser and multiple concatenated HTTP responses

未关闭
#44 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
improvement
主要语言
C
星标
345
派生
94
PR 合并指标
30 天内没有已合并 PR

描述

Hi!

If my understanding is correct HttpParser.execute returns the number of bytes consumed, hence it is possible to parse multiple concatenated HTTP responses by checking is_message_complete() and starting a new parser from the same very position the last one stopped.

However the observed behavior is very different: execute() happily consumes the whole string, the subsequent responses text ends up in the message body and _clen_rest is negative.

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先复现围绕 HttpParser.execute() 和 is_message_complete() 的连续响应场景,然后检查响应结束时 _clen_rest 是如何更新的。完成的标准是,解析器报告第一个响应的边界,而不会将后续响应文本放入 body,这样另一个解析器就可以从返回的位置开始解析。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, python
领域
networking
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。