| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/dns/dns_query.h" | 5 #include "net/dns/dns_query.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/sys_byteorder.h" | 9 #include "base/sys_byteorder.h" |
| 10 #include "net/base/big_endian.h" | 10 #include "net/base/big_endian.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 DnsQuery::DnsQuery(const DnsQuery& orig, uint16 id) { | 73 DnsQuery::DnsQuery(const DnsQuery& orig, uint16 id) { |
| 74 qname_size_ = orig.qname_size_; | 74 qname_size_ = orig.qname_size_; |
| 75 io_buffer_ = new IOBufferWithSize(orig.io_buffer()->size()); | 75 io_buffer_ = new IOBufferWithSize(orig.io_buffer()->size()); |
| 76 memcpy(io_buffer_.get()->data(), orig.io_buffer()->data(), | 76 memcpy(io_buffer_.get()->data(), orig.io_buffer()->data(), |
| 77 io_buffer_.get()->size()); | 77 io_buffer_.get()->size()); |
| 78 dns_protocol::Header* header = | 78 dns_protocol::Header* header = |
| 79 reinterpret_cast<dns_protocol::Header*>(io_buffer_->data()); | 79 reinterpret_cast<dns_protocol::Header*>(io_buffer_->data()); |
| 80 header->id = base::HostToNet16(id); | 80 header->id = base::HostToNet16(id); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void DnsQuery::set_flags(uint16 flags) { |
| 84 dns_protocol::Header* header = |
| 85 reinterpret_cast<dns_protocol::Header*>(io_buffer_->data()); |
| 86 header->flags = flags; |
| 87 } |
| 88 |
| 83 } // namespace net | 89 } // namespace net |
| OLD | NEW |