Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Unified Diff: net/dns/dns_response.cc

Issue 11567031: [net/dns] Handle TC bit on DNS response in DnsTransaction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test for timeout and fix timeout logic Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/dns/dns_response.cc
diff --git a/net/dns/dns_response.cc b/net/dns/dns_response.cc
index 354622d53801f20eafa5cc81fa8841ae17c14770..625e7c041dc0ddfc0eb5c02dc650b22d58fba7d2 100644
--- a/net/dns/dns_response.cc
+++ b/net/dns/dns_response.cc
@@ -131,6 +131,10 @@ DnsResponse::DnsResponse()
: io_buffer_(new IOBufferWithSize(dns_protocol::kMaxUDPSize + 1)) {
}
+DnsResponse::DnsResponse(size_t length)
+ : io_buffer_(new IOBufferWithSize(length)) {
+}
+
DnsResponse::DnsResponse(const void* data,
size_t length,
size_t answer_offset)
@@ -145,7 +149,7 @@ DnsResponse::~DnsResponse() {
bool DnsResponse::InitParse(int nbytes, const DnsQuery& query) {
// Response includes query, it should be at least that size.
- if (nbytes < query.io_buffer()->size() || nbytes > dns_protocol::kMaxUDPSize)
+ if (nbytes < query.io_buffer()->size() || nbytes >= io_buffer_->size())
mmenke 2012/12/19 17:15:48 Ahh...So why are you using ">=" rather than ">"?
szym 2012/12/19 18:16:24 If this check was ">", then there is no way to cat
mmenke 2012/12/19 18:21:29 Thanks for the explanation.
return false;
// Match the query id.

Powered by Google App Engine
This is Rietveld 408576698