X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/d0eff58325f88cf7b66e7e7ef92c8802a45532d5..bf5fdf14a659846700e62c5dcf2c8fceb56b2a8c:/lib/eclient.c diff --git a/lib/eclient.c b/lib/eclient.c index d93412a..2bf86e9 100644 --- a/lib/eclient.c +++ b/lib/eclient.c @@ -236,10 +236,6 @@ disorder_eclient *disorder_eclient_new(const disorder_eclient_callbacks *cb, vector_init(&c->vec); dynstr_init(&c->input); dynstr_init(&c->output); - if(!config->password) { - error(0, "no password set"); - return 0; - } return c; } @@ -340,6 +336,11 @@ void disorder_eclient_polled(disorder_eclient *c, unsigned mode) { if(c->state == state_disconnected) { D(("state_disconnected")); + /* If there is no password yet then we cannot connect */ + if(!config->password) { + comms_error(c, "no password is configured"); + return; + } with_sockaddr(c, start_connect); /* might now be state_disconnected (on error), state_connecting (slow * connect) or state_connected (fast connect). If state_disconnected then