Commit 4836f223 authored by Mickaël Turnel's avatar Mickaël Turnel

Add socket for mDNS resolutions

parent 0e245336
......@@ -142,6 +142,12 @@ void *sres_resolver_set_userdata(sres_resolver_t *res, void *userdata);
SRESPUBFUN
void *sres_resolver_get_userdata(sres_resolver_t const *res);
#ifdef HAVE_MDNS
/** Set mDNS socket */
SRESPUBFUN
void sres_resolver_mdns_set_socket(sres_resolver_t *resolver, int socket);
#endif
/** Prototype for callback function.
*
* This kind of function is called when a query is completed. The called
......
......@@ -949,6 +949,11 @@ int sres_resolver_set_timer_cb(sres_resolver_t *res,
}
#if HAVE_MDNS
void
sres_resolver_mdns_set_socket(sres_resolver_t *resolver, int socket) {
resolver->res_mdns_socket = socket;
}
static
void
sres_notify_resolver(sres_query_t *query)
......@@ -3675,9 +3680,6 @@ int sres_resolver_sockets(sres_resolver_t *res,
}
return_sockets[i++] = s;
#ifdef HAVE_MDNS
res->res_mdns_socket = s;
#endif
}
return retval;
......
......@@ -266,6 +266,10 @@ static int sres_sofia_update(sres_sofia_t *srs,
reg->reg_index = index;
}
#if HAVE_MDNS
sres_resolver_mdns_set_socket(srs->srs_resolver, srs->srs_socket);
#endif
if (!what)
return 0; /* success */
......@@ -315,8 +319,13 @@ su_socket_t sres_resolver_root_socket(sres_resolver_t *res)
su_socket_t socket;
if (sres_resolver_sockets(res, &socket, 1) < 0)
return INVALID_SOCKET;
srs->srs_socket = socket;
}
#if HAVE_MDNS
sres_resolver_mdns_set_socket(srs->srs_resolver, srs->srs_socket);
#endif
return srs->srs_socket;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment