summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.cc
blob: 4a8d1207b737a49b9341bdb0f98999690299dbd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.h"

#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"

namespace quic {

QuicPathChallengeFrame::QuicPathChallengeFrame(
    QuicControlFrameId control_frame_id,
    const QuicPathFrameBuffer& data_buff)
    : control_frame_id(control_frame_id) {
  memcpy(data_buffer.data(), data_buff.data(), data_buffer.size());
}

QuicPathChallengeFrame::~QuicPathChallengeFrame() {}

std::ostream& operator<<(std::ostream& os,
                         const QuicPathChallengeFrame& frame) {
  os << "{ control_frame_id: " << frame.control_frame_id << ", data: "
     << quiche::QuicheTextUtils::HexEncode(
            reinterpret_cast<const char*>(frame.data_buffer.data()),
            frame.data_buffer.size())
     << " }\n";
  return os;
}

}  // namespace quic