mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-06 21:55:13 +00:00
webclient: Don't forget to check http status before webclient_get_tunnel
This commit is contained in:
parent
3f4e723ff7
commit
a696c8945e
1 changed files with 22 additions and 0 deletions
|
|
@ -1390,6 +1390,28 @@ int webclient_perform(FAR struct webclient_context *ctx)
|
|||
if (ws->tunnel != NULL)
|
||||
{
|
||||
ret = webclient_perform(ws->tunnel);
|
||||
if (ret == 0)
|
||||
{
|
||||
unsigned int http_status = ws->tunnel->http_status;
|
||||
|
||||
if (http_status / 100 != 2)
|
||||
{
|
||||
nerr("HTTP-level error %u on tunnel attempt\n",
|
||||
http_status);
|
||||
|
||||
/* 407 Proxy Authentication Required */
|
||||
|
||||
if (http_status == 407)
|
||||
{
|
||||
ret = -EPERM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -EIO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
FAR struct webclient_conn_s *tunnel_conn;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue