This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 2db602d55f7b8cd81563a9126b9dfd6135b39f21
Author: Marco Casaroli <[email protected]>
AuthorDate: Mon Nov 2 13:07:27 2026 +0100

    netutils/thttpd: Fix the nxstyle errors.
    
    Fix the nxstyle and codespell errors in libhttpd.c, thttpd.c and
    thttpd_cgi.c, so that the next commit can change these files: indent
    the case labels of the switch statements, put braces on single
    statement blocks, add blank lines after declarations, wrap two long
    lines, move two labels to column zero and rename the local variable
    "ths" to "server".
    
    No functional change.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 netutils/thttpd/libhttpd.c   | 608 ++++++++++++++++++++++---------------------
 netutils/thttpd/thttpd.c     |  91 +++----
 netutils/thttpd/thttpd_cgi.c |  82 +++---
 3 files changed, 401 insertions(+), 380 deletions(-)

diff --git a/netutils/thttpd/libhttpd.c b/netutils/thttpd/libhttpd.c
index 8be1c6ec9..019118038 100644
--- a/netutils/thttpd/libhttpd.c
+++ b/netutils/thttpd/libhttpd.c
@@ -442,11 +442,15 @@ static void send_response(httpd_conn *hc, int status, 
const char *title,
   if (!fnmatch("**MSIE**", hc->useragent, 0))
     {
       int n;
+
       add_response(hc, "<!--\n");
       for (n = 0; n < 6; ++n)
-        add_response(hc,
-                     "Padding so that MSIE deigns to show this error "
-                     "instead of its own canned one.\n");
+        {
+          add_response(hc,
+                       "Padding so that MSIE deigns to show this error "
+                       "instead of its own canned one.\n");
+        }
+
       add_response(hc, "-->\n");
     }
 
@@ -474,21 +478,21 @@ static void defang(const char *str, char *dfstr, int 
dfsize)
     {
       switch (*cp1)
         {
-        case '<':
-          *cp2++ = '&';
-          *cp2++ = 'l';
-          *cp2++ = 't';
-          *cp2 = ';';
-          break;
-        case '>':
-          *cp2++ = '&';
-          *cp2++ = 'g';
-          *cp2++ = 't';
-          *cp2 = ';';
-          break;
-        default:
-          *cp2 = *cp1;
-          break;
+          case '<':
+            *cp2++ = '&';
+            *cp2++ = 'l';
+            *cp2++ = 't';
+            *cp2 = ';';
+            break;
+          case '>':
+            *cp2++ = '&';
+            *cp2++ = 'g';
+            *cp2++ = 't';
+            *cp2 = ';';
+            break;
+          default:
+            *cp2 = *cp1;
+            break;
         }
     }
 
@@ -515,7 +519,10 @@ static int send_err_file(httpd_conn *hc, int status, char 
*title,
     {
       nread = fread(buf, 1, sizeof(buf) - 1, fp);
       if (nread == 0)
-        break;
+        {
+          break;
+        }
+
       buf[nread] = '\0';
       add_response(hc, buf);
     }
@@ -623,25 +630,26 @@ static int b64_decode(const char *str, unsigned char 
*space, int size)
         {
           switch (phase)
             {
-            case 0:
-              phase = 1;
-              break;
-
-            case 1:
-              space[ndx++] = ((prev_decoded << 2) | ((decoded & 0x30) >> 4));
-              phase = 2;
-              break;
-
-            case 2:
-              space[ndx++] = (((prev_decoded & 0xf) << 4) |
-                              ((decoded & 0x3packed) >> 2));
-              phase = 3;
-              break;
-
-            case 3:
-              space[ndx++] = (((prev_decoded & 0x03) << 6) | decoded);
-              phase = 0;
-              break;
+              case 0:
+                phase = 1;
+                break;
+
+              case 1:
+                space[ndx++] = ((prev_decoded << 2) |
+                                ((decoded & 0x30) >> 4));
+                phase = 2;
+                break;
+
+              case 2:
+                space[ndx++] = (((prev_decoded & 0xf) << 4) |
+                                ((decoded & 0x3packed) >> 2));
+                phase = 3;
+                break;
+
+              case 3:
+                space[ndx++] = (((prev_decoded & 0x03) << 6) | decoded);
+                phase = 0;
+                break;
             }
 
           prev_decoded = decoded;
@@ -671,10 +679,10 @@ static int auth_check(httpd_conn *hc, char *dirname)
 
   switch (auth_check2(hc, topdir))
     {
-    case -1:
-      return -1;
-    case 1:
-      return 1;
+      case -1:
+        return -1;
+      case 1:
+        return 1;
     }
 #endif /* CONFIG_THTTPD_GLOBALPASSWD */
 
@@ -882,6 +890,7 @@ static void send_dirredirect(httpd_conn *hc)
   if (hc->query[0] != '\0')
     {
       char *cp = strchr(hc->encodedurl, '?');
+
       if (cp)
         {
           *cp = '\0';
@@ -1479,7 +1488,8 @@ static void figure_mime(httpd_conn *hc)
   for (; ; prev_dot = dot)
     {
       for (dot = prev_dot - 1; dot >= hc->expnfilename && *dot != '.'; --dot)
-        ;
+        {
+        }
 
       if (dot < hc->expnfilename)
         {
@@ -1517,7 +1527,7 @@ static void figure_mime(httpd_conn *hc)
 
       break;
 
-    next:;
+next:;
     }
 
   /* Binary search for a matching type extension. */
@@ -1746,34 +1756,34 @@ static void ls_child(int argc, char **argv)
 
       switch (sb.st_mode & S_IFMT)
         {
-        case S_IFIFO:
-          modestr[0] = 'p';
-          break;
+          case S_IFIFO:
+            modestr[0] = 'p';
+            break;
 
-        case S_IFCHR:
-          modestr[0] = 'c';
-          break;
+          case S_IFCHR:
+            modestr[0] = 'c';
+            break;
 
-        case S_IFDIR:
-          modestr[0] = 'd';
-          break;
+          case S_IFDIR:
+            modestr[0] = 'd';
+            break;
 
-        case S_IFBLK:
-          modestr[0] = 'b';
-          break;
+          case S_IFBLK:
+            modestr[0] = 'b';
+            break;
 
-        case S_IFREG:
-          modestr[0] = '-';
-          break;
+          case S_IFREG:
+            modestr[0] = '-';
+            break;
 
-        case S_IFSOCK:
-          modestr[0] = 's';
-          break;
+          case S_IFSOCK:
+            modestr[0] = 's';
+            break;
 
-        case S_IFLNK:
-        default:
-          modestr[0] = '?';
-          break;
+          case S_IFLNK:
+          default:
+            modestr[0] = '?';
+            break;
         }
 
       /* Now the world permissions.  Owner and group permissions are
@@ -1822,21 +1832,21 @@ static void ls_child(int argc, char **argv)
 
       switch (sb.st_mode & S_IFMT)
         {
-        case S_IFDIR:
-          fileclass = "/";
-          break;
+          case S_IFDIR:
+            fileclass = "/";
+            break;
 
-        case S_IFSOCK:
-          fileclass = "=";
-          break;
+          case S_IFSOCK:
+            fileclass = "=";
+            break;
 
-        case S_IFLNK:
-          fileclass = "@";
-          break;
+          case S_IFLNK:
+            fileclass = "@";
+            break;
 
-        default:
-          fileclass = (sb.st_mode & S_IXOTH) ? "*" : "";
-          break;
+          default:
+            fileclass = (sb.st_mode & S_IXOTH) ? "*" : "";
+            break;
         }
 
       /* And print. */
@@ -2104,16 +2114,16 @@ static int sockaddr_check(httpd_sockaddr *sap)
 {
   switch (sap->sin_family)
     {
-    case AF_INET:
-      return 1;
+      case AF_INET:
+        return 1;
 
 #ifdef CONFIG_NET_IPv6
-    case AF_INET6:
-      return 1;
+      case AF_INET6:
+        return 1;
 #endif
 
-    default:
-      return 0;
+      default:
+        return 0;
     }
 }
 #endif /* CONFIG_DEBUG_FEATURES_FEATURES */
@@ -2122,16 +2132,16 @@ static size_t sockaddr_len(httpd_sockaddr *sap)
 {
   switch (sap->sin_family)
     {
-    case AF_INET:
-      return sizeof(struct sockaddr_in);
+      case AF_INET:
+        return sizeof(struct sockaddr_in);
 
 #ifdef CONFIG_NET_IPv6
-    case AF_INET6:
-      return sizeof(struct sockaddr_in6);
+      case AF_INET6:
+        return sizeof(struct sockaddr_in6);
 #endif
 
-    default:
-      break;
+      default:
+        break;
     }
 
   return 0;
@@ -2216,7 +2226,7 @@ void httpd_write_response(httpd_conn *hc)
 
   if (main_thread != gettid())
     {
-       httpd_clear_ndelay(hc->conn_fd);
+      httpd_clear_ndelay(hc->conn_fd);
     }
 
   /* Send the response, if necessary. */
@@ -2240,7 +2250,9 @@ void httpd_set_ndelay(int fd)
     {
       newflags = flags | (int)O_NDELAY;
       if (newflags != flags)
-        fcntl(fd, F_SETFL, newflags);
+        {
+          fcntl(fd, F_SETFL, newflags);
+        }
     }
 }
 
@@ -2312,17 +2324,17 @@ const char *httpd_method_str(int method)
 {
   switch (method)
     {
-    case METHOD_GET:
-      return "GET";
+      case METHOD_GET:
+        return "GET";
 
-    case METHOD_HEAD:
-      return "HEAD";
+      case METHOD_HEAD:
+        return "HEAD";
 
-    case METHOD_POST:
-      return "POST";
+      case METHOD_POST:
+        return "POST";
 
-    default:
-      return "UNKNOWN";
+      default:
+        return "UNKNOWN";
     }
 }
 
@@ -2461,201 +2473,203 @@ int httpd_got_request(httpd_conn *hc)
       c = hc->read_buf[hc->checked_idx];
       switch (hc->checked_state)
         {
-        case CHST_FIRSTWORD:
-          switch (c)
-            {
-            case ' ':
-            case '\t':
-              hc->checked_state = CHST_FIRSTWS;
-              break;
-
-            case '\012':
-            case '\015':
-              hc->checked_state = CHST_BOGUS;
-              return GR_BAD_REQUEST;
-            }
-          break;
-
-        case CHST_FIRSTWS:
-          switch (c)
-            {
-            case ' ':
-            case '\t':
-              break;
-
-            case '\012':
-            case '\015':
-              hc->checked_state = CHST_BOGUS;
-              return GR_BAD_REQUEST;
-
-            default:
-              hc->checked_state = CHST_SECONDWORD;
-              break;
-            }
-          break;
-
-        case CHST_SECONDWORD:
-          switch (c)
-            {
-            case ' ':
-            case '\t':
-              hc->checked_state = CHST_SECONDWS;
-              break;
-
-            case '\012':
-            case '\015':
-
-              /* The first line has only two words - an HTTP/0.9 request. */
-
-              return GR_GOT_REQUEST;
-            }
-          break;
-
-        case CHST_SECONDWS:
-          switch (c)
-            {
-            case ' ':
-            case '\t':
-              break;
-
-            case '\012':
-            case '\015':
-              hc->checked_state = CHST_BOGUS;
-              return GR_BAD_REQUEST;
+          case CHST_FIRSTWORD:
+            switch (c)
+              {
+                case ' ':
+                case '\t':
+                  hc->checked_state = CHST_FIRSTWS;
+                  break;
+
+                case '\012':
+                case '\015':
+                  hc->checked_state = CHST_BOGUS;
+                  return GR_BAD_REQUEST;
+              }
+            break;
+
+          case CHST_FIRSTWS:
+            switch (c)
+              {
+                case ' ':
+                case '\t':
+                  break;
+
+                case '\012':
+                case '\015':
+                  hc->checked_state = CHST_BOGUS;
+                  return GR_BAD_REQUEST;
+
+                default:
+                  hc->checked_state = CHST_SECONDWORD;
+                  break;
+              }
+            break;
+
+          case CHST_SECONDWORD:
+            switch (c)
+              {
+                case ' ':
+                case '\t':
+                  hc->checked_state = CHST_SECONDWS;
+                  break;
+
+                case '\012':
+                case '\015':
+
+                  /* The first line has only two words - an HTTP/0.9
+                   * request.
+                   */
+
+                  return GR_GOT_REQUEST;
+              }
+            break;
+
+          case CHST_SECONDWS:
+            switch (c)
+              {
+                case ' ':
+                case '\t':
+                  break;
+
+                case '\012':
+                case '\015':
+                  hc->checked_state = CHST_BOGUS;
+                  return GR_BAD_REQUEST;
+
+                default:
+                  hc->checked_state = CHST_THIRDWORD;
+                  break;
+              }
+            break;
+
+          case CHST_THIRDWORD:
+            switch (c)
+              {
+                case ' ':
+                case '\t':
+                  hc->checked_state = CHST_THIRDWS;
+                  break;
+
+                case '\012':
+                  hc->checked_state = CHST_LF;
+                  break;
+
+                case '\015':
+                  hc->checked_state = CHST_CR;
+                  break;
+              }
+            break;
+
+          case CHST_THIRDWS:
+            switch (c)
+              {
+                case ' ':
+                case '\t':
+                  break;
+
+                case '\012':
+                  hc->checked_state = CHST_LF;
+                  break;
+
+                case '\015':
+                  hc->checked_state = CHST_CR;
+                  break;
+
+                default:
+                  hc->checked_state = CHST_BOGUS;
+                  return GR_BAD_REQUEST;
+              }
+            break;
+
+          case CHST_LINE:
+            switch (c)
+              {
+                case '\012':
+                  hc->checked_state = CHST_LF;
+                  break;
+
+                case '\015':
+                  hc->checked_state = CHST_CR;
+                  break;
+              }
+            break;
+
+          case CHST_LF:
+            switch (c)
+              {
+                case '\012':
+
+                  /* Two newlines in a row - a blank line - end of request. */
+
+                  return GR_GOT_REQUEST;
+
+                case '\015':
+                  hc->checked_state = CHST_CR;
+                  break;
+
+                default:
+                  hc->checked_state = CHST_LINE;
+                  break;
+              }
+            break;
+
+          case CHST_CR:
+            switch (c)
+              {
+                case '\012':
+                  hc->checked_state = CHST_CRLF;
+                  break;
+
+                case '\015':
+
+                  /* Two returns in a row - end of request. */
+
+                  return GR_GOT_REQUEST;
+
+                default:
+                  hc->checked_state = CHST_LINE;
+                  break;
+              }
+            break;
+
+          case CHST_CRLF:
+            switch (c)
+              {
+                case '\012':
+
+                  /* Two newlines in a row - end of request. */
+
+                  return GR_GOT_REQUEST;
+
+                case '\015':
+                  hc->checked_state = CHST_CRLFCR;
+                  break;
+
+                default:
+                  hc->checked_state = CHST_LINE;
+                  break;
+              }
+            break;
 
-            default:
-              hc->checked_state = CHST_THIRDWORD;
-              break;
-            }
-          break;
-
-        case CHST_THIRDWORD:
-          switch (c)
-            {
-            case ' ':
-            case '\t':
-              hc->checked_state = CHST_THIRDWS;
-              break;
-
-            case '\012':
-              hc->checked_state = CHST_LF;
-              break;
-
-            case '\015':
-              hc->checked_state = CHST_CR;
-              break;
-            }
-          break;
-
-        case CHST_THIRDWS:
-          switch (c)
-            {
-            case ' ':
-            case '\t':
-              break;
-
-            case '\012':
-              hc->checked_state = CHST_LF;
-              break;
-
-            case '\015':
-              hc->checked_state = CHST_CR;
-              break;
-
-            default:
-              hc->checked_state = CHST_BOGUS;
-              return GR_BAD_REQUEST;
-            }
-          break;
-
-        case CHST_LINE:
-          switch (c)
-            {
-            case '\012':
-              hc->checked_state = CHST_LF;
-              break;
-
-            case '\015':
-              hc->checked_state = CHST_CR;
-              break;
-            }
-          break;
-
-       case CHST_LF:
-          switch (c)
-            {
-            case '\012':
-
-              /* Two newlines in a row - a blank line - end of request. */
-
-              return GR_GOT_REQUEST;
-
-            case '\015':
-              hc->checked_state = CHST_CR;
-              break;
-
-            default:
-              hc->checked_state = CHST_LINE;
-              break;
-            }
-          break;
-
-        case CHST_CR:
-          switch (c)
-            {
-            case '\012':
-              hc->checked_state = CHST_CRLF;
-              break;
-
-            case '\015':
-
-              /* Two returns in a row - end of request. */
-
-              return GR_GOT_REQUEST;
-
-            default:
-              hc->checked_state = CHST_LINE;
-              break;
-            }
-          break;
-
-        case CHST_CRLF:
-          switch (c)
-            {
-            case '\012':
+          case CHST_CRLFCR:
+            switch (c)
+              {
+                case '\012':
+                case '\015':
 
-              /* Two newlines in a row - end of request. */
+                  /* Two CRLFs or two CRs in a row - end of request. */
 
-              return GR_GOT_REQUEST;
+                  return GR_GOT_REQUEST;
 
-            case '\015':
-              hc->checked_state = CHST_CRLFCR;
-              break;
-
-            default:
-              hc->checked_state = CHST_LINE;
-              break;
-            }
-          break;
-
-        case CHST_CRLFCR:
-          switch (c)
-            {
-            case '\012':
-            case '\015':
-
-              /* Two CRLFs or two CRs in a row - end of request. */
-
-              return GR_GOT_REQUEST;
+                default:
+                  hc->checked_state = CHST_LINE;
+                  break;
+              }
+            break;
 
-            default:
-              hc->checked_state = CHST_LINE;
-              break;
-            }
-          break;
-
-        case CHST_BOGUS:
-          return GR_BAD_REQUEST;
+          case CHST_BOGUS:
+            return GR_BAD_REQUEST;
         }
     }
 
@@ -2915,7 +2929,7 @@ int httpd_parse_request(httpd_conn *hc)
                                     strlen(cp));
                 }
 
-             strlcpy(hc->accepte, cp, hc->maxaccepte + 1);
+              strlcpy(hc->accepte, cp, hc->maxaccepte + 1);
             }
           else if (strncasecmp(buf, "Accept-Language:", 16) == 0)
             {
@@ -2945,6 +2959,7 @@ int httpd_parse_request(httpd_conn *hc)
               if (strchr(buf, ',') == NULL)
                 {
                   char *cp_dash;
+
                   cp = strpbrk(buf, "=");
                   if (cp)
                     {
@@ -2963,7 +2978,9 @@ int httpd_parse_request(httpd_conn *hc)
                             {
                               hc->range_end = atoll(cp_dash + 1);
                               if (hc->range_end < 0)
-                                hc->range_end = -1;
+                                {
+                                  hc->range_end = -1;
+                                }
                             }
                         }
                     }
@@ -3035,7 +3052,9 @@ int httpd_parse_request(httpd_conn *hc)
                    strncasecmp(buf, "User:", 5) == 0 ||
                    strncasecmp(buf, "Via:", 4) == 0 ||
                    strncasecmp(buf, "X-", 2) == 0)
-            ;                   /* ignore */
+            {
+              /* ignore */
+            }
           else
             {
               nwarn("WARNING: unknown request header: %s\n", buf);
@@ -3136,6 +3155,7 @@ int httpd_parse_request(httpd_conn *hc)
   if (hc->pathinfo[0] != '\0')
     {
       int i;
+
       i = strlen(hc->origfilename) - strlen(hc->pathinfo);
       if (i > 0 && strcmp(&hc->origfilename[i], hc->pathinfo) == 0)
         {
@@ -3370,7 +3390,7 @@ int httpd_start_request(httpd_conn *hc, struct timeval 
*nowp)
       return -1;
 #endif /* CONFIG_THTTPD_GENERATE_INDICES */
 
-    got_one:
+got_one:
 
       /* Got an index file.  Expand again.  More pathinfo means
        * something went wrong.
diff --git a/netutils/thttpd/thttpd.c b/netutils/thttpd/thttpd.c
index f7de45177..e0e59d68c 100644
--- a/netutils/thttpd/thttpd.c
+++ b/netutils/thttpd/thttpd.c
@@ -156,14 +156,15 @@ static void shut_down(void)
 
   if (hs)
     {
-      httpd_server *ths = hs;
+      httpd_server *server = hs;
+
       hs = NULL;
-      if (ths->listen_fd != -1)
+      if (server->listen_fd != -1)
         {
-          fdwatch_del_fd(fw, ths->listen_fd);
+          fdwatch_del_fd(fw, server->listen_fd);
         }
 
-      httpd_terminate(ths);
+      httpd_terminate(server);
     }
 
   tmr_destroy();
@@ -217,21 +218,21 @@ static int handle_newconnect(FAR struct timeval *tv, int 
listen_fd)
 
       switch (httpd_get_conn(hs, listen_fd, conn->hc))
         {
-          /* Some error happened.  Run the timers, then the  existing
-           * connections.  Maybe the error will clear.
-           */
+            /* Some error happened.  Run the timers, then the  existing
+             * connections.  Maybe the error will clear.
+             */
 
-        case GC_FAIL:
-          tmr_run(tv);
-          return -1;
+          case GC_FAIL:
+            tmr_run(tv);
+            return -1;
 
-          /* No more connections to accept for now */
+            /* No more connections to accept for now */
 
-        case GC_NO_MORE:
-          return 0;
+          case GC_NO_MORE:
+            return 0;
 
-        default:
-          break;
+          default:
+            break;
         }
 
       ninfo("New connection fd %d\n", conn->hc->conn_fd);
@@ -309,11 +310,11 @@ static void handle_read(struct connect_s *conn, struct 
timeval *tv)
 
   switch (httpd_got_request(hc))
     {
-    case GR_NO_REQUEST:
-      return;
-    case GR_BAD_REQUEST:
-     BADREQUEST("httpd_got_request");
-     goto errout_with_400;
+      case GR_NO_REQUEST:
+        return;
+      case GR_BAD_REQUEST:
+        BADREQUEST("httpd_got_request");
+        goto errout_with_400;
     }
 
   /* Yes.  Try parsing and resolving it */
@@ -375,10 +376,10 @@ static void handle_read(struct connect_s *conn, struct 
timeval *tv)
   actual = lseek(hc->file_fd, conn->offset, SEEK_SET);
   if (actual != conn->offset)
     {
-       nerr("ERROR: fseek to %jd failed: offset=%jd errno=%d\n",
-            (intmax_t)conn->offset, (intmax_t)actual, errno);
-       BADREQUEST("lseek");
-       goto errout_with_400;
+      nerr("ERROR: fseek to %jd failed: offset=%jd errno=%d\n",
+           (intmax_t)conn->offset, (intmax_t)actual, errno);
+      BADREQUEST("lseek");
+      goto errout_with_400;
     }
 
   /* We have a valid connection and a file to send to it */
@@ -602,27 +603,27 @@ static void idle(clientdata client_data, struct timeval 
*nowp)
       conn = &connects[cnum];
       switch (conn->conn_state)
         {
-        case CNST_READING:
-          if (nowp->tv_sec - conn->active_at >=
-              CONFIG_THTTPD_IDLE_READ_LIMIT_SEC)
-            {
-              nerr("ERROR: %s connection timed out reading\n",
-                   httpd_ntoa(&conn->hc->client_addr));
-              httpd_send_err(conn->hc, 408, httpd_err408title, "",
-                             httpd_err408form, "");
-              finish_connection(conn, nowp);
-            }
-          break;
-
-        case CNST_SENDING:
-          if (nowp->tv_sec - conn->active_at >=
-              CONFIG_THTTPD_IDLE_SEND_LIMIT_SEC)
-            {
-              nerr("ERROR: %s connection timed out sending\n",
-                   httpd_ntoa(&conn->hc->client_addr));
-              clear_connection(conn, nowp);
-            }
-          break;
+          case CNST_READING:
+            if (nowp->tv_sec - conn->active_at >=
+                CONFIG_THTTPD_IDLE_READ_LIMIT_SEC)
+              {
+                nerr("ERROR: %s connection timed out reading\n",
+                     httpd_ntoa(&conn->hc->client_addr));
+                httpd_send_err(conn->hc, 408, httpd_err408title, "",
+                               httpd_err408form, "");
+                finish_connection(conn, nowp);
+              }
+            break;
+
+          case CNST_SENDING:
+            if (nowp->tv_sec - conn->active_at >=
+                CONFIG_THTTPD_IDLE_SEND_LIMIT_SEC)
+              {
+                nerr("ERROR: %s connection timed out sending\n",
+                     httpd_ntoa(&conn->hc->client_addr));
+                clear_connection(conn, nowp);
+              }
+            break;
         }
     }
 }
diff --git a/netutils/thttpd/thttpd_cgi.c b/netutils/thttpd/thttpd_cgi.c
index a0cacf03e..a815c8e1f 100644
--- a/netutils/thttpd/thttpd_cgi.c
+++ b/netutils/thttpd/thttpd_cgi.c
@@ -578,58 +578,58 @@ static inline int cgi_interpose_output(struct cgi_conn_s 
*cc)
           ninfo("Status: %d\n", status);
           switch (status)
             {
-            case 200:
-              title = ok200title;
-              break;
+              case 200:
+                title = ok200title;
+                break;
 
-            case 302:
-              title = err302title;
-              break;
+              case 302:
+                title = err302title;
+                break;
 
-            case 304:
-              title = err304title;
-              break;
+              case 304:
+                title = err304title;
+                break;
 
-            case 400:
-              BADREQUEST("status");
-              title = httpd_err400title;
-              break;
+              case 400:
+                BADREQUEST("status");
+                title = httpd_err400title;
+                break;
 
 #ifdef CONFIG_THTTPD_AUTH_FILE
-            case 401:
-              title = err401title;
-              break;
+              case 401:
+                title = err401title;
+                break;
 #endif
 
-            case 403:
-              title = err403title;
-              break;
+              case 403:
+                title = err403title;
+                break;
 
-            case 404:
-              title = err404title;
-             break;
+              case 404:
+                title = err404title;
+                break;
 
-            case 408:
-              title = httpd_err408title;
-              break;
+              case 408:
+                title = httpd_err408title;
+                break;
 
-            case 500:
-              INTERNALERROR("status");
-              title = err500title;
-              break;
+              case 500:
+                INTERNALERROR("status");
+                title = err500title;
+                break;
 
-            case 501:
-              NOTIMPLEMENTED("status");
-              title = err501title;
-              break;
+              case 501:
+                NOTIMPLEMENTED("status");
+                title = err501title;
+                break;
 
-            case 503:
-              title = httpd_err503title;
-              break;
+              case 503:
+                title = httpd_err503title;
+                break;
 
-            default:
-              title = "Something";
-              break;
+              default:
+                title = "Something";
+                break;
             }
 
           snprintf(cc->inbuf.buffer, CONFIG_THTTPD_CGIINBUFFERSIZE,
@@ -695,9 +695,9 @@ static inline int cgi_interpose_output(struct cgi_conn_s 
*cc)
             }
           else
             {
-               /* Forward the data from the CGI program to the client */
+              /* Forward the data from the CGI program to the client */
 
-             httpd_write(cc->connfd, cc->inbuf.buffer, nbytes_read);
+              httpd_write(cc->connfd, cc->inbuf.buffer, nbytes_read);
             }
         }
         break;

Reply via email to