string s (buffer.get());
shared_ptr<cxml::Document> xml (new cxml::Document ("EncodingRequest"));
xml->read_string (s);
+ /* This is a double-check; the server shouldn't even be on the candidate list
+ if it is the wrong version, but it doesn't hurt to make sure here.
+ */
if (xml->number_child<int> ("Version") != SERVER_LINK_VERSION) {
cerr << "Mismatched server/client versions\n";
LOG_ERROR_NC ("Mismatched server/client versions");
xmlpp::Document doc;
xmlpp::Element* root = doc.create_root_node ("ServerAvailable");
root->add_child("Threads")->add_child_text (raw_convert<string> (_worker_threads.size ()));
+ root->add_child("Version")->add_child_text (raw_convert<string> (SERVER_LINK_VERSION));
string xml = doc.write_to_string ("UTF-8");
if (_verbose) {
xml->read_string (s);
string const ip = socket->socket().remote_endpoint().address().to_string ();
- if (!server_found (ip)) {
+ if (!server_found (ip) && xml->optional_number_child<int>("Version").get_value_or (0) == SERVER_LINK_VERSION) {
ServerDescription sd (ip, xml->number_child<int> ("Threads"));
{
boost::mutex::scoped_lock lm (_mutex);