webclient: Send HTTP 1.1 request if enabled

This commit is contained in:
YAMAMOTO Takashi 2022-03-07 09:29:55 +09:00 committed by Xiang Xiao
parent 3759da3d00
commit 7949059ec2

View File

@ -1120,7 +1120,21 @@ int webclient_perform(FAR struct webclient_context *ctx)
#endif
dest = append(dest, ep, " ");
dest = append(dest, ep, g_http10);
if (ctx->protocol_version == WEBCLIENT_PROTOCOL_VERSION_HTTP_1_0)
{
dest = append(dest, ep, g_http10);
}
else if (ctx->protocol_version ==
WEBCLIENT_PROTOCOL_VERSION_HTTP_1_1)
{
dest = append(dest, ep, g_http11);
}
else
{
ret = -EINVAL;
goto errout_with_errno;
}
dest = append(dest, ep, g_httpcrnl);
dest = append(dest, ep, g_httphost);
dest = append(dest, ep, ws->hostname);