CLEANUP: protocol: remove the now unused <handler> field of proto_fam->bind()

We don't need to specify the handler anymore since it's set in the
receiver. Let's remove this argument from the function and clean up
the remains of code that were still setting it.
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 8e17460..f8e673d 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -124,15 +124,15 @@
 		fd_stop_recv(l->rx.fd);
 }
 
-/* Binds receiver <rx>, and assigns <handler> and rx->owner as the callback and
- * context, respectively, with <tm> as the thread mask. Returns and error code
- * made of ERR_* bits on failure or ERR_NONE on success. On failure, an error
- * message may be passed into <errmsg>. Note that the binding address is only
- * an FD to receive the incoming FDs on. Thus by definition there is no real
- * "bind" operation, this only completes the receiver. Such FDs are not
+/* Binds receiver <rx>, and assigns rx->iocb and rx->owner as the callback
+ * and context, respectively, with ->bind_thread as the thread mask. Returns an
+ * error code made of ERR_* bits on failure or ERR_NONE on success. On failure,
+ * an error message may be passed into <errmsg>. Note that the binding address
+ * is only an FD to receive the incoming FDs on. Thus by definition there is no
+ * real "bind" operation, this only completes the receiver. Such FDs are not
  * inherited upon reload.
  */
-int sockpair_bind_receiver(struct receiver *rx, void (*handler)(int fd), char **errmsg)
+int sockpair_bind_receiver(struct receiver *rx, char **errmsg)
 {
 	int err;
 
@@ -165,7 +165,7 @@
 
 	rx->flags |= RX_F_BOUND;
 
-	fd_insert(rx->fd, rx->owner, handler, thread_mask(rx->settings->bind_thread) & all_threads_mask);
+	fd_insert(rx->fd, rx->owner, rx->iocb, thread_mask(rx->settings->bind_thread) & all_threads_mask);
 	return err;
 
  bind_return:
diff --git a/src/protocol.c b/src/protocol.c
index 18ca40a..8ea36cb 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -65,7 +65,6 @@
 	struct receiver *receiver;
 	char msg[100];
 	char *errmsg;
-	void *handler;
 	int err, lerr;
 
 	err = 0;
@@ -74,12 +73,7 @@
 		list_for_each_entry(receiver, &proto->receivers, proto_list) {
 			listener = LIST_ELEM(receiver, struct listener *, rx);
 
-			/* FIXME: horrible hack, we don't have a way to register
-			 * a handler when creating the receiver yet, so we still
-			 * have to take care of special cases here.
-			 */
-			handler = listener->rx.iocb;
-			lerr = proto->fam->bind(receiver, handler, &errmsg);
+			lerr = proto->fam->bind(receiver, &errmsg);
 			err |= lerr;
 
 			/* errors are reported if <verbose> is set or if they are fatal */
diff --git a/src/sock_inet.c b/src/sock_inet.c
index 7a87fbe..6675be5 100644
--- a/src/sock_inet.c
+++ b/src/sock_inet.c
@@ -252,12 +252,12 @@
 		0;
 }
 
-/* Binds receiver <rx>, and assigns <handler> and rx->owner as the callback and
+/* Binds receiver <rx>, and assigns rx->iocb and rx->owner as the callback and
  * context, respectively. Returns and error code made of ERR_* bits on failure
  * or ERR_NONE on success. On failure, an error message may be passed into
  * <errmsg>.
  */
-int sock_inet_bind_receiver(struct receiver *rx, void (*handler)(int fd), char **errmsg)
+int sock_inet_bind_receiver(struct receiver *rx, char **errmsg)
 {
 	int fd, err, ext;
 	/* copy listener addr because sometimes we need to switch family */
@@ -377,7 +377,7 @@
 	rx->fd = fd;
 	rx->flags |= RX_F_BOUND;
 
-	fd_insert(fd, rx->owner, handler, thread_mask(rx->settings->bind_thread) & all_threads_mask);
+	fd_insert(fd, rx->owner, rx->iocb, thread_mask(rx->settings->bind_thread) & all_threads_mask);
 
 	/* for now, all regularly bound TCP listeners are exportable */
 	if (!(rx->flags & RX_F_INHERITED))
diff --git a/src/sock_unix.c b/src/sock_unix.c
index 2be8d6b..45631ac 100644
--- a/src/sock_unix.c
+++ b/src/sock_unix.c
@@ -118,12 +118,12 @@
 	return 0;
 }
 
-/* Binds receiver <rx>, and assigns <handler> and rx-> as the callback and
- * context, respectively, with <tm> as the thread mask. Returns and error code
- * made of ERR_* bits on failure or ERR_NONE on success. On failure, an error
- * message may be passed into <errmsg>.
+/* Binds receiver <rx>, and assigns rx->iocb and rx->owner as the callback and
+ * context, respectively, with ->bind_thread as the thread mask. Returns an
+ * error code made of ERR_* bits on failure or ERR_NONE on success. On failure,
+ * an error message may be passed into <errmsg>.
  */
-int sock_unix_bind_receiver(struct receiver *rx, void (*handler)(int fd), char **errmsg)
+int sock_unix_bind_receiver(struct receiver *rx, char **errmsg)
 {
 	char tempname[MAXPATHLEN];
 	char backname[MAXPATHLEN];
@@ -285,7 +285,7 @@
 	rx->fd = fd;
 	rx->flags |= RX_F_BOUND;
 
-	fd_insert(fd, rx->owner, handler, thread_mask(rx->settings->bind_thread) & all_threads_mask);
+	fd_insert(fd, rx->owner, rx->iocb, thread_mask(rx->settings->bind_thread) & all_threads_mask);
 
 	/* for now, all regularly bound TCP listeners are exportable */
 	if (!(rx->flags & RX_F_INHERITED))