Skip to content

Commit a095751

Browse files
committed
revert: send_ack
1 parent bc1ecd2 commit a095751

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/transaction/transaction.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl Transaction {
426426
}
427427
}
428428

429-
pub async fn send_ack(&mut self, mut connection: Option<SipConnection>) -> Result<()> {
429+
pub async fn send_ack(&mut self, connection: Option<SipConnection>) -> Result<()> {
430430
if self.transaction_type != TransactionType::ClientInvite {
431431
return Err(Error::TransactionError(
432432
"send_ack is only valid for client invite transactions".to_string(),
@@ -466,20 +466,12 @@ impl Transaction {
466466
} else {
467467
ack.to_owned().into()
468468
};
469-
if let SipMessage::Request(req) = &ack {
469+
470+
if let SipMessage::Request(ref req) = ack {
470471
if let Some(resp) = self.last_response.as_ref() {
471472
if resp.status_code.kind() == StatusCodeKind::Successful {
472473
// 2xx response, set destination from request
473-
if let Some(dest) = destination_from_request(req) {
474-
let (conn, addr) = self
475-
.endpoint_inner
476-
.transport_layer
477-
.lookup(&dest, Some(&self.key))
478-
.await?;
479-
480-
connection = Some(conn);
481-
self.destination = Some(addr);
482-
}
474+
self.destination = destination_from_request(&req);
483475
}
484476
}
485477
}

0 commit comments

Comments
 (0)