netutils/webserver: Fix a few complaints from nutts/tools/nxstyle.

This commit is contained in:
Gregory Nutt 2019-07-04 21:21:26 -06:00
parent 0b352178c1
commit 39ad02f72e
3 changed files with 43 additions and 37 deletions

View File

@ -14,7 +14,6 @@ config NETUTILS_WEBSERVER
if NETUTILS_WEBSERVER
config NETUTILS_HTTPD_SINGLECONNECT
bool "Single Connection"
default n if !DISABLE_PTHREAD
@ -179,5 +178,4 @@ config NETUTILS_HTTPD_DIRLIST
depends on NETUTILS_HTTPD_SENDFILE
default n
endif # NETUTILS_WEBSERVER

View File

@ -444,7 +444,10 @@ static int send_headers(struct httpd_state *pstate, int status, int len)
{
const char *mime;
const char *ptr;
char contentlen[HTTPD_MAX_CONTENTLEN] = { 0 };
char contentlen[HTTPD_MAX_CONTENTLEN] =
{
0
};
char header[HTTPD_MAX_HEADERLEN];
int hdrlen;
int i;
@ -456,19 +459,36 @@ static int send_headers(struct httpd_state *pstate, int status, int len)
} a[] =
{
#ifndef CONFIG_NETUTILS_HTTPD_SCRIPT_DISABLE
{ "shtml", "text/html" },
{
"shtml", "text/html"
},
#endif
{ "html", "text/html" },
{ "css", "text/css" },
{ "txt", "text/plain" },
{ "js", "text/javascript" },
{ "png", "image/png" },
{ "gif", "image/gif" },
{ "jpeg", "image/jpeg" },
{ "jpg", "image/jpeg" },
{ "mp3", "audio/mpeg" }
{
"html", "text/html"
},
{
"css", "text/css"
},
{
"txt", "text/plain"
},
{
"js", "text/javascript"
},
{
"png", "image/png"
},
{
"gif", "image/gif"
},
{
"jpeg", "image/jpeg"
},
{
"jpg", "image/jpeg"
},
{ "mp3", "audio/mpeg"
}
};
ptr = strrchr(pstate->ht_filename, ISO_period);

View File

@ -54,18 +54,6 @@
#include "httpd.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/