- Conf_Server[i].lasttry = time( NULL );
-
- /* Search free connection structure */
- for( idx = 0; idx < Pool_Size; idx++ ) if( My_Connections[idx].sock == NONE ) break;
- if (idx >= Pool_Size) {
- Log( LOG_ALERT, "Can't establist server connection: connection limit reached (%d)!",
- Pool_Size );
- return;
- }
-#ifdef DEBUG
- Log( LOG_DEBUG, "Preparing connection %d for \"%s\" ...", idx, Conf_Server[i].host );
-#endif
-
- /* Verbindungs-Struktur initialisieren */
- Init_Conn_Struct( idx );
- My_Connections[idx].sock = SERVER_WAIT;
- Conf_Server[i].conn_id = idx;
-
- /* Resolve Hostname. If this fails, try to use it as an IP address */
- strlcpy( Conf_Server[i].ip, Conf_Server[i].host, sizeof( Conf_Server[i].ip ));
- strlcpy( My_Connections[idx].host, Conf_Server[i].host, sizeof( My_Connections[idx].host ));
- s = Resolve_Name( Conf_Server[i].host );
-
- /* resolver process running? */
- if( s ) My_Connections[idx].res_stat = s;
+ Conf_Server[i].lasttry = time_now;
+ assert(Resolve_Getfd(&Conf_Server[i].res_stat) < 0);
+ Resolve_Name(&Conf_Server[i].res_stat, Conf_Server[i].host, cb_Connect_to_Server);