#include <assert.h>
#include <inttypes.h>
#include <stddef.h>
+#include <time.h>
#include "log.h"
#include "mem.h"
vector_init(&c->vec);
dynstr_init(&c->input);
dynstr_init(&c->output);
- if(!config->password) {
- error(0, "no password set");
- return 0;
- }
return c;
}
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