Sha256: 26fd6b4adfb47a28f382214f3cd1308d763f37b49f747bb345df5b637a32055b

Contents?: true

Size: 1.42 KB

Versions: 16

Compression:

Stored size: 1.42 KB

Contents

// Copyright 2021 gRPC authors.
//
// Licensed 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.

#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H

#include <grpc/support/port_platform.h>

#include <stdint.h>

namespace grpc_core {
namespace hpack_constants {
// Per entry overhead bytes as per the spec
static constexpr uint32_t kEntryOverhead = 32;
// Initial table size as per the spec
static constexpr uint32_t kInitialTableSize = 4096;

// last index in the static table
static constexpr uint32_t kLastStaticEntry = 61;

static constexpr uint32_t EntriesForBytes(uint32_t bytes) noexcept {
  return (bytes + kEntryOverhead - 1) / kEntryOverhead;
}

static constexpr uint32_t kInitialTableEntries =
    EntriesForBytes(kInitialTableSize);
}  // namespace hpack_constants
}  // namespace grpc_core

#endif  // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
grpc-1.48.0-x86_64-linux src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.48.0 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.48.0.pre1 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.48.0.pre1-x86_64-linux src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.47.0 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.47.0-x86_64-linux src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.46.3-x86_64-linux src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.46.3 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.46.2 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.46.2-x86_64-linux src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.45.0 src/core/ext/transport/chttp2/transport/hpack_constants.h
gitlab-grpc-1.42.1.gitlab src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.44.0.pre2 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.43.1 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.42.0 src/core/ext/transport/chttp2/transport/hpack_constants.h
grpc-1.42.0.pre1 src/core/ext/transport/chttp2/transport/hpack_constants.h