MEDIUM: protocol: do not call proto->bind() anymore from bind_listener()
All protocol's listeners now only take care of themselves and not of
the receiver anymore since that's already being done in proto_bind_all().
Now it finally becomes obvious that UDP doesn't need a listener, as the
only thing it does is to set the listener's state to LI_LISTEN!
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 3e29e87..5ceb18f 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -103,11 +103,9 @@
if (listener->state != LI_ASSIGNED)
return ERR_NONE; /* already bound */
- err = sock_unix_bind_receiver(&listener->rx, listener->rx.proto->accept, &msg);
- if (err != ERR_NONE) {
- snprintf(errmsg, errlen, "%s", msg);
- free(msg); msg = NULL;
- return err;
+ if (!(listener->rx.flags & RX_F_BOUND)) {
+ msg = "receiving socket not bound";
+ goto uxst_return;
}
fd = listener->rx.fd;
@@ -130,6 +128,7 @@
uxst_close_return:
close(fd);
+ uxst_return:
if (msg && errlen) {
const char *path = ((struct sockaddr_un *)&listener->rx.addr)->sun_path;
snprintf(errmsg, errlen, "%s [%s]", msg, path);