You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dirk-Willem van Gulik <di...@webweaving.org> on 2005/07/31 17:58:55 UTC

HTTP Accept filters on freebsd

After struggling for hours - and not 'getting' why my ssl authentication
broke :-) would something like the patch below be of use ?

All this does is to check if the kernel has support for
httpready/dataready filtering. Though I guess an even better way may be to
have a config directive and an -error- if the config directive is on and
the kernelmodule fials.

Dw


Index: core.c
===================================================================
--- core.c      (revision 225876)
+++ core.c      (working copy)
@@ -478,9 +478,18 @@
 #endif
 #endif
 #endif
-    apr_table_set(conf->accf_map, "http", ACCEPT_FILTER_NAME);
-    apr_table_set(conf->accf_map, "https", "dataready");
+
+#ifdef __FreeBSD_version
+#ifdef ACCEPT_FILTER_SYSCTL_NAME
+{
+    #define ACCEPT_FILTER_SYSCTL_NAME
"net.inet.accf.http.parsehttpversion"
+    unsigned int version;
+    if ((sysctlbyname(ACCEPT_FILTER_SYSCTL_NAME, (void *)&version,
sizeof(version), NULL, 0)) || (version<1))
+    {
+
+         ap_log_perror(APLOG_MARK, APLOG_STARTUP, 0,
+                         cmd->pool,
+                         "Warning: "Kernel module accf_http not loaded; "
+                          ACCEPT_FILTER_NAME " disabled.");
+    } else {
+ #endif
+ #endif
+    {
+       apr_table_set(conf->accf_map, "http", ACCEPT_FILTER_NAME);
+       apr_table_set(conf->accf_map, "https", "dataready");
+    }
+#endif

     conf->trace_enable = AP_TRACE_UNSET;


Re: HTTP Accept filters on freebsd

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Sun, 31 Jul 2005, Brian Candler wrote:

> #define LOG_WARNING     4       /* warning conditions */
> #define LOG_INFO        6       /* informational */
>
> So OR'ing them together forces it to LOG_INFO. I think WARNING is probably a
> more appropriate level for this message.

+1 - that makes it visible enouhg. And until we have a switch in the
config to switch it on/off - no need to have it an error or beeing fatal.

Dw.

Re: HTTP Accept filters on freebsd

Posted by Brian Candler <B....@pobox.com>.
On Sun, Jul 31, 2005 at 08:37:02PM +0100, Brian Candler wrote:
> Hmm, actually it's a bit strange:
> 
>                 ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_INFO, server_conf,
>                          "make_sock: for %s, setsockopt: (SO_ACCEPTFILTER)", addr);
> 
> It seems to be undecided as to whether it's a Warning or an Info message!

$ egrep 'LOG_(WARNING|INFO)' /usr/include/syslog.h  
#define LOG_WARNING     4       /* warning conditions */
#define LOG_INFO        6       /* informational */

So OR'ing them together forces it to LOG_INFO. I think WARNING is probably a
more appropriate level for this message.

Regards,

Brian.

Re: HTTP Accept filters on freebsd

Posted by Brian Candler <B....@pobox.com>.
On Sun, Jul 31, 2005 at 08:58:55AM -0700, Dirk-Willem van Gulik wrote:
> After struggling for hours - and not 'getting' why my ssl authentication
> broke :-) would something like the patch below be of use ?
> 
> All this does is to check if the kernel has support for
> httpready/dataready filtering.

And then just give a warning?

FWIW, I have been building Apache 1.3 from ports under FreeBSD 5.4 over the
last few days, and without any additional patches I was getting warnings
about ACCEPT_FILTER (which went away after I did kldload accf_http)

I just tried this again, and it seems you have to set "LogLevel info" to get
this message (the standard httpd.conf has "LogLevel warn"). Then you get:

# tail /var/log/httpd-error.log 
...
[Sun Jul 31 20:31:45 2005] [info] (2)No such file or directory: make_sock: for port 443, setsockopt: (SO_ACCEPTFILTER)
[Sun Jul 31 20:31:45 2005] [info] (2)No such file or directory: make_sock: for port 80, setsockopt: (SO_ACCEPTFILTER)

Maybe if this existing message were reported at a higher level that would be
sufficient?

Hmm, actually it's a bit strange:

                ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_INFO, server_conf,
                         "make_sock: for %s, setsockopt: (SO_ACCEPTFILTER)", addr);

It seems to be undecided as to whether it's a Warning or an Info message!

Regards,

Brian.