From 8be0c0008766de9003c7e8dd2ae74bf7c9dcd525 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 14 Apr 2004 18:58:25 +0000 Subject: More fixes to connection buffer handling git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@579 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 5b85093c1..b43734073 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -7082,16 +7082,22 @@ int InspIRCd(void) for (int x = 0; x != UDPportCount; x++) { - long theirkey = 0; - if (me[x]->RecvPacket(udp_msg, udp_host)) + string_list msgs; + msgs.clear(); + if (me[x]->RecvPacket(msgs, udp_host)) { - if (strlen(udp_msg)<1) { - log(DEBUG,"Invalid string from %s [route%d]",udp_host,x); - } - else - { - FOREACH_MOD OnPacketReceive(udp_msg); - handle_link_packet(udp_msg, udp_host, me[x]); + for (int ctr = 0; ctr < msgs.size(); ctr++) + { + char udp_msg[MAXBUF]; + strncpy(udp_msg,MAXBUF,msgs[ctr].c_str()); + if (strlen(udp_msg)<1) + { + log(DEBUG,"Invalid string from %s [route%d]",udp_host,x); + break; + } + FOREACH_MOD OnPacketReceive(udp_msg); + handle_link_packet(udp_msg, udp_host, me[x]); + } goto label; } } -- cgit v1.2.3