* Session-id CLI functionality delayed: "lazy evaluation"

* From a cli perspective this is a revert to 4.1 behaviour, where the cli does not immediately exit on start if the backend is not running, but with the new session-id function
This commit is contained in:
Olof hagsand 2020-02-05 16:09:26 +01:00
parent ba2d18417a
commit 3d5c2cc678
9 changed files with 133 additions and 57 deletions

View file

@ -286,7 +286,6 @@ main(int argc, char **argv)
char *str;
int tabmode;
char *dir;
uint32_t id = 0;
cvec *nsctx_global = NULL; /* Global namespace context */
/* Defaults */
@ -605,17 +604,8 @@ main(int argc, char **argv)
}
/* Go into event-loop unless -1 command-line */
if (!once){
/* Send hello request to backend to get session-id back
* This is done once at the beginning of the session and then this is
* used by the client, even though new TCP sessions are created for
* each message sent to the backend.
*/
if (clicon_hello_req(h, &id) < 0)
goto done;
clicon_session_id_set(h, id);
if (!once)
retval = cli_interactive(h);
}
else
retval = 0;
done: