[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Partysip-dev] loop detection
From: |
Fredrik Thulin |
Subject: |
Re: [Partysip-dev] loop detection |
Date: |
Tue, 3 Sep 2002 14:14:57 +0200 |
User-agent: |
KMail/1.4.3 |
On Monday 02 September 2002 18.15, Aymeric Moizard wrote:
> Hi fredrik,
>
> Thanks for working on partysip, more below:
Thank you too ;)
...
> Hope this will give you ideas.
Hmm, yes. I just have to understand more about the partysip architecture
first. I have some other things to do too (I have now printed rfc3261 for
example (phew) ;) ).
> Anyway, it would be good to get a fix for the initial issue:
> Try to prevent loop detection, at least the ones the administrator
> can avoid: eg: give the list of virtual host and not only one and
> verify all of them in "psp_core_is_responsible_for_this_route()"!
Ok, attached is a new patch called fredrik-partysip-loop-detection-patch2. It
does a number of things, I shall try to summarize.
* main.c:
* Use the ppl_dns_get_local_fqdn() function if one of
serverip/servername is
not set in the config - not just if both are not set.
* psp_core.c:
* Clear the memory allocated to hold the psp_core_t struct. In another
project I have done some work in we have had quite a few bugs that
we eventually tracked down to not clearing allocated memory. I added
it since other new code of mine depends on some things in the core
structure to be NULL. Maybe this should be done in the sfree()
function, or maybe that would be too much overhead.
* Two new functions added that parses the config values for servername
and
serverip. They are called psp_core_parse_servername() and
psp_core_parse_serverip() and are capable of parsing really stupid
things like :
servername = sip.su.se..,,, sipserver.su.se
lab08.lab.it.su.se
space and comma are treated as delimiters. I would have used the
strtok_r()
function if the man-page didn't said to stay away of that function.
serverip's are validated with inet_addr(), but unfortunately that
validation is not capable of detecting the error in
serverip = 130,237.90.27
* psp_core_is_responsible_for_this_domain() and
psp_core_is_responsible_for_this_route() are updated to check all
the names or, if url->host appears to be an IP address (again
checked via inet_addr()), all the IP addresses. Hostnames are
compared case insensitively since DNS is case insensitive.
With the patch applied, things work as they should and I can call my colleague
with any of these variants : 1597, address@hidden, address@hidden
and address@hidden
You might not like my indentation. Normally when contributing code I try very
hard to follow the original author(s) indentation but since the existing code
is not indented consistently I am instead proposing that you start using
indent(1) to indent all source. That would make it easier to read and I (and
others of course) can write code the way I'm used to and just run indent on
it before submitting patches. I can supply you with my .indent.pro file if
you wish but I guess you don't since my code does not look like yours ;)
Also, making patches would be much easier if all the autogenerated files were
not in CVS. As it is now I have to wade through about a zillion changes in
Makefile.in and friends to only send you relevant patches. Other projects
I've worked in have only had the automake/autoconf source files in the CVS
and a script called autogen.sh that generates a configure script and
everything else needed for those wishing to compile the CVS version.
/Fredrik
fredrik-partysip-loop-detection-patch2
Description: Text Data
- [Partysip-dev] loop detection, Fredrik Thulin, 2002/09/02
- Re: [Partysip-dev] loop detection, Aymeric Moizard, 2002/09/02
- Re: [Partysip-dev] loop detection,
Fredrik Thulin <=
- Re: [Partysip-dev] loop detection, Aymeric Moizard, 2002/09/03
- Re: [Partysip-dev] loop detection, Fredrik Thulin, 2002/09/04
- Re: [Partysip-dev] loop detection, Aymeric Moizard, 2002/09/04
- Re: [Partysip-dev] loop detection, Fredrik Thulin, 2002/09/04
- Re: [Partysip-dev] loop detection, Aymeric Moizard, 2002/09/04
- indentation (was: Re: [Partysip-dev] loop detection), Fredrik Thulin, 2002/09/09
- Re: indentation (was: Re: [Partysip-dev] loop detection), Aymeric Moizard, 2002/09/09
- Re: indentation (was: Re: [Partysip-dev] loop detection), Fredrik Thulin, 2002/09/10
- autogenerated files in CVS (was: Re: [Partysip-dev] loop detection), Fredrik Thulin, 2002/09/04
- Re: [Partysip-dev] loop detection, Aymeric Moizard, 2002/09/03