Send backend id back to main instance
This commit is contained in:
parent
b6645a4ed9
commit
6ec566375c
4 changed files with 11 additions and 0 deletions
|
@ -56,6 +56,7 @@ class NetworkPluginServer {
|
|||
bool acceptUsers;
|
||||
bool longRun;
|
||||
bool willDie;
|
||||
std::string id;
|
||||
};
|
||||
|
||||
NetworkPluginServer(Component *component, Config *config, UserManager *userManager, FileTransferManager *ftManager);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue