Close #60 修正POST请求无Content-Length字段时无法转发请求的问题
* 部分HTTP POST请求中无有Content-Length字段,导致无法确定请求的边界。 * 现修正为,当发现Content-Length字段缺失时,Passthrough整个TCP连接。 * TODO: 解析POST编码或回应411应答。
This commit is contained in:
@@ -362,6 +362,11 @@ enum tfe_stream_action __http_connection_entry_on_request(const struct tfe_strea
|
||||
}
|
||||
|
||||
/* Some kind of error happened, write log and detach the stream */
|
||||
if (ret == -1 && hf_private_req_in->is_passthrough)
|
||||
{
|
||||
goto __errout;
|
||||
}
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
TFE_STREAM_LOG_ERROR(stream, "Failed at parsing stream as HTTP: %u, %s, %s",
|
||||
@@ -475,6 +480,12 @@ enum tfe_stream_action __http_connection_entry_on_response(const struct tfe_stre
|
||||
return hf_private_resp_in->stream_action;
|
||||
}
|
||||
|
||||
/* Need to passthrough */
|
||||
if (ret == -1 && hf_private_resp_in->is_passthrough)
|
||||
{
|
||||
goto __errout;
|
||||
}
|
||||
|
||||
/* Some kind of error happened, write log and detach the stream */
|
||||
if (ret == -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user