diff options
author | John Estabrook <jestabro@vyos.io> | 2020-10-02 11:01:17 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2020-10-02 13:55:02 -0500 |
commit | 858143739cece6eee0cf13a6a3e1fcffa70928bb (patch) | |
tree | c3b55444ad82c0f943e3f68029112c7235b6ff7f /src/services/vyos-configd | |
parent | e58a5831c1c0ca2d9e4954007f4adbd660c20f1c (diff) | |
download | vyos-1x-858143739cece6eee0cf13a6a3e1fcffa70928bb.tar.gz vyos-1x-858143739cece6eee0cf13a6a3e1fcffa70928bb.zip |
configd: T2952: synchronize received messages in case of client timeout
Diffstat (limited to 'src/services/vyos-configd')
-rwxr-xr-x | src/services/vyos-configd | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/services/vyos-configd b/src/services/vyos-configd index d838bd064..671a89036 100755 --- a/src/services/vyos-configd +++ b/src/services/vyos-configd @@ -134,8 +134,19 @@ def initialization(socket): # Reset config strings: active_string = '' session_string = '' + # check first for resent init msg, in case of client timeout + while True: + msg = socket.recv().decode() + try: + message = json.loads(msg) + if message["type"] == "init": + resp = "init" + socket.send(resp.encode()) + except: + break + # zmq synchronous for ipc from single client: - active_string = socket.recv().decode() + active_string = msg resp = "active" socket.send(resp.encode()) session_string = socket.recv().decode() |