Changeset - 6ec566375c7d
[Not reviewed]
0 4 0
HanzZ - 13 years ago 2012-03-09 17:13:32
hanzz.k@gmail.com
Send backend id back to main instance
4 files changed with 11 insertions and 0 deletions:
0 comments (0 inline, 0 general)
include/transport/networkpluginserver.h
Show inline comments
 
@@ -56,6 +56,7 @@ class NetworkPluginServer {
 
			bool acceptUsers;
 
			bool longRun;
 
			bool willDie;
 
			std::string id;
 
		};
 

	
 
		NetworkPluginServer(Component *component, Config *config, UserManager *userManager, FileTransferManager *ftManager);
include/transport/protocol.proto
Show inline comments
 
@@ -106,6 +106,7 @@ message Stats {
 
	required int32 res = 1;
 
	required int32 init_res = 2;
 
	required int32 shared = 3;
 
	required string id = 4;
 
}
 

	
 
message File {
plugin/cpp/networkplugin.cpp
Show inline comments
 
@@ -41,6 +41,12 @@ namespace Transport {
 
	wrap.set_payload(MESSAGE); \
 
	wrap.SerializeToString(&MESSAGE);
 

	
 
template <class T> std::string stringOf(T object) {
 
	std::ostringstream os;
 
	os << object;
 
	return (os.str());
 
}
 

	
 
NetworkPlugin::NetworkPlugin() {
 
	m_pingReceived = false;
 

	
 
@@ -603,6 +609,8 @@ void NetworkPlugin::sendMemoryUsage() {
 
	std::string message;
 
	stats.SerializeToString(&message);
 

	
 
	stats.set_id(stringOf(getpid()));
 

	
 
	WRAP(message, pbnetwork::WrapperMessage_Type_TYPE_STATS);
 

	
 
	send(message);
src/networkpluginserver.cpp
Show inline comments
 
@@ -612,6 +612,7 @@ void NetworkPluginServer::handleStatsPayload(Backend *c, const std::string &data
 
	c->res = payload.res();
 
	c->init_res = payload.init_res();
 
	c->shared = payload.shared();
 
	c->id = payload.id();
 
}
 

	
 
void NetworkPluginServer::handleFTStartPayload(const std::string &data) {
0 comments (0 inline, 0 general)