MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / cancel

Method cancel

libminifi/src/sitetosite/SiteToSiteClient.cpp:312–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void SiteToSiteClient::cancel(const utils::Identifier& transactionID) {
313 std::shared_ptr<Transaction> transaction = NULL;
314
315 if (peer_state_ != READY) {
316 return;
317 }
318
319 auto it = this->known_transactions_.find(transactionID);
320
321 if (it == known_transactions_.end()) {
322 return;
323 } else {
324 transaction = it->second;
325 }
326
327 if (transaction->getState() == TRANSACTION_CANCELED || transaction->getState() == TRANSACTION_COMPLETED || transaction->getState() == TRANSACTION_ERROR) {
328 return;
329 }
330
331 this->writeResponse(transaction, CANCEL_TRANSACTION, "Cancel");
332 transaction->_state = TRANSACTION_CANCELED;
333
334 tearDown();
335 return;
336}
337
338void SiteToSiteClient::error(const utils::Identifier& transactionID) {
339 std::shared_ptr<Transaction> transaction = NULL;

Callers

nothing calls this directly

Calls 5

writeResponseMethod · 0.95
tearDownFunction · 0.85
findMethod · 0.45
endMethod · 0.45
getStateMethod · 0.45

Tested by

no test coverage detected