confserver: In protocol V2, a "load" should only send back changes not all items

This commit is contained in:
Angus Gratton
2019-03-14 17:47:08 +11:00
committed by Angus Gratton
parent 90ddbaac16
commit ec4c75b692
3 changed files with 16 additions and 9 deletions

View File

@@ -84,10 +84,14 @@ def run_server(kconfig, sdkconfig, default_version=MAX_PROTOCOL_VERSION):
before_ranges = get_ranges(config)
before_visible = get_visible(config)
if "load" in req: # if we're loading a different sdkconfig, response should have all items in it
before = {}
before_ranges = {}
before_visible = {}
if "load" in req: # load a new sdkconfig
if req.get("version", default_version) == 1:
# for V1 protocol, send all items when loading new sdkconfig.
# (V2+ will only send changes, same as when setting an item)
before = {}
before_ranges = {}
before_visible = {}
# if no new filename is supplied, use existing sdkconfig path, otherwise update the path
if req["load"] is None: