summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/inspsocket.cpp12
-rw-r--r--src/modules/m_userip.cpp2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index d78ace318..410f928d9 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -248,11 +248,13 @@ void StreamSocket::DoWrite()
// The length limit of 1024 is to prevent merging strings
// more than once when writes begin to block.
std::string tmp;
- tmp.reserve(sendq_len);
- for(unsigned int i=0; i < sendq.size(); i++)
- tmp.append(sendq[i]);
- sendq.clear();
- sendq.push_back(tmp);
+ tmp.reserve(1280);
+ while (!sendq.empty() && tmp.length() < 1024)
+ {
+ tmp.append(sendq.front());
+ sendq.pop_front();
+ }
+ sendq.push_front(tmp);
}
std::string& front = sendq.front();
int itemlen = front.length();
diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp
index bfac36b1a..5ea84c04a 100644
--- a/src/modules/m_userip.cpp
+++ b/src/modules/m_userip.cpp
@@ -38,7 +38,7 @@ class CommandUserip : public Command
std::string retbuf = "340 " + user->nick + " :";
int nicks = 0;
bool checked_privs = false;
- bool has_privs;
+ bool has_privs = false;
for (int i = 0; i < (int)parameters.size(); i++)
{