[OpenSER-Devel] [ openser-Patches-1750487 ] update patch to allow * to be used in PDT module

SourceForge.net noreply at sourceforge.net
Wed Jul 11 19:21:15 CEST 2007


Patches item #1750487, was opened at 2007-07-09 14:45
Message generated for change (Comment added) made by delvar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1750487&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Closed
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Delvar (delvar)
Assigned to: Elena-Ramona Modroiu (anomarme)
Summary: update patch to allow * to be used in PDT module

Initial Comment:
I updated my patch (1742883) to allow the use of an arbitrary list of characters (sorry I didn’t know how to upload more files to that issue so I made a new one!).

Added a str to pdtree.h
static str pdt_char_list = {"1234567890*",11};

this string holds the chars that we can use, then when it comes to hashing is uses strchr() (via macro strpos) to get the index of the char from the string and use that instead of the ASCII value of the char. (if you see what I mean)

on lookup and inserts we do a lot of strchr()’s maybe cut this down by setting up an ASCII value against index value array, would speed it up but not much (and use more ram).

Also I need to allow the char list to be set by a modparam, im not sure how to do this so any help will be appreciated.


----------------------------------------------------------------------

>Comment By: Delvar (delvar)
Date: 2007-07-11 18:21

Message:
Logged In: YES 
user_id=1827595
Originator: YES

cool, i was thinking of changing the macro strpos to a function
pdt_get_index_value() and put it in utill.c just to make it a bit nicer.
this would then allow later using a direct ASCII value to index value
array instead of repeated calls to strchr (just make it a tad bit faster).

one thing i was thinking of, do we really need to limit the chars in this
way?
when loading it comes across a char not in the string, it just appends it
to the end of the string and carries on instead of erroring out.
Or maybe just ignore that prefix and carry on anyway.

What about a none cached version like other modules so every time a lookup
is done it queries the database (iv already got the SQL for that sort of
lookup) it will be slower but will use less ram and updates will be
instant. 

I will check out SVN tomorrow morning and test it.

Thanks!


----------------------------------------------------------------------

Comment By: Elena-Ramona Modroiu (anomarme)
Date: 2007-07-11 17:02

Message:
Logged In: YES 
user_id=1282356
Originator: NO

Your patch has been applied along with other changes to the module. Please
test it and let me know if there are any problems.

----------------------------------------------------------------------

Comment By: Elena-Ramona Modroiu (anomarme)
Date: 2007-07-11 08:15

Message:
Logged In: YES 
user_id=1282356
Originator: NO

I will review it, integrate with my additional work and commit. Thanks for
the patch.

----------------------------------------------------------------------

Comment By: Delvar (delvar)
Date: 2007-07-10 09:44

Message:
Logged In: YES 
user_id=1827595
Originator: YES

there we go, updated the patches, fixed couple problems.
add modparam for the char list,
modparam("pdt", "pdt_char_list", "1234567890*")
defaults to 1234567890*

you only need the patches dated 10072007 ignore the others.

----------------------------------------------------------------------

Comment By: Delvar (delvar)
Date: 2007-07-10 09:41

Message:
Logged In: YES 
user_id=1827595
Originator: YES

File Added: pdtree.h.10072007-001.diff

----------------------------------------------------------------------

Comment By: Delvar (delvar)
Date: 2007-07-10 09:41

Message:
Logged In: YES 
user_id=1827595
Originator: YES

File Added: pdtree.c.10072007-001.diff

----------------------------------------------------------------------

Comment By: Delvar (delvar)
Date: 2007-07-10 09:40

Message:
Logged In: YES 
user_id=1827595
Originator: YES

File Added: pdt.c.10072007-001.diff

----------------------------------------------------------------------

Comment By: Delvar (delvar)
Date: 2007-07-09 19:02

Message:
Logged In: YES 
user_id=1827595
Originator: YES

well i found some problems :)
and i got char_list via openser.conf now (althoughim not sure if its a
good way to do it!)

ill uload an updated patch tomorrow.

----------------------------------------------------------------------

Comment By: Delvar (delvar)
Date: 2007-07-09 16:12

Message:
Logged In: YES 
user_id=1827595
Originator: YES

added patch to MI functions.
File Added: pdt.c.09072007-001.diff

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1750487&group_id=139143



More information about the Devel mailing list