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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
/** @file
*
* A brief file description
*
* @section license License
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Http3DebugNames.h"
#include "Http3Types.h"
const char *
Http3DebugNames::frame_type(Http3FrameType type)
{
switch (type) {
case Http3FrameType::DATA:
return "DATA";
case Http3FrameType::HEADERS:
return "HEADERS";
case Http3FrameType::PRIORITY:
return "PRIORITY";
case Http3FrameType::CANCEL_PUSH:
return "CANCEL_PUSH";
case Http3FrameType::SETTINGS:
return "SETTINGS";
case Http3FrameType::PUSH_PROMISE:
return "PUSH_PROMISE";
case Http3FrameType::GOAWAY:
return "GOAWAY";
case Http3FrameType::DUPLICATE_PUSH_ID:
return "DUPLICATE_PUSH_ID";
case Http3FrameType::UNKNOWN:
default:
return "UNKNOWN";
}
}
const char *
Http3DebugNames::stream_type(Http3StreamType type)
{
return Http3DebugNames::stream_type(static_cast<uint8_t>(type));
}
const char *
Http3DebugNames::stream_type(uint8_t type)
{
switch (type) {
case static_cast<uint8_t>(Http3StreamType::CONTROL):
return "CONTROL";
case static_cast<uint8_t>(Http3StreamType::QPACK_ENCODER):
return "QPACK_ENCODER";
case static_cast<uint8_t>(Http3StreamType::PUSH):
return "PUSH";
case static_cast<uint8_t>(Http3StreamType::QPACK_DECODER):
return "QPACK_DECODER";
default:
return "UNKNOWN";
}
}
const char *
Http3DebugNames::settings_id(uint16_t id)
{
switch (id) {
case static_cast<uint16_t>(Http3SettingsId::HEADER_TABLE_SIZE):
return "HEADER_TABLE_SIZE";
case static_cast<uint16_t>(Http3SettingsId::MAX_HEADER_LIST_SIZE):
return "MAX_HEADER_LIST_SIZE";
case static_cast<uint16_t>(Http3SettingsId::QPACK_BLOCKED_STREAMS):
return "QPACK_BLOCKED_STREAMS";
case static_cast<uint16_t>(Http3SettingsId::NUM_PLACEHOLDERS):
return "NUM_PLACEHOLDERS";
default:
return "UNKNOWN";
}
}
const char *
Http3DebugNames::error_code(uint16_t code)
{
switch (code) {
case static_cast<uint16_t>(Http3ErrorCode::NO_ERROR):
return "NO_ERROR";
case static_cast<uint16_t>(Http3ErrorCode::WRONG_SETTING_DIRECTION):
return "WRONG_SETTING_DIRECTION";
case static_cast<uint16_t>(Http3ErrorCode::PUSH_REFUSED):
return "PUSH_REFUSED";
case static_cast<uint16_t>(Http3ErrorCode::INTERNAL_ERROR):
return "INTERNAL_ERROR";
case static_cast<uint16_t>(Http3ErrorCode::PUSH_ALREADY_IN_CACHE):
return "PUSH_ALREADY_IN_CACHE";
case static_cast<uint16_t>(Http3ErrorCode::REQUEST_CANCELLED):
return "REQUEST_CANCELLED";
case static_cast<uint16_t>(Http3ErrorCode::INCOMPLETE_REQUEST):
return "INCOMPLETE_REQUEST";
case static_cast<uint16_t>(Http3ErrorCode::CONNECT_ERROR):
return "CONNECT_ERROR";
case static_cast<uint16_t>(Http3ErrorCode::EXCESSIVE_LOAD):
return "EXCESSIVE_LOAD";
case static_cast<uint16_t>(Http3ErrorCode::VERSION_FALLBACK):
return "VERSION_FALLBACK";
case static_cast<uint16_t>(Http3ErrorCode::WRONG_STREAM):
return "WRONG_STREAM";
case static_cast<uint16_t>(Http3ErrorCode::LIMIT_EXCEEDED):
return "LIMIT_EXCEEDED";
case static_cast<uint16_t>(Http3ErrorCode::DUPLICATE_PUSH):
return "DUPLICATE_PUSH";
case static_cast<uint16_t>(Http3ErrorCode::UNKNOWN_STREAM_TYPE):
return "UNKNOWN_STREAM_TYPE";
case static_cast<uint16_t>(Http3ErrorCode::WRONG_STREAM_COUNT):
return "WRONG_STREAM_COUNT";
case static_cast<uint16_t>(Http3ErrorCode::CLOSED_CRITICAL_STREAM):
return "CLOSED_CRITICAL_STREAM";
case static_cast<uint16_t>(Http3ErrorCode::WRONG_STREAM_DIRECTION):
return "WRONG_STREAM_DIRECTION";
case static_cast<uint16_t>(Http3ErrorCode::EARLY_RESPONSE):
return "EARLY_RESPONSE";
case static_cast<uint16_t>(Http3ErrorCode::MISSING_SETTINGS):
return "MISSING_SETTINGS";
case static_cast<uint16_t>(Http3ErrorCode::UNEXPECTED_FRAME):
return "UNEXPECTED_FRAME";
case static_cast<uint16_t>(Http3ErrorCode::REQUEST_REJECTED):
return "REQUEST_REJECTED";
case static_cast<uint16_t>(Http3ErrorCode::QPACK_DECOMPRESSION_FAILED):
return "QPACK_DECOMPRESSION_FAILED";
case static_cast<uint16_t>(Http3ErrorCode::QPACK_ENCODER_STREAM_ERROR):
return "QPACK_ENCODER_STREAM_ERROR";
case static_cast<uint16_t>(Http3ErrorCode::QPACK_DECODER_STREAM_ERROR):
return "QPACK_DECODER_STREAM_ERROR";
default:
if (0x0100 <= code && code <= 0x01FF) {
return "MALFORMED_FRAME";
}
return "UNKNOWN";
}
}
|