-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.144 2017/06/08 13:04:34 fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.145 2017/06/08 13:04:56 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
    do
    {
 #if defined(FEATURE_ACCEPT_FILTER) && defined(SO_ACCEPTFILTER)
-      struct accept_filter_arg af_options;
-      bzero(&af_options, sizeof(af_options));
-      strlcpy(af_options.af_name, "httpready", sizeof(af_options.af_name));
-      setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &af_options, sizeof(af_options));
+      if (csp->config->enable_accept_filter)
+      {
+         struct accept_filter_arg af_options;
+         bzero(&af_options, sizeof(af_options));
+         strlcpy(af_options.af_name, "httpready", sizeof(af_options.af_name));
+         if (setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &af_options,
+            sizeof(af_options)))
+         {
+            log_error(LOG_LEVEL_ERROR,
+               "Enabling accept filter for socket %d failed: %E", fd);
+         }
+      }
 #endif
       afd = accept (fd, (struct sockaddr *) &client, &c_length);
    } while (afd < 0 && errno == EINTR);
 
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.162 2017/06/04 14:42:32 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.163 2017/06/26 12:09:56 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
 #define hash_debug                            78263U /* "debug" */
 #define hash_default_server_timeout      2530089913U /* "default-server-timeout" */
 #define hash_deny_access                 1227333715U /* "deny-access" */
+#define hash_enable_accept_filter        2909040407U /* "enable-accept-filter" */
 #define hash_enable_edit_actions         2517097536U /* "enable-edit-actions" */
 #define hash_enable_compression          3943696946U /* "enable-compression" */
 #define hash_enable_proxy_authentication_forwarding 4040610791U /* enable-proxy-authentication-forwarding */
    config->client_tag_lifetime       = 60;
 #endif
    config->trust_x_forwarded_for     = 0;
+#if defined(FEATURE_ACCEPT_FILTER) && defined(SO_ACCEPTFILTER)
+   config->enable_accept_filter      = 0;
+#endif
    config->trusted_cgi_referrer      = NULL;
    /*
     * 128 client sockets ought to be enough for everybody who can't
             break;
 #endif /* def FEATURE_ACL */
 
+#if defined(FEATURE_ACCEPT_FILTER) && defined(SO_ACCEPTFILTER)
+/* *************************************************************************
+ * enable-accept-filter 0|1
+ * *************************************************************************/
+         case hash_enable_accept_filter :
+            config->enable_accept_filter = parse_toggle_state(cmd, arg);
+            break;
+#endif /* defined(FEATURE_ACCEPT_FILTER) && defined(SO_ACCEPTFILTER) */
+
 /* *************************************************************************
  * enable-edit-actions 0|1
  * *************************************************************************/
 
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.220 2017/02/20 13:44:32 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.221 2017/05/29 10:02:11 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
    /** Size of the receive buffer */
    size_t receive_buffer_size;
 
+   /** Use accf_http(4) if available */
+   int enable_accept_filter;
+
 #ifdef FEATURE_TRUST
 
    /** The file name of the trust file. */