loudmouth/lm-asyncns-resolver.c
changeset 670 88c6aef5ff18
parent 624 a94013a4555d
child 690 7ccf2113ec5f
equal deleted inserted replaced
669:e1883e3f9a55 670:88c6aef5ff18
   204     req.ai_socktype = SOCK_STREAM;
   204     req.ai_socktype = SOCK_STREAM;
   205     req.ai_protocol = IPPROTO_TCP;
   205     req.ai_protocol = IPPROTO_TCP;
   206 
   206 
   207     if (!asyncns_resolver_prep (resolver, NULL)) {
   207     if (!asyncns_resolver_prep (resolver, NULL)) {
   208         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "Signal error\n");
   208         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "Signal error\n");
       
   209         g_free (host);
   209         return;
   210         return;
   210     }
   211     }
   211 
   212 
   212     priv->resolv_query =
   213     priv->resolv_query =
   213         asyncns_getaddrinfo (priv->asyncns_ctx,
   214         asyncns_getaddrinfo (priv->asyncns_ctx,
   216                              &req);
   217                              &req);
   217 
   218 
   218     asyncns_setuserdata (priv->asyncns_ctx,
   219     asyncns_setuserdata (priv->asyncns_ctx,
   219                          priv->resolv_query,
   220                          priv->resolv_query,
   220                          (gpointer) asyncns_resolver_done);
   221                          (gpointer) asyncns_resolver_done);
       
   222 
       
   223     g_free (host);
   221 }
   224 }
   222 
   225 
   223 static void
   226 static void
   224 asyncns_resolver_srv_done (LmResolver *resolver)
   227 asyncns_resolver_srv_done (LmResolver *resolver)
   225 {
   228 {
   298 
   301 
   299     if (!asyncns_resolver_prep (resolver, /* Use GError? */ NULL)) {
   302     if (!asyncns_resolver_prep (resolver, /* Use GError? */ NULL)) {
   300         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
   303         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
   301                "Failed to initiate the asyncns library");
   304                "Failed to initiate the asyncns library");
   302         /* FIXME: Signal error */
   305         /* FIXME: Signal error */
       
   306         g_free (srv);
       
   307         g_free (domain);
       
   308         g_free (service);
       
   309         g_free (protocol);
   303         return;
   310         return;
   304     }
   311     }
   305 
   312 
   306     priv->resolv_query =
   313     priv->resolv_query =
   307         asyncns_res_query (priv->asyncns_ctx, srv, C_IN, T_SRV);
   314         asyncns_res_query (priv->asyncns_ctx, srv, C_IN, T_SRV);