| 310 | } |
| 311 | |
| 312 | void 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 | |
| 338 | void SiteToSiteClient::error(const utils::Identifier& transactionID) { |
| 339 | std::shared_ptr<Transaction> transaction = NULL; |
nothing calls this directly
no test coverage detected