[<servername> - <client>]
[<client>]
[<servername>] often [SERVER]
- [DEFAULT]
+ [COMMON]
Keys are looked up in that order, unless otherwise specified.
<client> is the client's virtual address.
server
Specifies <servername>.
- Is looked up in [SERVER] and [DEFAULT] only.
+ Is looked up in [SERVER] and [COMMON] only.
If not specified there, it is SERVER.
Used by server to select the appropriate parts of the
Capped settings:
Values in [<server> LIMIT] and [LIMIT] are a cap (maximum) on
- those from the other sections (including DEFAULT).
+ those from the other sections (including COMMON).
max_batch_down
Size limit for response payloads (used by server only)
#---------- default config ----------
defcfg = '''
-[DEFAULT]
+[COMMON]
max_batch_down = 65536
max_queue_time = 10
target_requests_outstanding = 3
serverclient_re = regexp.compile(server_pat + r' ' + client_pat)
for cs in cfg.sections():
- if cs == 'LIMIT':
- # plan A "[LIMIT]"
+ if cs == 'LIMIT' or cs == 'COMMON':
+ # plan A "[LIMIT]" or "[COMMON]"
continue
try:
section = cfg_search_section(key,sections)
return getter(section, key)
-def cfg1get(*args, **kwargs):
- return cfg.get(*args, **kwargs)
+def cfg1get(section,key, getter=cfg.get,**kwargs):
+ section = cfg_search_section(key,[section,'COMMON'])
+ return getter(section,key,**kwargs)
-def cfg1getint(*args, **kwargs):
- return cfg.getint(*args, **kwargs)
+def cfg1getint(section,key, **kwargs):
+ return cfg1get(section,key, getter=cfg.getint,**kwargs);
def cfg_process_client_limited(cc,ss,sections,key):
val = cfg_search(cfg1getint, key, sections)
sections = ['%s %s' % (ss,cs),
cs,
ss,
- 'DEFAULT']
+ 'COMMON']
try: pwsection = cfg_search_section('password', sections)
except NoOptionError: return None