loudmouth/lm-socket.c
changeset 575 daad23d59b56
parent 552 137471c948ae
equal deleted inserted replaced
574:f84be3f7c7e0 575:daad23d59b56
  1020 	if (ans == NULL) {
  1020 	if (ans == NULL) {
  1021 		lm_verbose ("error while resolving, bailing out\n");
  1021 		lm_verbose ("error while resolving, bailing out\n");
  1022 		if (socket->connect_func) {
  1022 		if (socket->connect_func) {
  1023 			(socket->connect_func) (socket, FALSE, socket->user_data);
  1023 			(socket->connect_func) (socket, FALSE, socket->user_data);
  1024 		}
  1024 		}
  1025 		g_free (socket->connect_data);
  1025                 g_free (socket->connect_data);
  1026 		socket->connect_data = NULL;
  1026 		socket->connect_data = NULL;
  1027 		return;
  1027 		return;
  1028 	}
  1028 	}
  1029 
  1029 
  1030 	socket->connect_data->resolved_addrs = ans;
  1030 	socket->connect_data->resolved_addrs = ans;
  1105 	} else {
  1105 	} else {
  1106 		lm_verbose ("SRV lookup disabled for %s\n", socket->server);
  1106 		lm_verbose ("SRV lookup disabled for %s\n", socket->server);
  1107 		_lm_socket_create_phase1 (socket, NULL, 0);
  1107 		_lm_socket_create_phase1 (socket, NULL, 0);
  1108 	}
  1108 	}
  1109 
  1109 
       
  1110 #ifndef HAVE_ASYNCNS
       
  1111         /* Only do this check if we are not using asyncns or it will crash.
       
  1112          * Report and patch by Senko.
       
  1113          */
  1110 	if (socket->connect_data == NULL) {
  1114 	if (socket->connect_data == NULL) {
  1111 		/* Open failed synchronously, probably a DNS lookup problem */
  1115 		/* Open failed synchronously, probably a DNS lookup problem */
  1112 		lm_socket_unref(socket);
  1116 		lm_socket_unref(socket);
  1113 		
  1117 		
  1114 		g_set_error (error,
  1118 		g_set_error (error,
  1116 			     LM_ERROR_CONNECTION_FAILED,   
  1120 			     LM_ERROR_CONNECTION_FAILED,   
  1117 			     "Failed to resolve server");
  1121 			     "Failed to resolve server");
  1118 		
  1122 		
  1119 		return NULL;
  1123 		return NULL;
  1120 	}
  1124 	}
       
  1125 #endif /* HAVE_ASYNCNS */
  1121 		
  1126 		
  1122 
  1127 
  1123 	/* If the connection fails synchronously, we don't want to call the
  1128 	/* If the connection fails synchronously, we don't want to call the
  1124 	 * connect_func to indicate an error, we return an error indication
  1129 	 * connect_func to indicate an error, we return an error indication
  1125 	 * instead. So, we delay saving the functions until after we know
  1130 	 * instead. So, we delay saving the functions until after we know