* 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 15:37:25 +01:00
parent 39e7f387f8
commit c7d6f69a85
7 changed files with 128 additions and 53 deletions

View file

@ -288,7 +288,6 @@ main(int argc, char **argv)
char *str;
int tabmode;
char *dir;
uint32_t id = 0;
cvec *nsctx_global = NULL; /* Global namespace context */
/* Defaults */
@ -607,17 +606,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: