summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-11 23:25:38 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-11 23:25:38 +0200
commitb860471279dfd3ec4dcdba9c02b7886869459ec8 (patch)
tree5c7d9311d7018922a634abaa23ae35f56de8dbb5
parentea836c09048453babda517e6a440d7266304ca02 (diff)
Oops....fixup connect_any callback throughout
-rw-r--r--proxy.c4
-rw-r--r--utils.c4
-rw-r--r--utils.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/proxy.c b/proxy.c
index d06803d..125c408 100644
--- a/proxy.c
+++ b/proxy.c
@@ -183,11 +183,11 @@ proxy_server_data_in(struct cfg *cfg, struct uring_task *task, int res)
}
static void
-proxy_connected_cb(struct cfg *cfg, struct connection *conn, int res)
+proxy_connected_cb(struct cfg *cfg, struct connection *conn, bool connected)
{
struct server_proxy *proxy = container_of(conn, struct server_proxy, server_conn);
- if (res < 0) {
+ if (!connected) {
fprintf(stderr, "%s: proxy connection to remote server failed\n",
proxy->scfg->name);
proxy_delete(cfg, proxy);
diff --git a/utils.c b/utils.c
index 05fe124..1fa8621 100644
--- a/utils.c
+++ b/utils.c
@@ -202,7 +202,7 @@ void
connection_set_remote(struct cfg *cfg, struct connection *conn, struct sockaddr_in46 *remote)
{
conn->remote = *remote;
- sockaddr_to_str(&conn->remote, &conn->remotestr, sizeof(conn->remotestr));
+ sockaddr_to_str(&conn->remote, conn->remotestr, sizeof(conn->remotestr));
}
static void connect_next(struct cfg *cfg, struct uring_task *task, struct connection *conn);
@@ -273,7 +273,7 @@ again:
void
connect_any(struct cfg *cfg, struct uring_task *task,
struct list_head *addrs, struct connection *conn,
- void (*callback)(struct cfg *, struct connection *, int res))
+ void (*callback)(struct cfg *, struct connection *, bool res))
{
if (!cfg || !task || !addrs || !conn || !callback) {
fprintf(stderr, "%s: invalid arguments\n", __func__);
diff --git a/utils.h b/utils.h
index 41c71e5..adedc37 100644
--- a/utils.h
+++ b/utils.h
@@ -45,7 +45,7 @@ struct connection {
struct list_head *addrs;
unsigned next_addr;
- void (*callback)(struct cfg *, struct connection *, int res);
+ void (*callback)(struct cfg *, struct connection *, bool);
};
struct uring_task;
@@ -59,7 +59,7 @@ void connection_set_remote(struct cfg *cfg, struct connection *conn,
void connect_any(struct cfg *cfg, struct uring_task *task,
struct list_head *addrs, struct connection *conn,
- void (*callback)(struct cfg *, struct connection *, int res));
+ void (*callback)(struct cfg *, struct connection *, bool));
uint16_t sockaddr_port(struct sockaddr_in46 *addr);