Go to the documentation of this file.
26 #include "absl/strings/str_cat.h"
27 #include "absl/strings/str_format.h"
42 #define TEST(x) run_test(x, #x)
74 size_t i, merged_length, frame_size;
75 bool first_frame =
false;
76 bool in_header =
false;
77 bool end_header =
false;
78 bool is_closed =
false;
86 frame_size |=
static_cast<uint32_t>(
p[0]) << 16;
87 frame_size |=
static_cast<uint32_t>(
p[1]) << 8;
88 frame_size |=
static_cast<uint32_t>(
p[2]);
94 while (merged_length < frame_size + 9) {
105 }
else if (first_frame && header_is_eof &&
113 "stream is closed; new frame headers and data are not allowed");
119 "frame header is ended; new headers and continuations are not "
126 "parsing frame header; new headers and data are not allowed");
159 size_t nheaders, ...) {
168 va_start(
l, nheaders);
169 for (
i = 0;
i < nheaders;
i++) {
170 char*
key = va_arg(
l,
char*);
171 char*
value = va_arg(
l,
char*);
213 verify(params,
"000005 0104 deadbeef 00 0161 0161", 1,
"a",
"a");
214 verify(params,
"00000a 0104 deadbeef 00 0161 0161 00 0162 0163", 2,
"a",
"a",
259 int main(
int argc,
char** argv) {
ScopedArenaPtr MakeScopedArena(size_t initial_size, MemoryAllocator *memory_allocator)
return memset(p, 0, total)
char * grpc_dump_slice(const grpc_slice &s, uint32_t flags)
static Slice FromStaticString(const char *s)
GPRAPI void gpr_free(void *ptr)
#define GRPC_CHTTP2_DATA_FLAG_END_HEADERS
void EncodeHeaders(const EncodeHeaderOptions &options, const HeaderSet &headers, grpc_slice_buffer *output)
static void verify(const verify_params params, const char *expected, size_t nheaders,...)
#define GRPC_CHTTP2_FRAME_HEADER
grpc_core::ScopedArenaPtr arena
grpc_core::HPackCompressor * g_compressor
bool use_true_binary_metadata
void grpc_test_only_set_slice_hash_seed(uint32_t seed)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
#define GRPC_SLICE_START_PTR(slice)
#define GRPC_CHTTP2_FRAME_CONTINUATION
static ResourceQuotaRefPtr Default()
grpc_slice grpc_slice_merge(grpc_slice *slices, size_t nslices)
static void run_test(void(*test)(), const char *name)
GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb)
#define GRPC_SLICE_LENGTH(slice)
static void test_continuation_headers()
grpc_core::ExecCtx exec_ctx
static void CrashOnAppendError(absl::string_view, const grpc_core::Slice &)
static void verify_frames(grpc_slice_buffer &output, bool header_is_eof)
#define GRPC_CHTTP2_DATA_FLAG_END_STREAM
#define GRPC_CHTTP2_FRAME_DATA
static void test_basic_headers()
static void verify_continuation_headers(const char *key, const char *value, bool is_eof)
static auto * g_memory_allocator
void grpc_slice_buffer_destroy_internal(grpc_slice_buffer *sb)
GRPCAPI void grpc_init(void)
grpc_slice parse_hexstring(const char *hexstring)
GPRAPI int grpc_slice_eq(grpc_slice a, grpc_slice b)
GRPCAPI void grpc_shutdown(void)
int main(int argc, char **argv)
void grpc_slice_unref_internal(const grpc_slice &slice)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:13