Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions cpp/src/IceGrid/ServerI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2440,24 +2440,37 @@ ServerI::checkAndUpdateUser(const shared_ptr<InternalServerDescriptor>& desc, bo
void
ServerI::updateRevision(const string& uuid, int revision)
{
_desc->uuid = uuid;
_desc->revision = revision;
// We must have either _desc or _load.
assert(_desc || _load);

string application;

// _desc can be nullptr if the server initial load didn't complete yet.
if (_desc)
{
_desc->uuid = uuid;
_desc->revision = revision;
application = _desc->application;
}

if (_load)
{
_load->getInternalServerDescriptor()->uuid = uuid;
_load->getInternalServerDescriptor()->revision = revision;

// When both _desc and _load are not null, this one prevails.
application = _load->getInternalServerDescriptor()->application;
}

string idFilePath = _serverDir + "/revision";
ofstream os(IceInternal::streamFilename(idFilePath).c_str()); // idFilePath is a UTF-8 string
if (os.good())
{
os << "#" << endl;
os << "# This server belongs to the application '" << _desc->application << "'" << endl;
os << "# This server belongs to the application '" << application << "'" << endl;
os << "#" << endl;
os << "uuid: " << _desc->uuid << endl;
os << "revision: " << _desc->revision << endl;
os << "uuid: " << uuid << endl;
os << "revision: " << revision << endl;
}
}

Expand Down
Loading