 src/apps/httpd/httpd.c | 80 +++++++++++++++++++++++++-------------------------
 1 file changed, 40 insertions(+), 40 deletions(-)

diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c
index 0ac8d492..b48575bb 100644
--- a/src/apps/httpd/httpd.c
+++ b/src/apps/httpd/httpd.c
@@ -310,29 +310,29 @@ static void http_continue(void *connection);
 
 #if LWIP_HTTPD_SSI
 /* SSI insert handler function pointer. */
-tSSIHandler g_pfnSSIHandler;
+static tSSIHandler ssi_handler;
 #if !LWIP_HTTPD_SSI_RAW
-int g_iNumTags;
-const char **g_ppcTags;
+static int num_tags;
+static const char **tags;
 #endif /* !LWIP_HTTPD_SSI_RAW */
 
 #define LEN_TAG_LEAD_IN 5
-const char *const g_pcTagLeadIn = "<!--#";
+static const char *const tags_lead_in = "<!--#";
 
 #define LEN_TAG_LEAD_OUT 3
-const char *const g_pcTagLeadOut = "-->";
+static const char *const tags_lead_out = "-->";
 #endif /* LWIP_HTTPD_SSI */
 
 #if LWIP_HTTPD_CGI
 /* CGI handler information */
-const tCGI *g_pCGIs;
-int g_iNumCGIs;
-int http_cgi_paramcount;
+static const tCGI *cgis;
+static int num_cgis;
+static int http_cgi_paramcount;
 #define http_cgi_params     hs->params
 #define http_cgi_param_vals hs->param_vals
 #elif LWIP_HTTPD_CGI_SSI
