| 2716 | } |
| 2717 | |
| 2718 | void MultiVersionApi::updateSupportedVersions() { |
| 2719 | if (networkSetup) { |
| 2720 | Standalone<VectorRef<uint8_t>> versionStr; |
| 2721 | |
| 2722 | // not mutating the client, so just call on one instance of each client version. |
| 2723 | // thread 0 always exists. |
| 2724 | runOnExternalClients(0, [&versionStr](Reference<ClientInfo> client) { |
| 2725 | const char* ver = client->api->getClientVersion(); |
| 2726 | versionStr.append(versionStr.arena(), (uint8_t*)ver, (int)strlen(ver)); |
| 2727 | versionStr.append(versionStr.arena(), (uint8_t*)";", 1); |
| 2728 | }); |
| 2729 | |
| 2730 | if (!localClient->failed) { |
| 2731 | const char* local = localClient->api->getClientVersion(); |
| 2732 | versionStr.append(versionStr.arena(), (uint8_t*)local, (int)strlen(local)); |
| 2733 | } else { |
| 2734 | versionStr.resize(versionStr.arena(), std::max(0, versionStr.size() - 1)); |
| 2735 | } |
| 2736 | |
| 2737 | setNetworkOption(FDBNetworkOptions::SUPPORTED_CLIENT_VERSIONS, |
| 2738 | StringRef(versionStr.begin(), versionStr.size())); |
| 2739 | } |
| 2740 | } |
| 2741 | |
| 2742 | // Must be called from the main thread |
| 2743 | ACTOR Future<std::string> updateClusterSharedStateMapImpl(MultiVersionApi* self, |
no test coverage detected