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

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: respond to 2nd review 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
« no previous file with comments | « net/dns/dns_response.h ('k') | net/dns/dns_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
return false;
// Match the query id.
« no previous file with comments | « net/dns/dns_response.h ('k') | net/dns/dns_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698