* Got HTTPS to work with Mozilla (by twiddling stuff that I still don't
[citadel.git] / webcit / webserver.c
index 1c308dc0c3db2ea5c030ce4c549be44e6caade29..07e10504fb792039a601e31c73d89e05d62df5ff 100644 (file)
@@ -395,17 +395,18 @@ void worker_entry(void) {
                        if (is_https) {
                                if (starttls(ssock) != 0) {
                                        fail_this_transaction = 1;
+                                       close(ssock);
                                }
                        }
 #endif
 
-                       /* Perform an HTTP transaction... */
                        if (fail_this_transaction == 0) {
+                               /* Perform an HTTP transaction... */
                                context_loop(ssock);
+                               /* ...and close the socket. */
+                               lingering_close(ssock);
                        }
 
-                       /* ...and close the socket. */
-                       lingering_close(ssock);
                }
 
        } while (!time_to_die);