Changeset 1642:80d2b92a82f6

Show
Ignore:
Timestamp:
06/03/08 13:32:32 (3 months ago)
Author:
klai@…
Branch:
default
Message:

Restrict the amount of data that can be registered with the SLS

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Tycoon/ServiceLocationService.py

    r1638 r1642  
    118118        self.__l.setLevel(logging.INFO) 
    119119        self.__done = False 
     120        self.__max_data_len = 40000 
    120121         
    121122        # setup database 
     
    485486        """ 
    486487        service_token = self.__service_profiler.start("register_service") 
    487         values = xmlrpclib.loads(zlib.decompress(v.data))[0][0] 
     488        xml_str = zlib.decompress(v.data) 
     489        # Restrict the amount of data that can be stored in the SLS 
     490        if len(xml_str) > self.__max_data_len: 
     491            return TyException( 
     492                "Data size exceeds maximum",  
     493                (len(xml_str), self.__max_data_len)) 
     494        values = xmlrpclib.loads(xml_str)[0][0] 
    488495        self.__cur.execute( 
    489496            "select * from services where service_name='%s'" % (service_name,))