Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_http2.c File Reference
#include "nilorea/n_http2.h"
#include "nilorea/n_log.h"
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
+ Include dependency graph for ex_http2.c:

Go to the source code of this file.

Functions

static const char * find_hdr (const N_H2_HEADER *h, size_t n, const char *name)
 
int main (int argc, char **argv)
 
void process_args (int argc, char **argv)
 
static void test_boundaries (void)
 
static void test_hpack_guards (void)
 
static void test_hpack_overflow (void)
 
static void test_hpack_rfc_huffman (void)
 
static void test_hpack_rfc_requests (void)
 
static void test_hpack_roundtrip (void)
 
static void test_preface (void)
 
static void test_roundtrip (void)
 
static void test_settings (void)
 

Variables

static int failures = 0
 

Function Documentation

◆ find_hdr()

static const char * find_hdr ( const N_H2_HEADER h,
size_t  n,
const char *  name 
)
static
Examples
ex_http2.c.

Definition at line 127 of file ex_http2.c.

References N_H2_HEADER::value.

Referenced by test_hpack_rfc_huffman(), test_hpack_rfc_requests(), and test_hpack_roundtrip().

+ Here is the caller graph for this function:

◆ main()

◆ process_args()

void process_args ( int  argc,
char **  argv 
)

Definition at line 264 of file ex_http2.c.

References LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_NOTICE, LOG_NULL, and set_log_level().

+ Here is the call graph for this function:

◆ test_boundaries()

static void test_boundaries ( void  )
static

< DATA

< PING

< DATA

Examples
ex_http2.c.

Definition at line 67 of file ex_http2.c.

References failures, N_H2_DATA, N_H2_FRAME_HEADER_LEN, N_H2_PING, n_http2_frame_build_header(), and n_http2_frame_parse().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_hpack_guards()

static void test_hpack_guards ( void  )
static
Examples
ex_http2.c.

Definition at line 250 of file ex_http2.c.

References failures, n_http2_hpack_decode(), n_http2_hpack_free(), and n_http2_hpack_new().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_hpack_overflow()

static void test_hpack_overflow ( void  )
static
Examples
ex_http2.c.

Definition at line 236 of file ex_http2.c.

References failures, n_http2_hpack_decode(), n_http2_hpack_free(), and n_http2_hpack_new().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_hpack_rfc_huffman()

static void test_hpack_rfc_huffman ( void  )
static
Examples
ex_http2.c.

Definition at line 205 of file ex_http2.c.

References failures, find_hdr(), n_http2_hpack_decode(), n_http2_hpack_free(), n_http2_hpack_headers_free(), and n_http2_hpack_new().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_hpack_rfc_requests()

static void test_hpack_rfc_requests ( void  )
static
Examples
ex_http2.c.

Definition at line 171 of file ex_http2.c.

References failures, find_hdr(), n_http2_hpack_decode(), n_http2_hpack_free(), n_http2_hpack_headers_free(), and n_http2_hpack_new().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_hpack_roundtrip()

static void test_hpack_roundtrip ( void  )
static
Examples
ex_http2.c.

Definition at line 137 of file ex_http2.c.

References failures, find_hdr(), n_http2_hpack_decode(), n_http2_hpack_encode(), n_http2_hpack_free(), n_http2_hpack_headers_free(), n_http2_hpack_new(), N_H2_HEADER::name, and N_H2_HEADER::value.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_preface()

static void test_preface ( void  )
static
Examples
ex_http2.c.

Definition at line 120 of file ex_http2.c.

References failures, and N_H2_PREFACE.

Referenced by main().

+ Here is the caller graph for this function:

◆ test_roundtrip()

static void test_roundtrip ( void  )
static

< HEADERS

< HEADERS/PUSH_PROMISE/CONTINUATION: header block complete

< DATA/HEADERS: last frame of the stream

< HEADERS

< HEADERS/PUSH_PROMISE/CONTINUATION: header block complete

< DATA/HEADERS: last frame of the stream

< WINDOW_UPDATE

Examples
ex_http2.c.

Definition at line 37 of file ex_http2.c.

References failures, N_H2_FRAME::flags, N_H2_FRAME::length, N_H2_FLAG_END_HEADERS, N_H2_FLAG_END_STREAM, N_H2_FRAME_HEADER_LEN, N_H2_HEADERS, N_H2_WINDOW_UPDATE, n_http2_frame_build_header(), n_http2_frame_parse(), N_H2_FRAME::payload, N_H2_FRAME::stream_id, and N_H2_FRAME::type.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_settings()

static void test_settings ( void  )
static
Examples
ex_http2.c.

Definition at line 89 of file ex_http2.c.

References failures, N_H2_SETTINGS_INITIAL_WINDOW_SIZE, N_H2_SETTINGS_MAX_CONCURRENT_STREAMS, and n_http2_settings_parse().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ failures

int failures = 0
static

Definition at line 34 of file ex_http2.c.