[OpenSIPS-Users] bug in the RadiusDictionaryFile fonction

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Oct 9 09:58:13 CEST 2008


Hi Geoffroy,

I think this patch if for the radiusclient-ng code and not for opensips 
- I CC'ed to this email people involved with the radiusclient* project, 
people who might help you with the patch.

Thanks and regards,
Bogdan

Geoffroy Rabouin wrote:
> Hi,
> There is a bug when a $INCLUDE is use in the dict file of the 
> radiusclient-ng.
> If I concatenate all my dict in one bigger, all is ok.
> I try to make a fonction who handle the $INCLUDE :
> class RadiusDictionaryFile(object):
> /    def __init__(self, base_file_name):
>         self.file_names = [base_file_name]
>         log.warn(base_file_name)
>         self.fd_stack = [open(base_file_name)]
>
>     def readlines(self):
>         i=-1
>         while i<len(self.fd_stack)-1:
>             line = self.fd_stack[i].readline()
>             if line:
>                 if line.startswith("$INCLUDE"):
>                     file_name = line.rstrip("\n").split(None, 1)[1]
>                     if file_name not in self.file_names:
>                         self.file_names.append(file_name)
>                         self.fd_stack.append(open(file_name))
>                     continue
>                 else:
>                     yield line
>             else:
>                 self.fd_stack.pop()
>                 if len(self.fd_stack) == 0:
>                     return
>             i=i+1/
>
>
> Let me know if this is correct for you.
> Have a nice day.
>
> -- 
> Geoffroy Rabouin
> HighColoc
> 13710 La Barque
> FRANCE
> téléphone : +33 6-27-19-13-07
>
> -- 
> Geoffroy Rabouin
> HighColoc
> 13710 La Barque
> téléphone : 06-27-19-13-07
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   




More information about the Users mailing list