Exemplo n.º 1
0
getdns_return_t
getdns_service_sync(getdns_context *context, const char *name,
    getdns_dict *extensions, getdns_dict **response)
{
	getdns_sync_loop loop;
	getdns_return_t r;

	if (!context || !name || !response)
		return GETDNS_RETURN_INVALID_PARAMETER;

	if ((r = getdns_sync_loop_init(context, &loop)))
		return r;

	if ((r = priv_getdns_service_loop(context, &loop.loop.loop, name,
	    extensions, &loop, NULL, getdns_sync_cb))) {

		getdns_sync_loop_cleanup(&loop);
		return r;
	}
	getdns_sync_loop_run(&loop);
	
	return (*response = loop.response) ?
	    GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR;
}
Exemplo n.º 2
0
Arquivo: sync.c Projeto: ATP93/getdns
getdns_return_t
getdns_hostname_sync(getdns_context *context, getdns_dict *address,
    getdns_dict *extensions, getdns_dict **response)
{
	getdns_sync_loop loop;
	getdns_return_t r;

	if (!context || !address || !response)
		return GETDNS_RETURN_INVALID_PARAMETER;

	if ((r = getdns_sync_loop_init(context, &loop)))
		return r;

	if ((r = _getdns_hostname_loop(context, &loop.loop.loop, address,
	    extensions, &loop, NULL, getdns_sync_cb))) {

		getdns_sync_loop_cleanup(&loop);
		return r;
	}
	getdns_sync_loop_run(&loop);
	
	return (*response = loop.response) ?
	    GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR;
}