| 296 | } |
| 297 | |
| 298 | void LogPushData::writeMessage(StringRef rawMessageWithoutLength, bool usePreviousLocations) { |
| 299 | if (!usePreviousLocations) { |
| 300 | prev_tags.clear(); |
| 301 | if (logSystem->hasRemoteLogs()) { |
| 302 | prev_tags.push_back(logSystem->getRandomRouterTag()); |
| 303 | } |
| 304 | for (auto& tag : next_message_tags) { |
| 305 | prev_tags.push_back(tag); |
| 306 | } |
| 307 | msg_locations.clear(); |
| 308 | logSystem->getPushLocations(prev_tags, msg_locations); |
| 309 | written_tags.insert(next_message_tags.begin(), next_message_tags.end()); |
| 310 | next_message_tags.clear(); |
| 311 | } |
| 312 | uint32_t subseq = this->subsequence++; |
| 313 | uint32_t msgsize = |
| 314 | rawMessageWithoutLength.size() + sizeof(subseq) + sizeof(uint16_t) + sizeof(Tag) * prev_tags.size(); |
| 315 | for (int loc : msg_locations) { |
| 316 | BinaryWriter& wr = messagesWriter[loc]; |
| 317 | wr << msgsize << subseq << uint16_t(prev_tags.size()); |
| 318 | for (auto& tag : prev_tags) |
| 319 | wr << tag; |
| 320 | wr.serializeBytes(rawMessageWithoutLength); |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | std::vector<Standalone<StringRef>> LogPushData::getAllMessages() { |
| 325 | std::vector<Standalone<StringRef>> results; |
no test coverage detected