MINOR: protocol: uniformize protocol errors
Some protocols fail with "error blah [ip:port]" and other fail with
"[ip:port] error blah". All this already appears in a "starting" or
"binding" context after a proxy name. Let's choose a more universal
approach like below where the ip:port remains at the end of the line
prefixed with "for".
[WARNING] (18632) : Binding [binderr.cfg:10] for proxy http: cannot bind receiver to device 'eth2' (No such device) for [0.0.0.0:1080]
[WARNING] (18632) : Starting [binderr.cfg:10] for proxy http: cannot set MSS to 12 for [0.0.0.0:1080]
diff --git a/src/proto_quic.c b/src/proto_quic.c
index 257a492..58679eb 100644
--- a/src/proto_quic.c
+++ b/src/proto_quic.c
@@ -607,7 +607,7 @@
char pn[INET6_ADDRSTRLEN];
addr_to_str(&listener->rx.addr, pn, sizeof(pn));
- snprintf(errmsg, errlen, "%s [%s:%d]", msg, pn, get_host_port(&listener->rx.addr));
+ snprintf(errmsg, errlen, "%s for [%s:%d]", msg, pn, get_host_port(&listener->rx.addr));
}
return err;
}
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 216700b..11cf353 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -162,7 +162,7 @@
bind_return:
if (errmsg && *errmsg)
- memprintf(errmsg, "%s [fd %d]", *errmsg, rx->fd);
+ memprintf(errmsg, "%s for [fd %d]", *errmsg, rx->fd);
return err;
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 9546653..18e9b80 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -734,7 +734,7 @@
char pn[INET6_ADDRSTRLEN];
addr_to_str(&listener->rx.addr, pn, sizeof(pn));
- snprintf(errmsg, errlen, "[%s:%d]: %s", pn, get_host_port(&listener->rx.addr), msg->area);
+ snprintf(errmsg, errlen, "%s for [%s:%d]", msg->area, pn, get_host_port(&listener->rx.addr));
}
free_trash_chunk(msg);
msg = NULL;
diff --git a/src/proto_udp.c b/src/proto_udp.c
index f07170f..c5ecfac 100644
--- a/src/proto_udp.c
+++ b/src/proto_udp.c
@@ -148,7 +148,7 @@
char pn[INET6_ADDRSTRLEN];
addr_to_str(&listener->rx.addr, pn, sizeof(pn));
- snprintf(errmsg, errlen, "%s [%s:%d]", msg, pn, get_host_port(&listener->rx.addr));
+ snprintf(errmsg, errlen, "%s for [%s:%d]", msg, pn, get_host_port(&listener->rx.addr));
}
return err;
}
diff --git a/src/proto_uxdg.c b/src/proto_uxdg.c
index 7eb5a62..b0efe86 100644
--- a/src/proto_uxdg.c
+++ b/src/proto_uxdg.c
@@ -103,7 +103,7 @@
uxdg_return:
if (msg && errlen) {
const char *path = ((struct sockaddr_un *)&listener->rx.addr)->sun_path;
- snprintf(errmsg, errlen, "%s [%s]", msg, path);
+ snprintf(errmsg, errlen, "%s for [%s]", msg, path);
}
return err;
}
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 47a9992..45cb56f 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -141,7 +141,7 @@
uxst_return:
if (msg && errlen) {
const char *path = ((struct sockaddr_un *)&listener->rx.addr)->sun_path;
- snprintf(errmsg, errlen, "%s [%s]", msg, path);
+ snprintf(errmsg, errlen, "%s for [%s]", msg, path);
}
return err;
}
diff --git a/src/sock_inet.c b/src/sock_inet.c
index 1402dd0..fd8f648 100644
--- a/src/sock_inet.c
+++ b/src/sock_inet.c
@@ -402,7 +402,7 @@
char pn[INET6_ADDRSTRLEN];
addr_to_str(&addr_inet, pn, sizeof(pn));
- memprintf(errmsg, "%s [%s:%d]", *errmsg, pn, get_host_port(&addr_inet));
+ memprintf(errmsg, "%s for [%s:%d]", *errmsg, pn, get_host_port(&addr_inet));
}
return err;