httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Stewart <rand...@stewart.chicago.il.us>
Subject Re: sockets and such
Date Thu, 10 Oct 2002 15:18:24 GMT
Ryan:

Thanks for the fast response..

Now for some thoughts..


rbb@apache.org wrote:
> On Thu, 10 Oct 2002, Randall Stewart wrote:
> 
> 
>>Hi:
>>
>>I am working on getting apache2 (2.0.43) to be able
>>to listen on SCTP sockets as well as TCP.
>>
>>This involves a small amount of work expanding the
>>socket_t to have a protocol field.
> 
> 
> It should be possible to do this without any core changes, as an initial
> implementation.  One of the goals for Apache 2.0, was to allow the socket
> to be abstracted out of the server by a module.  If you create your own
> module, that implements listening for an SCTP socket, everything should
> just work.
> 
> For an example of how to do this, take a look at perchild and how I
> inserted the Unix domain socket into the listen_rec list.
> 
Hmm. yes this was one of the things I have looked at.. it is not
quite as easy as that though..

The problem is in the fact that SCTP and TCP both use SOCK_STREAM :>

The TCP-Style interface (which is prefered here since apache expects the
listen/accept model) uses the same type. The only difference is
the protocol type (third argument to socket()). Now of course
all socket calls in apache2 use a ,0); as the last arg.. this is
a base problem. I think the right  fix is to add a protocol type
and maintain this...

I am getting there.. but I still have a problem.. and this may
be a config issue.. drats that I did not compile it unchanged first :-0
I suppose I will have to go re-download a clean copy..

I get everything working.. the TCP and SCTP sockets open up to
listen for HTTP requests.. but then somewhere along the line
the server does its exit.. I guess after forking its children.. but
at that point the SCTP socket closes.. so do the TCP ones as well :-0

Thus I suspect a problem in my config...


> 
>>/* XXX this REALLY needs to be uncommnted, but it is causing problems */
>>
>>right before a
>>
>>apr_table_do()...
>>
>>in pass_request()
>>
>>Now in my poking around I found what the problem was..
>>
>>on the recvmsg() side of the socket  in receive_from_other_child()
>>
>>the iov[] addresses were all
>>set to 0.
>>
>>i.e.
>>
>>iov[0].iov_base = headers;
>>...
>>iov[0].iov_base = request_body;
>>
>>This is most likely the problem.. I have uncommented the line and fixed
>>the above.. Not sure how to test it yet...  but I will let you know if I
>>see any problems from it..
> 
> 
> THANK YOU!  I forgot about that bug, but this does look like the
> problem.  I spent all of my time looking at pass_request(), and completely
> ignored receive_from_other_child().   :-(
> 

Yeah, when I saw this and later saw the comment I knew that this
was one of those ugly ones that make you look in the wrong place :-0

R


> Ryan
> _______________________________________________________________________________
> Ryan Bloom                        	rbb@apache.org
> 550 Jean St
> Oakland CA 94610
> -------------------------------------------------------------------------------
> 
> 
> 
> 



-- 
Randall R. Stewart
randall@stewart.chicago.il.us 815-342-5222 (cell phone)


Mime
View raw message