Changeset 1623

Show
Ignore:
Timestamp:
11/12/08 15:20:37 (2 months ago)
Author:
peet
Message:
  • protocol version increment
  • drop packets of other protocol versions
  • add «addr» keyword only for function calls that request it
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.4.7/lib/cxcore/cxcore/manager.py

    r1618 r1623  
    6262        return f 
    6363 
    64 CP_VERSION = (0,1
     64CP_VERSION = (0,2
    6565 
    6666class BaseCoreService(log): 
     
    231231 
    232232                        try: 
    233                                 if message["version"] < CP_VERSION: 
    234                                         self.log("warning","ancient protocol version %s.%s" % message["version"]
     233                                if message["version"] != CP_VERSION: 
     234                                        self.log("warning","incompatible protocol version %s from address %s" % (message["version"],addr["from"])
    235235                                        continue 
    236                                 message["kwarg"]["addr"] = addr 
    237236                        except: 
    238237                                if message == "shutdown": 
     
    253252                        if self.public.has_key(target): 
    254253                                func = self.public[target] 
     254                                import inspect 
     255                                spec = inspect.getargspec(func) 
     256                                if spec[1] or spec[2] or ('addr' in spec[0]): 
     257                                        message['kwarg']['addr'] = addr 
    255258                                if  \ 
    256259                                        (self.__func_acl and (target in self.__func_acl)) or \