Don't use goto readtop:
authorueno <ueno>
Fri, 11 Aug 2006 02:46:02 +0000 (02:46 +0000)
committerueno <ueno>
Fri, 11 Aug 2006 02:46:02 +0000 (02:46 +0000)
starttls.c

index 52a2329..259960a 100644 (file)
@@ -251,21 +251,17 @@ main (argc, argv)
       if (readfds[0].revents & POLLIN)
        {
          nbuffer = read (in, buffer, sizeof buffer -1);
-
          if (nbuffer == 0)
            goto finish;
          redirect (tls_fd, buffer, nbuffer, tls_write);
        }
       if (readfds[1].revents & POLLIN)
-       {
-readtop:
-         nbuffer = tls_read(tls_fd, buffer, sizeof buffer -1);
+       do {
+         nbuffer = tls_read (tls_fd, buffer, sizeof buffer -1);
          if (nbuffer == 0)
            goto finish;
          redirect (out, buffer, nbuffer, write);
-         if (tls_pending())
-           goto readtop;
-       }
+       } while (tls_pending ());
     }
 
  finish: