You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Preethi Natarajan <na...@cis.udel.edu> on 2005/11/16 19:23:24 UTC

[PATCH] Re: APR with SCTP streams.

Hello,

Attached are the modifications to APR to make it use SCTP (Stream
Control Transmission Protocol RFC2960) streams.
This patch (svn diff) is against the main APR trunk.

For more details on the work,
http://issues.apache.org/bugzilla/show_bug.cgi?id=37202)

Overview of the modifications:
* Added a "sctp_stream_id" member to unix/apr_socket_t structure.
* Chnages in unix sendrecv.c sockets.c to handle SCTP with streams
sockets.
* Added an extra function in unix sockaddr.c to parse the Listen directive
with transport protocol as an extra argument.
* Changes to configure.in to detect sendmsg/recvmsg in the system.

Thanks,
Preethi

On Tue, 25 Oct 2005, Preethi Natarajan wrote:

>
> On Tue, 25 Oct 2005, Colm MacCarthaigh wrote:
>
>> brilliant source of working code - I've tested it a little). Is there
>> any reason why the stream id could not just be member of apr_socket_t,
>> and handled by the existing functions?
>
> I had started with that idea but couldnt conitnue with it since ideally 
> different HTTP reqs can come in different SCTP streams in the _same_ 
> apr_socket_t. So the stream info will be overwritten after each request.
> In that case, the response and req could end up in different SCTP streams.
>
> However, I faced another problem in httpd for which I changed the design so 
> that another request can be read only after the response to prev req has been 
> sent. (I can elaborate further if there is interest). So now, I can put in 
> the stream info in apr_socket_t. Will that be better?
>
>
>> 
>> I'm not sure that port/protocol parsing as indiciated belongs in APR
>> either. But great to see work on SCTP!
>
> I saw that apr_parse_addr_port was called by listen.c to read the addr and 
> port from the Listen directive. This function has to be changed too since the 
> new Listen directive can have protocol as an argument.
>
>> 
>> -- 
>> Colm MacC�rthaigh                        Public Key: colm+pgp@stdlib.net
>

Re: [PATCH] Re: APR with SCTP streams.

Posted by Preethi Natarajan <na...@cis.udel.edu>.
Hello,

I had submitted this patch that extends APR to work with SCTP streams. 
This was part of my attempt to make httpd work with SCTP streams.

There have been a few queries on the status of the APR over SCTP patch. 
Personally, I know of atleast one product using this patch and I keep 
getting queries reg. when the patch will be available from Apache.

I know APR developers are pretty busy and am really sorry to bother. 
But, I was wondering if anyone can let me know about the status of the 
patch and is there anything I can do to help?

Regards,
Preethi



On 11/16/2005 2:13 PM, Colm MacCarthaigh wrote:
> On Wed, Nov 16, 2005 at 01:23:24PM -0500, Preethi Natarajan wrote:
>   
>> Attached are the modifications to APR to make it use SCTP (Stream
>> Control Transmission Protocol RFC2960) streams.
>> This patch (svn diff) is against the main APR trunk.
>>     
>
> Thanks! The code looks mostly right, though it's got some portability
> problems (like bzero) that are easily fixed. 
>
> I'm still not sure how much sense apr_parse_addr_port_protocol() makes
> though, it doesn't look like something that belongs in APR. I'll test
> the patch on KAME and USAGI though.
>
>   

Re: [PATCH] Re: APR with SCTP streams.

Posted by Preethi Natarajan <na...@cis.udel.edu>.
Patch attached. Hope the indentation is alright,
Preethi


On Tue, 22 Nov 2005, Colm MacCarthaigh wrote:

> On Tue, Nov 22, 2005 at 11:31:18AM -0500, Preethi Natarajan wrote:
>> Would you prefer that I attach a new patch with
>> apr_parse_addr_port_protocol() removed?
>
> I've been testing your patch, and no problems so far. I havn't found the
> time to fix the small portability problems though. What would be really
> useful is the same patch, with the problems fixed, which are small;
>
> 	* apr_parse_addr_port_protocol() removed
>
> 	* The @ taken out of the e-mail address in the CHANGES entry
>
> 	* bzero calls changed to memset calls
>
> 	* Remove the tabs and replace with spaces, consistently
> 	  indent the code in general.
>
> 	* Remove the superflous arv variable (as far as I can tell
> 	  this was needed when there was a while loop, but not any
> 	  more).
>
> At least they're what are in my notes :-) I'll get round to them myself
> at some point too.
>
> -- 
> Colm MacC�rthaigh                        Public Key: colm+pgp@stdlib.net
>

Re: [PATCH] Re: APR with SCTP streams.

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Tue, Nov 22, 2005 at 11:31:18AM -0500, Preethi Natarajan wrote:
> Would you prefer that I attach a new patch with 
> apr_parse_addr_port_protocol() removed?

I've been testing your patch, and no problems so far. I havn't found the
time to fix the small portability problems though. What would be really
useful is the same patch, with the problems fixed, which are small;

	* apr_parse_addr_port_protocol() removed

	* The @ taken out of the e-mail address in the CHANGES entry

	* bzero calls changed to memset calls

	* Remove the tabs and replace with spaces, consistently 
	  indent the code in general.

	* Remove the superflous arv variable (as far as I can tell
	  this was needed when there was a while loop, but not any
	  more).

At least they're what are in my notes :-) I'll get round to them myself
at some point too.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Re: [PATCH] Re: APR with SCTP streams.

Posted by Preethi Natarajan <na...@cis.udel.edu>.
On Tue, 22 Nov 2005, Colm MacCarthaigh wrote:

> httpd's particular listen syntax is entirely irrelevant to APR :-)
>
Oh.. Thanks for clearing this up. I had assumed otherwise.
If it will solve the problem, apr_parse_addr_port_porotocol() can be 
removed from the patch. I will add code inside httpd to accomplish the 
desired functionality.

Would you prefer that I attach a new patch with 
apr_parse_addr_port_protocol() removed?

Thanks,
Preethi

Re: [PATCH] Re: APR with SCTP streams.

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Tue, Nov 22, 2005 at 10:52:23AM -0500, Preethi Natarajan wrote:
> On Wed, 16 Nov 2005, Colm MacCarthaigh wrote:
> 
> >I'm still not sure how much sense apr_parse_addr_port_protocol() makes
> >though, it doesn't look like something that belongs in APR. I'll test
> 
> Colm, apr_parse_addr_protocol() = apr_parse_addr_port() + abitlity to 
> parse for transport protocol. I could have added the extra functionality 
> inside apr_parse_addr_port() itself. Instead, I created a new function 
> becoz I needed a different function signature to accommodate the protocol 
> and did not want to modify all existing calls (not sure how many) to 
> apr_parse_addr_port() due to the new signature.
> 
> As I see it, _prootocol() alone should suffice since it is backward 
> compatible with the old Listen syntax. We can retain the old name to this 
> new function, but this will involve adding an extra argument to the 
> existing calls to apr_parse_addr_port().
> 
> Any suggestions?

I don't think it belongs in APR at all. There is no standard mechanism
for identifying a L3 protocol in a Listen block. I don't think it'll do
for APR to invent one arbitrarily. Better that each application handle
it in whatever means they deem appropriate.

httpd's particular listen syntax is entirely irrelevant to APR :-)

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Re: [PATCH] Re: APR with SCTP streams.

Posted by Preethi Natarajan <na...@cis.udel.edu>.
On Wed, 16 Nov 2005, Colm MacCarthaigh wrote:

> I'm still not sure how much sense apr_parse_addr_port_protocol() makes
> though, it doesn't look like something that belongs in APR. I'll test

Colm, apr_parse_addr_protocol() = apr_parse_addr_port() + abitlity to 
parse for transport protocol. I could have added the extra functionality 
inside apr_parse_addr_port() itself. Instead, I created a new function 
becoz I needed a different function signature to accommodate the protocol 
and did not want to modify all existing calls (not sure how many) to 
apr_parse_addr_port() due to the new signature.

As I see it, _prootocol() alone should suffice since it is backward 
compatible with the old Listen syntax. We can retain the old name to this 
new function, but this will involve adding an extra argument to the 
existing calls to apr_parse_addr_port().

Any suggestions?
Preethi

Re: [PATCH] Re: APR with SCTP streams.

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Wed, Nov 16, 2005 at 01:23:24PM -0500, Preethi Natarajan wrote:
> Attached are the modifications to APR to make it use SCTP (Stream
> Control Transmission Protocol RFC2960) streams.
> This patch (svn diff) is against the main APR trunk.

Thanks! The code looks mostly right, though it's got some portability
problems (like bzero) that are easily fixed. 

I'm still not sure how much sense apr_parse_addr_port_protocol() makes
though, it doesn't look like something that belongs in APR. I'll test
the patch on KAME and USAGI though.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net