You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Philippe M. Chiasson" <go...@cpan.org> on 2003/02/03 13:44:40 UTC
Apache, UDP and lingering_close
A while ago, in August, Ryan Bloom, regarding UDP support in apache,
was saying:
> The two places that still need to be fixed for this to work are adding
> sockets to the listen_rec list and the lingering_close logic. Both of
> these can be fixed by adding a hook to the server. Adding listeners
> to the listen_rec list _may_ be possible in the open_logs phase, which
> is where the core server does it, but I haven't tried to implement
> that yet. If it can be doine in the open_logs phase, then you won't
> need another hook for it. The lingering close logic should just be
> replaced by a simple hook that the core server calls. The core can
> add lingering_close to that hook, and everything should continue to
> work. [1]
I've been working on mod_udp for the last week or so and got everything
working in a modular way. It basically works fine.
The only thing left for me to get around is the lingering_close logic.
But I am not sure I understand what Ryan is suggesting. Currently, the
lingering_close is called after process_connection in the different
mpms. What I can see as possible is to create a new hook
'post_connection' and have core.c register ap_lingering_close in there.
Then, mod_udp, could push a no-op handler on top of it and short-circuit
out.
Another simpler option I can see, would be to add another function
pointer to ap_listen_t for the lingering close function.
Any thoughts ? Once this problem is solved, I will be happy to release
mod_udp for apache ;-)
1-http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=102936520919151&w=2
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5
(122FF51B/C634E37B)
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so
ingenious.
perl
-e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
Re: Apache, UDP and lingering_close
Posted by "Philippe M. Chiasson" <go...@cpan.org>.
On Tue, 2003-02-04 at 09:05, Cliff Woolley wrote:
> On 4 Feb 2003, Philippe M. Chiasson wrote:
>
> > Ideally, I would initially package datagram-buckets with mod_udp itself.
> > Just gotta figure out how to create my own bucket type.
>
> It's no different than creating a bucket type in apr-util, really. Take a
> look at the ERROR buckets that Apache defines (see server/error_bucket.c
> and the related prototypes in include/http_protocol.h).
Thanks! I'll be looking into adding datagram-buckets (or whatever) in
the very near future.
> --Cliff
>
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5
(122FF51B/C634E37B)
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so
ingenious.
perl
-e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
Re: Apache, UDP and lingering_close
Posted by "Philippe M. Chiasson" <go...@cpan.org>.
On Tue, 2003-02-04 at 09:05, Cliff Woolley wrote:
> On 4 Feb 2003, Philippe M. Chiasson wrote:
>
> > Ideally, I would initially package datagram-buckets with mod_udp itself.
> > Just gotta figure out how to create my own bucket type.
>
> It's no different than creating a bucket type in apr-util, really. Take a
> look at the ERROR buckets that Apache defines (see server/error_bucket.c
> and the related prototypes in include/http_protocol.h).
Thanks! I'll be looking into adding datagram-buckets (or whatever) in
the very near future.
> --Cliff
>
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5
(122FF51B/C634E37B)
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so
ingenious.
perl
-e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
Re: Apache, UDP and lingering_close
Posted by Cliff Woolley <jw...@virginia.edu>.
On 4 Feb 2003, Philippe M. Chiasson wrote:
> Ideally, I would initially package datagram-buckets with mod_udp itself.
> Just gotta figure out how to create my own bucket type.
It's no different than creating a bucket type in apr-util, really. Take a
look at the ERROR buckets that Apache defines (see server/error_bucket.c
and the related prototypes in include/http_protocol.h).
--Cliff
Re: Apache, UDP and lingering_close
Posted by Cliff Woolley <jw...@virginia.edu>.
On 4 Feb 2003, Philippe M. Chiasson wrote:
> Ideally, I would initially package datagram-buckets with mod_udp itself.
> Just gotta figure out how to create my own bucket type.
It's no different than creating a bucket type in apr-util, really. Take a
look at the ERROR buckets that Apache defines (see server/error_bucket.c
and the related prototypes in include/http_protocol.h).
--Cliff
Re: Apache, UDP and lingering_close
Posted by "Philippe M. Chiasson" <go...@cpan.org>.
On Mon, 2003-02-03 at 23:20, Cliff Woolley wrote:
> On Mon, 3 Feb 2003, Philippe M. Chiasson wrote:
>
> > I've been working on mod_udp for the last week or so and got everything
> > working in a modular way. It basically works fine.
>
> Just one quick comment regarding the udp patches before I forget...
>
> One of the patches modified socket buckets to add a conditional into
> socket_bucket_read() to call apr_socket_recvfrom() instead of
> apr_socket_read() depending on the type of the socket. I get the strong
> feeling that we shouldn't try to mix UDP and TCP sockets into the same
> bucket type.
I partially shared that same feeling.
> The existing socket buckets should remain TCP only. UDP
> socket buckets can either be a separate entity in apr-util or mod_udp for
> Apache can provide them as a 3rd-party bucket type.
I can see how I could go and add a new bucket type to apr-util. But if
I wanted to add datagram-buckets to mod_udp or apache itself, I am not
sure how to get around doing that. Any pointers on this ?
> But in general, if
> you have to use a totally separate API out of APR to read from them, they
> should be a separate bucket type IMO.
I can now understand the reason for this.
Ideally, I would initially package datagram-buckets with mod_udp itself.
Just gotta figure out how to create my own bucket type.
Once again, pointers on how to make that work are welcome...
Thanks for the feedback!
> --Cliff
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5
(122FF51B/C634E37B)
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so
ingenious.
perl
-e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
Re: Apache, UDP and lingering_close
Posted by "Philippe M. Chiasson" <go...@cpan.org>.
On Mon, 2003-02-03 at 23:20, Cliff Woolley wrote:
> On Mon, 3 Feb 2003, Philippe M. Chiasson wrote:
>
> > I've been working on mod_udp for the last week or so and got everything
> > working in a modular way. It basically works fine.
>
> Just one quick comment regarding the udp patches before I forget...
>
> One of the patches modified socket buckets to add a conditional into
> socket_bucket_read() to call apr_socket_recvfrom() instead of
> apr_socket_read() depending on the type of the socket. I get the strong
> feeling that we shouldn't try to mix UDP and TCP sockets into the same
> bucket type.
I partially shared that same feeling.
> The existing socket buckets should remain TCP only. UDP
> socket buckets can either be a separate entity in apr-util or mod_udp for
> Apache can provide them as a 3rd-party bucket type.
I can see how I could go and add a new bucket type to apr-util. But if
I wanted to add datagram-buckets to mod_udp or apache itself, I am not
sure how to get around doing that. Any pointers on this ?
> But in general, if
> you have to use a totally separate API out of APR to read from them, they
> should be a separate bucket type IMO.
I can now understand the reason for this.
Ideally, I would initially package datagram-buckets with mod_udp itself.
Just gotta figure out how to create my own bucket type.
Once again, pointers on how to make that work are welcome...
Thanks for the feedback!
> --Cliff
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5
(122FF51B/C634E37B)
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so
ingenious.
perl
-e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
Re: Apache, UDP and lingering_close
Posted by Cliff Woolley <jw...@virginia.edu>.
On Mon, 3 Feb 2003, Philippe M. Chiasson wrote:
> I've been working on mod_udp for the last week or so and got everything
> working in a modular way. It basically works fine.
Just one quick comment regarding the udp patches before I forget...
One of the patches modified socket buckets to add a conditional into
socket_bucket_read() to call apr_socket_recvfrom() instead of
apr_socket_read() depending on the type of the socket. I get the strong
feeling that we shouldn't try to mix UDP and TCP sockets into the same
bucket type. The existing socket buckets should remain TCP only. UDP
socket buckets can either be a separate entity in apr-util or mod_udp for
Apache can provide them as a 3rd-party bucket type. But in general, if
you have to use a totally separate API out of APR to read from them, they
should be a separate bucket type IMO.
--Cliff
Re: Apache, UDP and lingering_close
Posted by Cliff Woolley <jw...@virginia.edu>.
On Mon, 3 Feb 2003, Philippe M. Chiasson wrote:
> I've been working on mod_udp for the last week or so and got everything
> working in a modular way. It basically works fine.
Just one quick comment regarding the udp patches before I forget...
One of the patches modified socket buckets to add a conditional into
socket_bucket_read() to call apr_socket_recvfrom() instead of
apr_socket_read() depending on the type of the socket. I get the strong
feeling that we shouldn't try to mix UDP and TCP sockets into the same
bucket type. The existing socket buckets should remain TCP only. UDP
socket buckets can either be a separate entity in apr-util or mod_udp for
Apache can provide them as a 3rd-party bucket type. But in general, if
you have to use a totally separate API out of APR to read from them, they
should be a separate bucket type IMO.
--Cliff