diff options
-rw-r--r-- | include/connection.h | 3 | ||||
-rw-r--r-- | include/modules.h | 1 | ||||
-rw-r--r-- | src/connection.cpp | 3 | ||||
-rw-r--r-- | src/inspircd.cpp | 5 |
4 files changed, 7 insertions, 5 deletions
diff --git a/include/connection.h b/include/connection.h index d92cc6354..2dd11633b 100644 --- a/include/connection.h +++ b/include/connection.h @@ -14,6 +14,7 @@ #include <errno.h> #include <time.h> #include <vector> +#include <deque> #ifndef __CONNECTION_H__ #define __CONNECTION_H__ @@ -110,7 +111,7 @@ class connection : public classbase bool BeginLink(char* targethost, int port, char* password, char* servername); void TerminateLink(char* targethost); bool SendPacket(char *message, char* host); - bool RecvPacket(string_list &messages, char* host); + bool RecvPacket(std::deque<std::string> &messages, char* host); ircd_connector* FindHost(std::string host); bool AddIncoming(int fd,char* targethost); long GenKey(); diff --git a/include/modules.h b/include/modules.h index 1db17b291..20fb5f04d 100644 --- a/include/modules.h +++ b/include/modules.h @@ -30,6 +30,7 @@ typedef std::deque<std::string> file_cache; typedef file_cache string_list; + // This #define allows us to call a method in all // loaded modules in a readable simple way, e.g.: // 'FOREACH_MOD OnConnect(user);' diff --git a/src/connection.cpp b/src/connection.cpp index 19424afc4..6073b0a4a 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -6,6 +6,7 @@ #include <sys/utsname.h> #include <vector> #include <string> +#include <deque> #include "inspircd.h" #include "modules.h" @@ -256,7 +257,7 @@ bool connection::SendPacket(char *message, char* host) // receives a packet from any where there is data waiting, first come, first served // fills the message and host values with the host where the data came from. -bool connection::RecvPacket(string_list &messages, char* host) +bool connection::RecvPacket(std::deque<std::string> &messages, char* host) { char data[32767]; for (int i = 0; i < this->connectors.size(); i++) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index b43734073..e11456b48 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -7082,14 +7082,14 @@ int InspIRCd(void) for (int x = 0; x != UDPportCount; x++) { - string_list msgs; + std::deque<std::string> msgs; msgs.clear(); if (me[x]->RecvPacket(msgs, udp_host)) { for (int ctr = 0; ctr < msgs.size(); ctr++) { char udp_msg[MAXBUF]; - strncpy(udp_msg,MAXBUF,msgs[ctr].c_str()); + strncpy(udp_msg,msgs[ctr].c_str(),MAXBUF); if (strlen(udp_msg)<1) { log(DEBUG,"Invalid string from %s [route%d]",udp_host,x); @@ -7101,7 +7101,6 @@ int InspIRCd(void) goto label; } } - } while (count2 != clientlist.end()) |