-char *http_cgi_params[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Params extracted from the request URI */
-char *http_cgi_param_vals[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Values for each extracted param */
+static char *http_cgi_params[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Params extracted from the request URI */
+static char *http_cgi_param_vals[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Values for each extracted param */
 #endif /* LWIP_HTTPD_CGI */
 
 #if LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED
@@ -770,9 +770,9 @@ get_tag_insert(struct http_state *hs)
   tag = ssi->tag_name;
 #endif
 
-  if (g_pfnSSIHandler
+  if (ssi_handler
 #if !LWIP_HTTPD_SSI_RAW
-      && g_ppcTags && g_iNumTags
+      && tags && num_tags
 #endif /* !LWIP_HTTPD_SSI_RAW */
      ) {
 
@@ -780,11 +780,11 @@ get_tag_insert(struct http_state *hs)
 #if LWIP_HTTPD_SSI_RAW
     {
 #else /* LWIP_HTTPD_SSI_RAW */
-    for (tag = 0; tag < g_iNumTags; tag++) {
-      if (strcmp(ssi->tag_name, g_ppcTags[tag]) == 0)
+    for (tag = 0; tag < num_tags; tag++) {
+      if (strcmp(ssi->tag_name, tags[tag]) == 0)
 #endif /* LWIP_HTTPD_SSI_RAW */
       {
-        ssi->tag_insert_len = g_pfnSSIHandler(tag, ssi->tag_insert,
+        ssi->tag_insert_len = ssi_handler(tag, ssi->tag_insert,
                                               LWIP_HTTPD_MAX_TAG_INSERT_LEN
 #if LWIP_HTTPD_SSI_MULTIPART
                                               , current_tag_part, &ssi->tag_part
@@ -1239,7 +1239,7 @@ http_send_data_ssi(struct altcp_pcb *pcb, struct http_state *hs)
       case TAG_NONE:
         /* We are not currently processing an SSI tag so scan for the
          * start of the lead-in marker. */
-        if (*ssi->parsed == g_pcTagLeadIn[0]) {
+        if (*ssi->parsed == tags_lead_in[0]) {
           /* We found what could be the lead-in for a new tag so change
            * state appropriately. */
           ssi->tag_state = TAG_LEADIN;
@@ -1264,7 +1264,7 @@ http_send_data_ssi(struct altcp_pcb *pcb, struct http_state *hs)
           ssi->tag_state = TAG_FOUND;
         } else {
           /* Have we found the next character we expect for the tag leadin? */
-          if (*ssi->parsed == g_pcTagLeadIn[ssi->tag_index]) {
+          if (*ssi->parsed == tags_lead_in[ssi->tag_index]) {
             /* Yes - move to the next one unless we have found the complete
              * leadin, in which case we start looking for the tag itself */
             ssi->tag_index++;
@@ -1297,7 +1297,7 @@ http_send_data_ssi(struct altcp_pcb *pcb, struct http_state *hs)
 
         /* Have we found the end of the tag name? This is signalled by
          * us finding the first leadout character or whitespace */
-        if ((*ssi->parsed == g_pcTagLeadOut[0]) ||
+        if ((*ssi->parsed == tags_lead_out[0]) ||
             (*ssi->parsed == ' ')  || (*ssi->parsed == '\t') ||
             (*ssi->parsed == '\n') || (*ssi->parsed == '\r')) {
 
@@ -1311,7 +1311,7 @@ http_send_data_ssi(struct altcp_pcb *pcb, struct http_state *hs)
             LWIP_ASSERT("ssi->tag_index <= 0xff", ssi->tag_index <= 0xff);
             ssi->tag_name_len = (u8_t)ssi->tag_index;
             ssi->tag_name[ssi->tag_index] = '\0';
-            if (*ssi->parsed == g_pcTagLeadOut[0]) {
+            if (*ssi->parsed == tags_lead_out[0]) {
               ssi->tag_index = 1;
             } else {
               ssi->tag_index = 0;
@@ -1347,7 +1347,7 @@ http_send_data_ssi(struct altcp_pcb *pcb, struct http_state *hs)
         }
 
         /* Have we found the next character we expect for the tag leadout? */
-        if (*ssi->parsed == g_pcTagLeadOut[ssi->tag_index]) {
+        if (*ssi->parsed == tags_lead_out[ssi->tag_index]) {
           /* Yes - move to the next one unless we have found the complete
            * leadout, in which case we need to call the client to process
            * the tag. */
@@ -2214,15 +2214,15 @@ http_find_file(struct http_state *hs, const char *uri, int is_09)
 #if LWIP_HTTPD_CGI
     http_cgi_paramcount = -1;
     /* Does the base URI we have isolated correspond to a CGI handler? */
-    if (g_iNumCGIs && g_pCGIs) {
-      for (i = 0; i < g_iNumCGIs; i++) {
-        if (strcmp(uri, g_pCGIs[i].pcCGIName) == 0) {
+    if (num_cgis && cgis) {
+      for (i = 0; i < num_cgis; i++) {
+        if (strcmp(uri, cgis[i].pcCGIName) == 0) {
           /*
            * We found a CGI that handles this URI so extract the
            * parameters and call the handler.
            */
           http_cgi_paramcount = extract_uri_parameters(hs, params);
-          uri = g_pCGIs[i].pfnCGIHandler(i, http_cgi_paramcount, hs->params,
+          uri = cgis[i].pfnCGIHandler(i, http_cgi_paramcount, hs->params,
                                          hs->param_vals);
           break;
         }
@@ -2660,27 +2660,27 @@ httpd_inits(struct altcp_tls_config *conf)
  * @ingroup httpd
  * Set the SSI handler function.
  *
- * @param ssi_handler the SSI handler function
+ * @param ssi_handler_arg the SSI handler function
  * @param tags an array of SSI tag strings to search for in SSI-enabled files
- * @param num_tags number of tags in the 'tags' array
+ * @param num_tags_arg number of tags in the 'tags' array
  */
 void
-http_set_ssi_handler(tSSIHandler ssi_handler, const char **tags, int num_tags)
+http_set_ssi_handler(tSSIHandler ssi_handler_arg, const char **tags_arg, int num_tags_arg)
 {
   LWIP_DEBUGF(HTTPD_DEBUG, ("http_set_ssi_handler\n"));
 
-  LWIP_ASSERT("no ssi_handler given", ssi_handler != NULL);
-  g_pfnSSIHandler = ssi_handler;
+  LWIP_ASSERT("no ssi_handler given", ssi_handler_arg != NULL);
+  ssi_handler = ssi_handler_arg;
 
 #if LWIP_HTTPD_SSI_RAW
-  LWIP_UNUSED_ARG(tags);
-  LWIP_UNUSED_ARG(num_tags);
+  LWIP_UNUSED_ARG(tags_arg);
+  LWIP_UNUSED_ARG(num_tags_arg);
 #else /* LWIP_HTTPD_SSI_RAW */
-  LWIP_ASSERT("no tags given", tags != NULL);
-  LWIP_ASSERT("invalid number of tags", num_tags > 0);
+  LWIP_ASSERT("no tags given", tags_arg != NULL);
+  LWIP_ASSERT("invalid number of tags", num_tags_arg > 0);
 
-  g_ppcTags = tags;
-  g_iNumTags = num_tags;
+  tags = tags_arg;
+  num_tags = num_tags_arg;
 #endif /* !LWIP_HTTPD_SSI_RAW */
 }
 #endif /* LWIP_HTTPD_SSI */
@@ -2690,17 +2690,17 @@ http_set_ssi_handler(tSSIHandler ssi_handler, const char **tags, int num_tags)
  * @ingroup httpd
  * Set an array of CGI filenames/handler functions
  *
- * @param cgis an array of CGI filenames/handler functions
+ * @param cgis_arg an array of CGI filenames/handler functions
  * @param num_handlers number of elements in the 'cgis' array
  */
 void
-http_set_cgi_handlers(const tCGI *cgis, int num_handlers)
+http_set_cgi_handlers(const tCGI *cgis_arg, int num_handlers)
 {
-  LWIP_ASSERT("no cgis given", cgis != NULL);
+  LWIP_ASSERT("no cgis given", cgis_arg != NULL);
   LWIP_ASSERT("invalid number of handlers", num_handlers > 0);
 
-  g_pCGIs = cgis;
-  g_iNumCGIs = num_handlers;
+  cgis = cgis_arg;
+  num_cgis = num_handlers;
 }
 #endif /* LWIP_HTTPD_CGI */
 
