netutils: nxstyle fixes

fixes for errors reported by nxstyle tool

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea
2021-06-11 12:06:42 +02:00
committed by Xiang Xiao
parent adc3c9fae9
commit 5572819bb1
52 changed files with 228 additions and 173 deletions

View File

@@ -298,7 +298,9 @@ int curl4nx_easy_perform(FAR struct curl4nx_s *handle)
rxoff++;
}
/* Check for overflow, version code should not fill the tmpbuf */
/* Check for overflow,
* version code should not fill the tmpbuf
*/
if (tmplen == sizeof(tmpbuf))
{
@@ -350,7 +352,9 @@ int curl4nx_easy_perform(FAR struct curl4nx_s *handle)
rxoff++;
}
/* Check for overflow, version code should not fill the tmpbuf */
/* Check for overflow,
* version code should not fill the tmpbuf
*/
if (tmplen == sizeof(tmpbuf))
{
@@ -366,7 +370,7 @@ int curl4nx_easy_perform(FAR struct curl4nx_s *handle)
if (state == CURL4NX_STATE_STATUSREASON)
{
/* Accumulate response code until CRLF */
/* Accumulate response code until CRLF */
while (rxoff < ret)
{
@@ -500,15 +504,17 @@ int curl4nx_easy_perform(FAR struct curl4nx_s *handle)
handle->max_redirs))
{
curl4nx_info(
"Too many redirections\n");
cret = CURL4NXE_TOO_MANY_REDIRECTS;
"Too many redirections\n");
cret =
CURL4NXE_TOO_MANY_REDIRECTS;
goto close;
}
cret =
curl4nx_easy_setopt(handle,
CURL4NXOPT_URL,
headerbuf + off);
curl4nx_easy_setopt(
handle,
CURL4NXOPT_URL,
headerbuf + off);
if (cret != CURL4NXE_OK)
{
goto close;
@@ -516,9 +522,10 @@ int curl4nx_easy_perform(FAR struct curl4nx_s *handle)
redirected = true;
redircount += 1;
curl4nx_info("REDIRECTION (%d) -> %s\n",
redircount,
headerbuf + off);
curl4nx_info("
REDIRECTION (%d) -> %s\n",
redircount,
headerbuf + off);
}
}
}

View File

@@ -120,6 +120,7 @@ int curl4nx_easy_setopt(FAR struct curl4nx_s *handle, int option,
cret = CURL4NXE_BAD_FUNCTION_ARGUMENT;
break;
}
handle->port = (uint16_t)(port & 0xffff);
break;
}
@@ -196,6 +197,7 @@ int curl4nx_easy_setopt(FAR struct curl4nx_s *handle, int option,
cret = CURL4NXE_BAD_FUNCTION_ARGUMENT;
break;
}
handle->max_redirs = redirs;
break;
}

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* apps/netutils/curl4nx/curl4nx_private.h
* apps/netutils/libcurl4nx/curl4nx_private.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -96,7 +96,7 @@
while(0)
/****************************************************************************
* Private Types
* Public Types
****************************************************************************/
/****************************************************************************