From: <no...@so...> - 2009-12-16 08:35:57
|
Update of /cvsroot/ijbswa/current In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6898 Modified Files: acconfig.h configure.in jbsockets.c Log Message: Add optional support for FreeBSD's accf_http(9). Index: acconfig.h =================================================================== RCS file: /cvsroot/ijbswa/current/acconfig.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- acconfig.h 9 Oct 2009 16:51:52 -0000 1.39 +++ acconfig.h 16 Dec 2009 08:35:47 -0000 1.40 @@ -86,6 +86,11 @@ #undef FEATURE_ACL /* + * Allow Privoxy to use accf_http(9) if supported. + */ +#undef FEATURE_ACCEPT_FILTER + +/* * Enables the web-based configuration (actionsfile) editor. If you * have a shared proxy, you might want to turn this off. */ Index: configure.in =================================================================== RCS file: /cvsroot/ijbswa/current/configure.in,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- configure.in 7 Nov 2009 13:44:43 -0000 1.140 +++ configure.in 16 Dec 2009 08:35:47 -0000 1.141 @@ -848,6 +848,12 @@ AC_DEFINE(FEATURE_EXTENDED_HOST_PATTERNS) fi]) +AC_ARG_ENABLE(accept-filter, +[ --enable-accept-filter Try to use accf_http(9) if supported.], +[if test $enableval = yes; then + AC_DEFINE(FEATURE_ACCEPT_FILTER) +fi]) + dnl pcre/pcrs is needed for CGI anyway, so dnl the choice is only between static and dnl dynamic: Index: jbsockets.c =================================================================== RCS file: /cvsroot/ijbswa/current/jbsockets.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- jbsockets.c 15 Dec 2009 17:51:14 -0000 1.70 +++ jbsockets.c 16 Dec 2009 08:35:47 -0000 1.71 @@ -1042,6 +1042,12 @@ #else 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)); +#endif afd = accept (fd, (struct sockaddr *) &client, &c_length); } while (afd < 1 && errno == EINTR); if (afd < 0) |