+ if( i >= MAX_SERVERS) {
+ /* Ops, no matching server found?! */
+ io_close( fd );
+ LogDebug("Resolver: Got Forward Lookup callback for unknown server!?");
+ return;
+ }
+
+ /* Read result from pipe */
+ len = Proc_Read(&Conf_Server[i].res_stat, dest_addrs, sizeof(dest_addrs));
+ Proc_Close(&Conf_Server[i].res_stat);
+ if (len == 0) {
+ /* Error resolving hostname: reset server structure */
+ Conf_Server[i].conn_id = NONE;
+ return;
+ }
+
+ assert((len % sizeof(ng_ipaddr_t)) == 0);
+
+ LogDebug("Got result from resolver: %u structs (%u bytes).", len/sizeof(ng_ipaddr_t), len);
+
+ memset(&Conf_Server[i].dst_addr, 0, sizeof(Conf_Server[i].dst_addr));
+ if (len > sizeof(ng_ipaddr_t)) {
+ /* more than one address for this hostname, remember them
+ * in case first address is unreachable/not available */
+ len -= sizeof(ng_ipaddr_t);
+ if (len > sizeof(Conf_Server[i].dst_addr)) {
+ len = sizeof(Conf_Server[i].dst_addr);
+ Log(LOG_NOTICE,
+ "Notice: Resolver returned more IP Addresses for host than we can handle, additional addresses dropped.");
+ }
+ memcpy(&Conf_Server[i].dst_addr, &dest_addrs[1], len);
+ }
+ /* connect() */
+ New_Server(i, dest_addrs);
+} /* cb_Read_Forward_Lookup */
+
+
+/**
+ * Read results of a resolver sub-process from the pipe and update the
+ * apropriate connection/client structure(s): hostname and/or IDENT user name.
+ *
+ * @param r_fd File descriptor of the pipe to the sub-process.
+ * @param events (ignored IO specification)
+ */
+static void
+cb_Read_Resolver_Result( int r_fd, UNUSED short events )
+{