int verbose;
/** @brief Last error string */
const char *last;
+ /** @brief Address family */
+ int family;
};
/** @brief Create a new client
disorder_client *c = xmalloc(sizeof (struct disorder_client));
c->verbose = verbose;
+ c->family = -1;
return c;
}
+/** @brief Return the address family used by this client */
+int disorder_client_af(disorder_client *c) {
+ return c->family;
+}
+
/** @brief Read a response line
* @param c Client
* @param rp Where to store response, or NULL (UTF-8)
disorder_error(errno, "error calling socket");
return -1;
}
+ c->family = sa->sa_family;
if(connect(fd, sa, salen) < 0) {
byte_xasprintf((char **)&c->last, "connect: %s", strerror(errno));
disorder_error(errno, "error calling connect");
struct sink;
disorder_client *disorder_new(int verbose);
+int disorder_client_af(disorder_client *c);
int disorder_connect(disorder_client *c);
int disorder_connect_user(disorder_client *c,
const char *username,