You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Joe Orton <jo...@redhat.com> on 2004/12/13 13:26:17 UTC
Re: svn commit: r111596 - /httpd/httpd/trunk/CHANGES /httpd/httpd/trunk/server/listen.c
On Sat, Dec 11, 2004 at 09:53:17AM -0000, Paul Querna wrote:
> Author: pquerna
> Date: Sat Dec 11 01:53:16 2004
> New Revision: 111596
>
> URL: http://svn.apache.org/viewcvs?view=rev&rev=111596
> Log:
> * Add bits to use APR_TCP_DEFER_ACCEPT
> * Log Warnings when adding defer accept or an accept filter fails.
Hmmm - t/protocol/nntp-lite.t now hangs in the test suite on Linux. I
suppose that doing a deferred accept is fundamentally incompatible with
protocols like NNTP where the client will connect() then read() a banner
line before writing any data. Did this test work on FreeBSD before,
does anyone know?
> --- httpd/httpd/trunk/server/listen.c (original)
> +++ httpd/httpd/trunk/server/listen.c Sat Dec 11 01:53:16 2004
> @@ -164,7 +164,20 @@
> #endif
> #endif
> #endif
> - apr_socket_accept_filter(s, ACCEPT_FILTER_NAME, "");
> + stat = apr_socket_accept_filter(s, ACCEPT_FILTER_NAME, "");
> + if (stat != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(stat)) {
> + ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p,
> + "Failed to enable the '%s' Accept Filter",
> + ACCEPT_FILTER_NAME);
> + }
> +#else
> +#ifdef APR_TCP_DEFER_ACCEPT
> + stat = apr_socket_opt_set(s, APR_TCP_DEFER_ACCEPT, 1);
> + if (stat != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(stat)) {
> + ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p,
> + "Failed to enable APR_TCP_DEFER_ACCEPT");
> + }
> +#endif
> #endif
>
> server->sd = s;
Re: svn commit: r111596 - /httpd/httpd/trunk/CHANGES /httpd/httpd/trunk/server/listen.c
Posted by Paul Querna <ch...@force-elite.com>.
Joe Orton wrote:
> On Sat, Dec 11, 2004 at 09:53:17AM -0000, Paul Querna wrote:
>
>>Author: pquerna
>>Date: Sat Dec 11 01:53:16 2004
>>New Revision: 111596
>>
>>URL: http://svn.apache.org/viewcvs?view=rev&rev=111596
>>Log:
>>* Add bits to use APR_TCP_DEFER_ACCEPT
>>* Log Warnings when adding defer accept or an accept filter fails.
>
>
> Hmmm - t/protocol/nntp-lite.t now hangs in the test suite on Linux. I
> suppose that doing a deferred accept is fundamentally incompatible with
> protocols like NNTP where the client will connect() then read() a banner
> line before writing any data. Did this test work on FreeBSD before,
> does anyone know?
I just tested it here, and it Fails on FreeBSD if accf_http is loaded in
the kernel.
Perhaps both the accept filter and defer accept code belongs somewhere
in modules/http/* ?
>>--- httpd/httpd/trunk/server/listen.c (original)
>>+++ httpd/httpd/trunk/server/listen.c Sat Dec 11 01:53:16 2004
>>@@ -164,7 +164,20 @@
>> #endif
>> #endif
>> #endif
>>- apr_socket_accept_filter(s, ACCEPT_FILTER_NAME, "");
>>+ stat = apr_socket_accept_filter(s, ACCEPT_FILTER_NAME, "");
>>+ if (stat != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(stat)) {
>>+ ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p,
>>+ "Failed to enable the '%s' Accept Filter",
>>+ ACCEPT_FILTER_NAME);
>>+ }
>>+#else
>>+#ifdef APR_TCP_DEFER_ACCEPT
>>+ stat = apr_socket_opt_set(s, APR_TCP_DEFER_ACCEPT, 1);
>>+ if (stat != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(stat)) {
>>+ ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p,
>>+ "Failed to enable APR_TCP_DEFER_ACCEPT");
>>+ }
>>+#endif
>> #endif
>>
>> server->sd = s;
>
>