X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/460b9539a7c15580e41a71bbc0f47ae776238915..58b5a68fb463327e5ddee812341b26aa42c0f081:/lib/eclient.c diff --git a/lib/eclient.c b/lib/eclient.c index 5e6cd6f..38edb64 100644 --- a/lib/eclient.c +++ b/lib/eclient.c @@ -194,6 +194,10 @@ 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; } @@ -546,8 +550,10 @@ static void read_input(disorder_eclient *c) { if(c->state > state_connecting) consume(&c->input, (nl - c->input.vec) + 1); } - if(c->eof) + if(c->eof) { comms_error(c, "reading from %s: server disconnected", c->ident); + c->authenticated = 0; + } } /* called with a line that has just been read */ @@ -1231,4 +1237,3 @@ fill-column:79 indent-tabs-mode:nil End: */ -/* arch-tag:61ONz2p/LWaDRnToGI2+fg */