summaryrefslogtreecommitdiff
path: root/src/dns.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-26 19:50:29 -0500
committerAdam <Adam@anope.org>2012-11-26 19:50:29 -0500
commitf23bad140b3abf3350c552c27c4e1d995337ce79 (patch)
tree14ad2f06498089ea2254ee693395c0e2daffe53f /src/dns.cpp
parent1bfafd9eb6ba10a3b9131c1df720bd01ebaa1dae (diff)
Revert a small part of 90930619bc124e94bac5048c0b13c3f4748b559d, evidently this was important
Diffstat (limited to 'src/dns.cpp')
-rw-r--r--src/dns.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index d295aabf0..e75f98449 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -535,11 +535,12 @@ bool Manager::TCPSocket::Client::ProcessRead()
length += i;
- short want_len = packet_buffer[0] << 8 | packet_buffer[1];
- if (length >= want_len - 2)
+ unsigned short want_len = packet_buffer[0] << 8 | packet_buffer[1];
+ if (length >= want_len + 2)
{
- SocketEngine::Change(this, false, SF_READABLE);
- return DNS::Engine->HandlePacket(this, packet_buffer + 2, length - 2, NULL);
+ int len = length - 2;
+ length -= want_len + 2;
+ return DNS::Engine->HandlePacket(this, packet_buffer + 2, len, NULL);
}
return true;
}