Skip to content

Commit

Permalink
Merge "Build xmpp message string once instead of twice" into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jul 11, 2016
2 parents 323b547 + 84fedba commit 31c4a65
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/xmpp/xmpp_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,15 @@ bool XmppConnection::Send(const uint8_t *data, size_t size) {
if (session_ == NULL) {
return false;
}

TcpSession::Endpoint endpoint = session_->remote_endpoint();
string str(reinterpret_cast<const char *>(data), size);
if (!(mux_ &&
(mux_->TxMessageTrace(session_->remote_endpoint().address().to_string(),
session_->remote_endpoint().port(),
size,
string(reinterpret_cast<const char *>(data),
size), NULL)))) {
(mux_->TxMessageTrace(endpoint.address().to_string(),
endpoint.port(), size, str, NULL)))) {
XMPP_MESSAGE_TRACE(XmppTxStream,
session_->remote_endpoint().address().to_string(),
session_->remote_endpoint().port(), size,
string(reinterpret_cast<const char *>(data), size));
endpoint.address().to_string(),
endpoint.port(), size, str);
}

stats_[1].update++;
Expand Down

0 comments on commit 31c4a65

Please sign in to comment.