+ *identptr = '\0';
+ LogDebug("Got result from resolver: \"%s\" (%u bytes read).", readbuf, len);
+ /* Okay, we got a complete result: this is a host name for outgoing
+ * connections and a host name and IDENT user name (if enabled) for
+ * incoming connections.*/
+ assert ( My_Connections[i].sock >= 0 );
+ /* Incoming connection. Search client ... */
+ c = Conn_GetClient( i );
+ assert( c != NULL );
+
+ /* Only update client information of unregistered clients.
+ * Note: user commands (e. g. WEBIRC) are always read _after_ reading
+ * the resolver results, so we don't have to worry to override settings
+ * from these commands here. */
+ if(Client_Type(c) == CLIENT_UNKNOWN) {
+ strlcpy(My_Connections[i].host, readbuf,
+ sizeof(My_Connections[i].host));
+ Client_SetHostname(c, readbuf);
+#ifdef IDENTAUTH
+ ++identptr;
+ if (*identptr) {
+ Log(LOG_INFO, "IDENT lookup for connection %d: \"%s\".", i, identptr);
+ Client_SetUser(c, identptr, true);
+ } else {
+ Log(LOG_INFO, "IDENT lookup for connection %d: no result.", i);
+ }
+#endif
+ }
+#ifdef DEBUG
+ else Log( LOG_DEBUG, "Resolver: discarding result for already registered connection %d.", i );
+#endif
+} /* cb_Read_Resolver_Result */
+
+
+/**
+ * Write a "simple" (error) message to a socket.
+ *
+ * The message is sent without using the connection write buffers, without
+ * compression/encryption, and even without any error reporting. It is
+ * designed for error messages of e.g. New_Connection().
+ *
+ * @param Sock Socket handle.
+ * @param Msg Message string to send.
+ */
+static void
+Simple_Message(int Sock, const char *Msg)
+{
+ char buf[COMMAND_LEN];
+ size_t len;
+
+ assert(Sock > NONE);
+ assert(Msg != NULL);
+
+ strlcpy(buf, Msg, sizeof buf - 2);
+ len = strlcat(buf, "\r\n", sizeof buf);
+ if (write(Sock, buf, len) < 0) {
+ /* Because this function most probably got called to log
+ * an error message, any write error is ignored here to
+ * avoid an endless loop. But casting the result of write()
+ * to "void" doesn't satisfy the GNU C code attribute
+ * "warn_unused_result" which is used by some versions of
+ * glibc (e.g. 2.11.1), therefore this silly error
+ * "handling" code here :-( */
+ return;