Trivial little naming changes

This commit is contained in:
louiz’
2019-09-23 22:17:27 +02:00
parent b7b54d8f0e
commit 3339ce2cc0
4 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -398,7 +398,7 @@ void IrcClient::parse_in_buffer(const size_t)
} }
} }
void IrcClient::actual_send(std::pair<IrcMessage, MessageCallback> message_pair) void IrcClient::actual_send(std::pair<IrcMessage, MessageCallback>&& message_pair)
{ {
const IrcMessage& message = message_pair.first; const IrcMessage& message = message_pair.first;
const MessageCallback& callback = message_pair.second; const MessageCallback& callback = message_pair.second;
+1 -1
View File
@@ -92,7 +92,7 @@ public:
*/ */
void send_message(IrcMessage message, MessageCallback callback={}, bool throttle=true); void send_message(IrcMessage message, MessageCallback callback={}, bool throttle=true);
void send_raw(const std::string& txt); void send_raw(const std::string& txt);
void actual_send(std::pair<IrcMessage, MessageCallback> message_pair); void actual_send(std::pair<IrcMessage, MessageCallback>&& message_pair);
/** /**
* Send the PONG irc command * Send the PONG irc command
*/ */
+4 -5
View File
@@ -46,15 +46,14 @@ void TCPClientSocketHandler::init_socket(const struct addrinfo* rp)
else else
{ {
utils::ScopeGuard sg([result](){ freeaddrinfo(result); }); utils::ScopeGuard sg([result](){ freeaddrinfo(result); });
struct addrinfo* rp; for (; result; result = result->ai_next)
for (rp = result; rp; rp = rp->ai_next)
{ {
if ((::bind(this->socket, if ((::bind(this->socket,
reinterpret_cast<const struct sockaddr*>(rp->ai_addr), reinterpret_cast<const struct sockaddr*>(result->ai_addr),
rp->ai_addrlen)) == 0) result->ai_addrlen)) == 0)
break; break;
} }
if (!rp) if (!result)
log_error("Failed to bind socket to ", this->bind_addr, ": ", log_error("Failed to bind socket to ", this->bind_addr, ": ",
strerror(errno)); strerror(errno));
else else
+4 -4
View File
@@ -298,8 +298,8 @@ void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, con
{ {
XmlSubNode private_node(message, "private"); XmlSubNode private_node(message, "private");
private_node["xmlns"] = "urn:xmpp:carbons:2"; private_node["xmlns"] = "urn:xmpp:carbons:2";
XmlSubNode nocopy(message, "no-copy"); XmlSubNode nocopy_node(message, "no-copy");
nocopy["xmlns"] = "urn:xmpp:hints"; nocopy_node["xmlns"] = "urn:xmpp:hints";
} }
if (muc_private) if (muc_private)
{ {
@@ -590,8 +590,8 @@ void XmppComponent::send_version(const std::string& id, const std::string& jid_t
name.set_inner("biboumi"); name.set_inner("biboumi");
} }
{ {
XmlSubNode version(query, "version"); XmlSubNode version_node(query, "version");
version.set_inner(SOFTWARE_VERSION); version_node.set_inner(SOFTWARE_VERSION);
} }
{ {
XmlSubNode os(query, "os"); XmlSubNode os(query, "os");