summaryrefslogtreecommitdiff
path: root/netfs/daemon/daemonService.cpp
blob: 024e5a548f202024062dc4785ba76616203bea4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "pch.hpp"
#include "daemonService.h"
#include "daemonVolume.h"

ServiceServer::ServiceServer(int16_t hs, DaemonConfigPtr c) :
	config(c),
	hostseed(hs)
{
}

NetFS::VolumePrx
ServiceServer::connect(const std::string & share, const std::string &, const Ice::Current & ice)
{
	//boost::lock_guard<boost::mutex> lg(lock);
	DaemonConfig::ExportMap::iterator e = config->exports.find(share);
	if (e == config->exports.end()) {
		throw NetFS::ConfigError();
	}
	return NetFS::VolumePrx::checkedCast(ice.adapter->addWithUUID(new VolumeServer(e->second->root)));
}