summaryrefslogtreecommitdiff
path: root/indra/newview/llsrv.cpp
blob: 07f14f780e9f1b285fb9a721f0aa4663ab7506b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/** 
 * @file llsrv.cpp
 * @brief Wrapper for DNS SRV record lookups
 *
 * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

#include "llviewerprecompiledheaders.h"

#include "llsrv.h"
#include "llares.h"

struct Responder : public LLAres::UriRewriteResponder
{
	std::vector<std::string> mUris;
	void rewriteResult(const std::vector<std::string> &uris) {
		for (size_t i = 0; i < uris.size(); i++)
		{
			llinfos << "[" << i << "] " << uris[i] << llendl;
		}
		mUris = uris;
	}
};

std::vector<std::string> LLSRV::rewriteURI(const std::string& uri)
{
	LLPointer<Responder> resp = new Responder;

	gAres->rewriteURI(uri, resp);
	gAres->processAll();
	return resp->mUris;
}