httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: Crazy slowloris mitigation patch
Date Mon, 19 Oct 2009 02:01:39 GMT
On Mon, 2009-10-19 at 12:27 +1100, Bojan Smojver wrote:
> +#ifndef NO_USE_SIGACTION
> +static void close_client_socket(int sig, siginfo_t *info, void
> *context)
> +#else
> +static void close_client_socket(int sig)
> +#endif
> +{
> +    if (client_socket != -1) {
> +#ifndef NO_USE_SIGACTION
> +        if (info->si_pid == getppid()) {
> +#endif
> +            close(client_socket);
> +            client_socket = -1;
> +#ifndef NO_USE_SIGACTION
> +        }
> +        else {
> +            clean_child_exit(0);
> +        }
> +#endif
> +    }
> +}

Actually, this should be:

+#ifndef NO_USE_SIGACTION
+static void close_client_socket(int sig, siginfo_t *info, void
*context)
+#else
+static void close_client_socket(int sig)
+#endif
+{
+#ifndef NO_USE_SIGACTION
+    if (info->si_pid == getppid()) {
+#endif
+        if (client_socket != -1) {
+            close(client_socket);
+            client_socket = -1;
+        }
+#ifndef NO_USE_SIGACTION
+    }
+    else {
+        clean_child_exit(0);
+    }
+#endif
+}

-- 
Bojan


Mime
View raw message