Classes | Namespaces | Macros | Functions | Variables
chttp2_transport.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <memory>
#include <new>
#include <string>
#include <utility>
#include "absl/base/attributes.h"
#include "absl/status/status.h"
#include "absl/strings/cord.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "absl/types/variant.h"
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpc/slice_buffer.h>
#include <grpc/status.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/context_list.h"
#include "src/core/ext/transport/chttp2/transport/flow_control.h"
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/ext/transport/chttp2/transport/frame_data.h"
#include "src/core/ext/transport/chttp2/transport/frame_goaway.h"
#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/ext/transport/chttp2/transport/stream_map.h"
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/global_config_env.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/promise/poll.h"
#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/resource_quota/trace.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_refcount.h"
#include "src/core/lib/transport/bdp_estimator.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/http2_errors.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/status_conversion.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/lib/transport/transport_impl.h"

Go to the source code of this file.

Classes

struct  cancel_stream_cb_args
 

Namespaces

 grpc_core
 

Macros

#define CLOSURE_BARRIER_FIRST_REF_BIT   (1 << 16)
 
#define CLOSURE_BARRIER_MAY_COVER_WRITE   (1 << 0)
 
#define DEFAULT_CLIENT_KEEPALIVE_TIME_MS   INT_MAX
 
#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS   20000 /* 20 seconds */
 
#define DEFAULT_CONNECTION_WINDOW_TARGET   (1024 * 1024)
 
#define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS   false
 
#define DEFAULT_MAX_HEADER_LIST_SIZE   (8 * 1024)
 
#define DEFAULT_MAX_PENDING_INDUCED_FRAMES   10000
 
#define DEFAULT_MAX_PING_STRIKES   2
 
#define DEFAULT_MAX_PINGS_BETWEEN_DATA   2
 
#define DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS   300000 /* 5 minutes */
 
#define DEFAULT_SERVER_KEEPALIVE_TIME_MS   7200000 /* 2 hours */
 
#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS   20000 /* 20 seconds */
 
#define KEEPALIVE_TIME_BACKOFF_MULTIPLIER   2
 
#define MAX_CLIENT_STREAM_ID   0x7fffffffu
 
#define MAX_WINDOW   0x7fffffffu
 
#define MAX_WRITE_BUFFER_SIZE   (64 * 1024 * 1024)
 

Functions

static grpc_closureadd_closure_barrier (grpc_closure *closure)
 
static void add_error (grpc_error_handle error, grpc_error_handle *refs, size_t *nrefs)
 
static const char * begin_writing_desc (bool partial)
 
static void benign_reclaimer_locked (void *arg, grpc_error_handle error)
 
static void cancel_pings (grpc_chttp2_transport *t, grpc_error_handle error)
 
static void cancel_stream_cb (void *user_data, uint32_t, void *stream)
 
static void cancel_unstarted_streams (grpc_chttp2_transport *t, grpc_error_handle error)
 
static grpc_endpointchttp2_get_endpoint (grpc_transport *t)
 
static void close_from_api (grpc_chttp2_transport *t, grpc_chttp2_stream *s, grpc_error_handle error)
 
static void close_transport_locked (grpc_chttp2_transport *t, grpc_error_handle error)
 
static void configure_transport_ping_policy (grpc_chttp2_transport *t)
 
static void connectivity_state_set (grpc_chttp2_transport *t, grpc_connectivity_state state, const absl::Status &status, const char *reason)
 
static bool contains_non_ok_status (grpc_metadata_batch *batch)
 
static void continue_read_action_locked (grpc_chttp2_transport *t)
 
static void destroy_stream (grpc_transport *gt, grpc_stream *gs, grpc_closure *then_schedule_closure)
 
static void destroy_stream_locked (void *sp, grpc_error_handle)
 
static void destroy_transport (grpc_transport *gt)
 
static void destroy_transport_locked (void *tp, grpc_error_handle)
 
static void destructive_reclaimer_locked (void *arg, grpc_error_handle error)
 
static void end_all_the_calls (grpc_chttp2_transport *t, grpc_error_handle error)
 
static void finish_bdp_ping (void *tp, grpc_error_handle error)
 
static void finish_bdp_ping_locked (void *tp, grpc_error_handle error)
 
static void finish_keepalive_ping (void *arg, grpc_error_handle error)
 
static void finish_keepalive_ping_locked (void *arg, grpc_error_handle error)
 
static void flush_write_list (grpc_chttp2_transport *t, grpc_chttp2_stream *s, grpc_chttp2_write_cb **list, grpc_error_handle error)
 
static const grpc_transport_vtableget_vtable (void)
 
 GPR_GLOBAL_CONFIG_DEFINE_BOOL (grpc_experimental_enable_peer_state_based_framing, false, "If set, the max sizes of frames sent to lower layers is controlled based " "on the peer's memory pressure which is reflected in its max http2 frame " "size.")
 
void grpc_chttp2_ack_ping (grpc_chttp2_transport *t, uint64_t id)
 
void grpc_chttp2_act_on_flowctl_action (const grpc_core::chttp2::FlowControlAction &action, grpc_chttp2_transport *t, grpc_chttp2_stream *s)
 
void grpc_chttp2_add_incoming_goaway (grpc_chttp2_transport *t, uint32_t goaway_error, uint32_t last_stream_id, absl::string_view goaway_text)
 
void grpc_chttp2_add_ping_strike (grpc_chttp2_transport *t)
 
void grpc_chttp2_cancel_stream (grpc_chttp2_transport *t, grpc_chttp2_stream *s, grpc_error_handle due_to_error)
 
void grpc_chttp2_complete_closure_step (grpc_chttp2_transport *t, grpc_chttp2_stream *, grpc_closure **pclosure, grpc_error_handle error, const char *desc)
 
void grpc_chttp2_config_default_keepalive_args (grpc_channel_args *args, bool is_client)
 
void grpc_chttp2_fail_pending_writes (grpc_chttp2_transport *t, grpc_chttp2_stream *s, grpc_error_handle error)
 
void grpc_chttp2_fake_status (grpc_chttp2_transport *t, grpc_chttp2_stream *s, grpc_error_handle error)
 
void grpc_chttp2_initiate_write (grpc_chttp2_transport *t, grpc_chttp2_initiate_write_reason reason)
 
const char * grpc_chttp2_initiate_write_reason_string (grpc_chttp2_initiate_write_reason reason)
 
void grpc_chttp2_mark_stream_closed (grpc_chttp2_transport *t, grpc_chttp2_stream *s, int close_reads, int close_writes, grpc_error_handle error)
 
void grpc_chttp2_mark_stream_writable (grpc_chttp2_transport *t, grpc_chttp2_stream *s)
 
void grpc_chttp2_maybe_complete_recv_initial_metadata (grpc_chttp2_transport *t, grpc_chttp2_stream *s)
 
void grpc_chttp2_maybe_complete_recv_message (grpc_chttp2_transport *t, grpc_chttp2_stream *s)
 
void grpc_chttp2_maybe_complete_recv_trailing_metadata (grpc_chttp2_transport *t, grpc_chttp2_stream *s)
 
grpc_chttp2_streamgrpc_chttp2_parsing_accept_stream (grpc_chttp2_transport *t, uint32_t id)
 
void grpc_chttp2_reset_ping_clock (grpc_chttp2_transport *t)
 
void grpc_chttp2_retry_initiate_ping (void *tp, grpc_error_handle error)
 
void grpc_chttp2_stream_ref (grpc_chttp2_stream *s, const char *reason)
 
void grpc_chttp2_stream_unref (grpc_chttp2_stream *s, const char *reason)
 
grpc_core::RefCountedPtr< grpc_core::channelz::SocketNodegrpc_chttp2_transport_get_socket_node (grpc_transport *transport)
 
void grpc_chttp2_transport_start_reading (grpc_transport *transport, grpc_slice_buffer *read_buffer, grpc_closure *notify_on_receive_settings, grpc_closure *notify_on_close)
 
grpc_transportgrpc_create_chttp2_transport (const grpc_channel_args *channel_args, grpc_endpoint *ep, bool is_client)
 
static void inc_initiate_write_reason (grpc_chttp2_initiate_write_reason reason)
 
static void init_keepalive_ping (void *arg, grpc_error_handle error)
 
static void init_keepalive_ping_locked (void *arg, grpc_error_handle error)
 
static void init_keepalive_pings_if_enabled (grpc_chttp2_transport *t)
 
static int init_stream (grpc_transport *gt, grpc_stream *gs, grpc_stream_refcount *refcount, const void *server_data, grpc_core::Arena *arena)
 
static void init_transport_keepalive_settings (grpc_chttp2_transport *t)
 
static void keepalive_watchdog_fired (void *arg, grpc_error_handle error)
 
static void keepalive_watchdog_fired_locked (void *arg, grpc_error_handle error)
 
static void log_metadata (const grpc_metadata_batch *md_batch, uint32_t id, bool is_client, bool is_initial)
 
static void maybe_start_some_streams (grpc_chttp2_transport *t)
 
static void next_bdp_ping_timer_expired (void *tp, grpc_error_handle error)
 
static void next_bdp_ping_timer_expired_locked (void *tp, grpc_error_handle error)
 
static void null_then_sched_closure (grpc_closure **closure)
 
static void perform_stream_op (grpc_transport *gt, grpc_stream *gs, grpc_transport_stream_op_batch *op)
 
static void perform_stream_op_locked (void *stream_op, grpc_error_handle)
 
static void perform_transport_op (grpc_transport *gt, grpc_transport_op *op)
 
static void perform_transport_op_locked (void *stream_op, grpc_error_handle)
 
static void post_benign_reclaimer (grpc_chttp2_transport *t)
 
static void post_destructive_reclaimer (grpc_chttp2_transport *t)
 
static void queue_setting_update (grpc_chttp2_transport *t, grpc_chttp2_setting_id id, uint32_t value)
 
static void read_action (void *t, grpc_error_handle error)
 
static void read_action_locked (void *t, grpc_error_handle error)
 
static void read_channel_args (grpc_chttp2_transport *t, const grpc_channel_args *channel_args, bool is_client)
 
static grpc_error_handle removal_error (grpc_error_handle extra_error, grpc_chttp2_stream *s, const char *main_error_msg)
 
static void remove_stream (grpc_chttp2_transport *t, uint32_t id, grpc_error_handle error)
 
static void retry_initiate_ping_locked (void *tp, grpc_error_handle error)
 
void schedule_bdp_ping_locked (grpc_chttp2_transport *t)
 
static void send_goaway (grpc_chttp2_transport *t, grpc_error_handle error, bool immediate_disconnect_hint)
 
static void send_keepalive_ping_locked (grpc_chttp2_transport *t)
 
static void send_ping_locked (grpc_chttp2_transport *t, grpc_closure *on_initiate, grpc_closure *on_ack)
 
static void set_pollset (grpc_transport *gt, grpc_stream *, grpc_pollset *pollset)
 
static void set_pollset_set (grpc_transport *gt, grpc_stream *, grpc_pollset_set *pollset_set)
 
static void set_write_state (grpc_chttp2_transport *t, grpc_chttp2_write_state st, const char *reason)
 
static void start_bdp_ping (void *tp, grpc_error_handle error)
 
static void start_bdp_ping_locked (void *tp, grpc_error_handle error)
 
static void start_keepalive_ping (void *arg, grpc_error_handle error)
 
static void start_keepalive_ping_locked (void *arg, grpc_error_handle error)
 
void grpc_core::TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification (bool disable)
 
void grpc_core::TestOnlySetGlobalHttp2TransportDestructCallback (TestOnlyGlobalHttp2TransportDestructCallback callback)
 
void grpc_core::TestOnlySetGlobalHttp2TransportInitCallback (TestOnlyGlobalHttp2TransportInitCallback callback)
 
static grpc_error_handle try_http_parsing (grpc_chttp2_transport *t)
 
template<class F >
static void WithUrgency (grpc_chttp2_transport *t, grpc_core::chttp2::FlowControlAction::Urgency urgency, grpc_chttp2_initiate_write_reason reason, F action)
 
static void write_action (void *t, grpc_error_handle error)
 
static void write_action_begin_locked (void *t, grpc_error_handle error)
 
static void write_action_end (void *t, grpc_error_handle error)
 
static void write_action_end_locked (void *t, grpc_error_handle error)
 
static const char * write_state_name (grpc_chttp2_write_state st)
 

Variables

static bool g_default_client_keepalive_permit_without_calls
 
static int g_default_client_keepalive_time_ms
 
static int g_default_client_keepalive_timeout_ms
 
static int g_default_max_ping_strikes = DEFAULT_MAX_PING_STRIKES
 
static int g_default_max_pings_without_data = DEFAULT_MAX_PINGS_BETWEEN_DATA
 
static int g_default_min_recv_ping_interval_without_data_ms
 
static bool g_default_server_keepalive_permit_without_calls
 
static int g_default_server_keepalive_time_ms
 
static int g_default_server_keepalive_timeout_ms
 
grpc_core::TraceFlag grpc_http_trace (false, "http")
 
grpc_core::TraceFlag grpc_keepalive_trace (false, "http_keepalive")
 
grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount (false, "chttp2_refcount")
 
static const grpc_transport_vtable vtable
 

Macro Definition Documentation

◆ CLOSURE_BARRIER_FIRST_REF_BIT

#define CLOSURE_BARRIER_FIRST_REF_BIT   (1 << 16)

Definition at line 1228 of file chttp2_transport.cc.

◆ CLOSURE_BARRIER_MAY_COVER_WRITE

#define CLOSURE_BARRIER_MAY_COVER_WRITE   (1 << 0)

Definition at line 1225 of file chttp2_transport.cc.

◆ DEFAULT_CLIENT_KEEPALIVE_TIME_MS

#define DEFAULT_CLIENT_KEEPALIVE_TIME_MS   INT_MAX

Definition at line 107 of file chttp2_transport.cc.

◆ DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS

#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS   20000 /* 20 seconds */

Definition at line 108 of file chttp2_transport.cc.

◆ DEFAULT_CONNECTION_WINDOW_TARGET

#define DEFAULT_CONNECTION_WINDOW_TARGET   (1024 * 1024)

Definition at line 102 of file chttp2_transport.cc.

◆ DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS

#define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS   false

Definition at line 111 of file chttp2_transport.cc.

◆ DEFAULT_MAX_HEADER_LIST_SIZE

#define DEFAULT_MAX_HEADER_LIST_SIZE   (8 * 1024)

Definition at line 105 of file chttp2_transport.cc.

◆ DEFAULT_MAX_PENDING_INDUCED_FRAMES

#define DEFAULT_MAX_PENDING_INDUCED_FRAMES   10000

Definition at line 118 of file chttp2_transport.cc.

◆ DEFAULT_MAX_PING_STRIKES

#define DEFAULT_MAX_PING_STRIKES   2

Definition at line 116 of file chttp2_transport.cc.

◆ DEFAULT_MAX_PINGS_BETWEEN_DATA

#define DEFAULT_MAX_PINGS_BETWEEN_DATA   2

Definition at line 115 of file chttp2_transport.cc.

◆ DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS

#define DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS   300000 /* 5 minutes */

Definition at line 114 of file chttp2_transport.cc.

◆ DEFAULT_SERVER_KEEPALIVE_TIME_MS

#define DEFAULT_SERVER_KEEPALIVE_TIME_MS   7200000 /* 2 hours */

Definition at line 109 of file chttp2_transport.cc.

◆ DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS

#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS   20000 /* 20 seconds */

Definition at line 110 of file chttp2_transport.cc.

◆ KEEPALIVE_TIME_BACKOFF_MULTIPLIER

#define KEEPALIVE_TIME_BACKOFF_MULTIPLIER   2

Definition at line 112 of file chttp2_transport.cc.

◆ MAX_CLIENT_STREAM_ID

#define MAX_CLIENT_STREAM_ID   0x7fffffffu

Definition at line 138 of file chttp2_transport.cc.

◆ MAX_WINDOW

#define MAX_WINDOW   0x7fffffffu

Definition at line 103 of file chttp2_transport.cc.

◆ MAX_WRITE_BUFFER_SIZE

#define MAX_WRITE_BUFFER_SIZE   (64 * 1024 * 1024)

Definition at line 104 of file chttp2_transport.cc.

Function Documentation

◆ add_closure_barrier()

static grpc_closure* add_closure_barrier ( grpc_closure closure)
static

Definition at line 1230 of file chttp2_transport.cc.

◆ add_error()

static void add_error ( grpc_error_handle  error,
grpc_error_handle refs,
size_t *  nrefs 
)
static

Definition at line 2127 of file chttp2_transport.cc.

◆ begin_writing_desc()

static const char* begin_writing_desc ( bool  partial)
static

Definition at line 939 of file chttp2_transport.cc.

◆ benign_reclaimer_locked()

static void benign_reclaimer_locked ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2982 of file chttp2_transport.cc.

◆ cancel_pings()

static void cancel_pings ( grpc_chttp2_transport t,
grpc_error_handle  error 
)
static

Definition at line 1621 of file chttp2_transport.cc.

◆ cancel_stream_cb()

static void cancel_stream_cb ( void *  user_data,
uint32_t  ,
void *  stream 
)
static

Definition at line 2411 of file chttp2_transport.cc.

◆ cancel_unstarted_streams()

static void cancel_unstarted_streams ( grpc_chttp2_transport t,
grpc_error_handle  error 
)
static

Definition at line 1087 of file chttp2_transport.cc.

◆ chttp2_get_endpoint()

static grpc_endpoint* chttp2_get_endpoint ( grpc_transport t)
static

Definition at line 3097 of file chttp2_transport.cc.

◆ close_from_api()

static void close_from_api ( grpc_chttp2_transport t,
grpc_chttp2_stream s,
grpc_error_handle  error 
)
static

Definition at line 2247 of file chttp2_transport.cc.

◆ close_transport_locked()

static void close_transport_locked ( grpc_chttp2_transport t,
grpc_error_handle  error 
)
static

Definition at line 591 of file chttp2_transport.cc.

◆ configure_transport_ping_policy()

static void configure_transport_ping_policy ( grpc_chttp2_transport t)
static

Definition at line 459 of file chttp2_transport.cc.

◆ connectivity_state_set()

static void connectivity_state_set ( grpc_chttp2_transport t,
grpc_connectivity_state  state,
const absl::Status status,
const char *  reason 
)
static

Definition at line 2913 of file chttp2_transport.cc.

◆ contains_non_ok_status()

static bool contains_non_ok_status ( grpc_metadata_batch batch)
static

Definition at line 1313 of file chttp2_transport.cc.

◆ continue_read_action_locked()

static void continue_read_action_locked ( grpc_chttp2_transport t)
static

Definition at line 2602 of file chttp2_transport.cc.

◆ destroy_stream()

static void destroy_stream ( grpc_transport gt,
grpc_stream gs,
grpc_closure then_schedule_closure 
)
static

Definition at line 754 of file chttp2_transport.cc.

◆ destroy_stream_locked()

static void destroy_stream_locked ( void *  sp,
grpc_error_handle   
)
static

Definition at line 748 of file chttp2_transport.cc.

◆ destroy_transport()

static void destroy_transport ( grpc_transport gt)
static

Definition at line 585 of file chttp2_transport.cc.

◆ destroy_transport_locked()

static void destroy_transport_locked ( void *  tp,
grpc_error_handle   
)
static

Definition at line 573 of file chttp2_transport.cc.

◆ destructive_reclaimer_locked()

static void destructive_reclaimer_locked ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 3012 of file chttp2_transport.cc.

◆ end_all_the_calls()

static void end_all_the_calls ( grpc_chttp2_transport t,
grpc_error_handle  error 
)
static

Definition at line 2417 of file chttp2_transport.cc.

◆ finish_bdp_ping()

static void finish_bdp_ping ( void *  tp,
grpc_error_handle  error 
)
static

Definition at line 2647 of file chttp2_transport.cc.

◆ finish_bdp_ping_locked()

static void finish_bdp_ping_locked ( void *  tp,
grpc_error_handle  error 
)
static

Definition at line 2654 of file chttp2_transport.cc.

◆ finish_keepalive_ping()

static void finish_keepalive_ping ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2838 of file chttp2_transport.cc.

◆ finish_keepalive_ping_locked()

static void finish_keepalive_ping_locked ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2845 of file chttp2_transport.cc.

◆ flush_write_list()

static void flush_write_list ( grpc_chttp2_transport t,
grpc_chttp2_stream s,
grpc_chttp2_write_cb **  list,
grpc_error_handle  error 
)
static

Definition at line 2156 of file chttp2_transport.cc.

◆ get_vtable()

static const grpc_transport_vtable * get_vtable ( void  )
static

Definition at line 3113 of file chttp2_transport.cc.

◆ GPR_GLOBAL_CONFIG_DEFINE_BOOL()

GPR_GLOBAL_CONFIG_DEFINE_BOOL ( grpc_experimental_enable_peer_state_based_framing  ,
false  ,
"If  set,
the max sizes of frames sent to lower layers is controlled based " "on the peer 's memory pressure which is reflected in its max http2 frame " "size."   
)

◆ grpc_chttp2_ack_ping()

void grpc_chttp2_ack_ping ( grpc_chttp2_transport t,
uint64_t  id 
)

Definition at line 1704 of file chttp2_transport.cc.

◆ grpc_chttp2_act_on_flowctl_action()

void grpc_chttp2_act_on_flowctl_action ( const grpc_core::chttp2::FlowControlAction action,
grpc_chttp2_transport t,
grpc_chttp2_stream s 
)

Definition at line 2452 of file chttp2_transport.cc.

◆ grpc_chttp2_add_incoming_goaway()

void grpc_chttp2_add_incoming_goaway ( grpc_chttp2_transport t,
uint32_t  goaway_error,
uint32_t  last_stream_id,
absl::string_view  goaway_text 
)

Definition at line 1099 of file chttp2_transport.cc.

◆ grpc_chttp2_add_ping_strike()

void grpc_chttp2_add_ping_strike ( grpc_chttp2_transport t)

Add a new ping strike to ping_recv_state.ping_strikes. If ping_recv_state.ping_strikes > ping_policy.max_ping_strikes, it sends GOAWAY with error code ENHANCE_YOUR_CALM and additional debug data resembling "too_many_pings" followed by immediately closing the connection.

Definition at line 1845 of file chttp2_transport.cc.

◆ grpc_chttp2_cancel_stream()

void grpc_chttp2_cancel_stream ( grpc_chttp2_transport t,
grpc_chttp2_stream s,
grpc_error_handle  due_to_error 
)

Definition at line 2073 of file chttp2_transport.cc.

◆ grpc_chttp2_complete_closure_step()

void grpc_chttp2_complete_closure_step ( grpc_chttp2_transport t,
grpc_chttp2_stream ,
grpc_closure **  pclosure,
grpc_error_handle  error,
const char *  desc 
)

Definition at line 1247 of file chttp2_transport.cc.

◆ grpc_chttp2_config_default_keepalive_args()

void grpc_chttp2_config_default_keepalive_args ( grpc_channel_args args,
bool  is_client 
)

Set the default keepalive configurations, must only be called at initialization

Definition at line 2711 of file chttp2_transport.cc.

◆ grpc_chttp2_fail_pending_writes()

void grpc_chttp2_fail_pending_writes ( grpc_chttp2_transport t,
grpc_chttp2_stream s,
grpc_error_handle  error 
)

Definition at line 2170 of file chttp2_transport.cc.

◆ grpc_chttp2_fake_status()

void grpc_chttp2_fake_status ( grpc_chttp2_transport t,
grpc_chttp2_stream s,
grpc_error_handle  error 
)

Definition at line 2097 of file chttp2_transport.cc.

◆ grpc_chttp2_initiate_write()

void grpc_chttp2_initiate_write ( grpc_chttp2_transport t,
grpc_chttp2_initiate_write_reason  reason 
)

Transport writing call flow: grpc_chttp2_initiate_write() is called anywhere that we know bytes need to go out on the wire. If no other write has been started, a task is enqueued onto our workqueue. When that task executes, it obtains the global lock, and gathers the data to write. The global lock is dropped and we do the syscall to write. After writing, a follow-up check is made to see if another round of writing should be performed.

The actual call chain is documented in the implementation of this function.

Definition at line 891 of file chttp2_transport.cc.

◆ grpc_chttp2_initiate_write_reason_string()

const char* grpc_chttp2_initiate_write_reason_string ( grpc_chttp2_initiate_write_reason  reason)

Definition at line 3046 of file chttp2_transport.cc.

◆ grpc_chttp2_mark_stream_closed()

void grpc_chttp2_mark_stream_closed ( grpc_chttp2_transport t,
grpc_chttp2_stream s,
int  close_reads,
int  close_writes,
grpc_error_handle  error 
)

Definition at line 2193 of file chttp2_transport.cc.

◆ grpc_chttp2_mark_stream_writable()

void grpc_chttp2_mark_stream_writable ( grpc_chttp2_transport t,
grpc_chttp2_stream s 
)

add a ref to the stream and add it to the writable list; ref will be dropped in writing.c

Definition at line 931 of file chttp2_transport.cc.

◆ grpc_chttp2_maybe_complete_recv_initial_metadata()

void grpc_chttp2_maybe_complete_recv_initial_metadata ( grpc_chttp2_transport t,
grpc_chttp2_stream s 
)

Definition at line 1934 of file chttp2_transport.cc.

◆ grpc_chttp2_maybe_complete_recv_message()

void grpc_chttp2_maybe_complete_recv_message ( grpc_chttp2_transport t,
grpc_chttp2_stream s 
)

Definition at line 1956 of file chttp2_transport.cc.

◆ grpc_chttp2_maybe_complete_recv_trailing_metadata()

void grpc_chttp2_maybe_complete_recv_trailing_metadata ( grpc_chttp2_transport t,
grpc_chttp2_stream s 
)

Definition at line 2025 of file chttp2_transport.cc.

◆ grpc_chttp2_parsing_accept_stream()

grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream ( grpc_chttp2_transport t,
uint32_t  id 
)

Definition at line 766 of file chttp2_transport.cc.

◆ grpc_chttp2_reset_ping_clock()

void grpc_chttp2_reset_ping_clock ( grpc_chttp2_transport t)

Resets ping clock. Should be called when flushing window updates, initial/trailing metadata or data frames. For a server, it resets the number of ping strikes and the last_ping_recv_time. For a ping sender, it resets pings_before_data_required.

Definition at line 1861 of file chttp2_transport.cc.

◆ grpc_chttp2_retry_initiate_ping()

void grpc_chttp2_retry_initiate_ping ( void *  tp,
grpc_error_handle  error 
)

Definition at line 1688 of file chttp2_transport.cc.

◆ grpc_chttp2_stream_ref()

void grpc_chttp2_stream_ref ( grpc_chttp2_stream s,
const char *  reason 
)

Definition at line 656 of file chttp2_transport.cc.

◆ grpc_chttp2_stream_unref()

void grpc_chttp2_stream_unref ( grpc_chttp2_stream s,
const char *  reason 
)

Definition at line 659 of file chttp2_transport.cc.

◆ grpc_chttp2_transport_get_socket_node()

grpc_core::RefCountedPtr<grpc_core::channelz::SocketNode> grpc_chttp2_transport_get_socket_node ( grpc_transport transport)

Definition at line 3116 of file chttp2_transport.cc.

◆ grpc_chttp2_transport_start_reading()

void grpc_chttp2_transport_start_reading ( grpc_transport transport,
grpc_slice_buffer read_buffer,
grpc_closure notify_on_receive_settings,
grpc_closure notify_on_close 
)

Takes ownership of read_buffer, which (if non-NULL) contains leftover bytes previously read from the endpoint (e.g., by handshakers). If non-null, notify_on_receive_settings will be scheduled when HTTP/2 settings are received from the peer.

Definition at line 3128 of file chttp2_transport.cc.

◆ grpc_create_chttp2_transport()

grpc_transport* grpc_create_chttp2_transport ( const grpc_channel_args channel_args,
grpc_endpoint ep,
bool  is_client 
)

Creates a CHTTP2 Transport. This takes ownership of a resource_user ref from the caller; if the caller still needs the resource_user after creating a transport, the caller must take another ref.

Definition at line 3122 of file chttp2_transport.cc.

◆ inc_initiate_write_reason()

static void inc_initiate_write_reason ( grpc_chttp2_initiate_write_reason  reason)
static

Definition at line 819 of file chttp2_transport.cc.

◆ init_keepalive_ping()

static void init_keepalive_ping ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2770 of file chttp2_transport.cc.

◆ init_keepalive_ping_locked()

static void init_keepalive_ping_locked ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2777 of file chttp2_transport.cc.

◆ init_keepalive_pings_if_enabled()

static void init_keepalive_pings_if_enabled ( grpc_chttp2_transport t)
static

Definition at line 467 of file chttp2_transport.cc.

◆ init_stream()

static int init_stream ( grpc_transport gt,
grpc_stream gs,
grpc_stream_refcount refcount,
const void *  server_data,
grpc_core::Arena arena 
)
static

Definition at line 739 of file chttp2_transport.cc.

◆ init_transport_keepalive_settings()

static void init_transport_keepalive_settings ( grpc_chttp2_transport t)
static

Definition at line 433 of file chttp2_transport.cc.

◆ keepalive_watchdog_fired()

static void keepalive_watchdog_fired ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2876 of file chttp2_transport.cc.

◆ keepalive_watchdog_fired_locked()

static void keepalive_watchdog_fired_locked ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2884 of file chttp2_transport.cc.

◆ log_metadata()

static void log_metadata ( const grpc_metadata_batch md_batch,
uint32_t  id,
bool  is_client,
bool  is_initial 
)
static

Definition at line 1318 of file chttp2_transport.cc.

◆ maybe_start_some_streams()

static void maybe_start_some_streams ( grpc_chttp2_transport t)
static

Definition at line 1170 of file chttp2_transport.cc.

◆ next_bdp_ping_timer_expired()

static void next_bdp_ping_timer_expired ( void *  tp,
grpc_error_handle  error 
)
static

Definition at line 2685 of file chttp2_transport.cc.

◆ next_bdp_ping_timer_expired_locked()

static void next_bdp_ping_timer_expired_locked ( void *  tp,
grpc_error_handle  error 
)
static

Definition at line 2693 of file chttp2_transport.cc.

◆ null_then_sched_closure()

static void null_then_sched_closure ( grpc_closure **  closure)
static

Definition at line 1235 of file chttp2_transport.cc.

◆ perform_stream_op()

static void perform_stream_op ( grpc_transport gt,
grpc_stream gs,
grpc_transport_stream_op_batch op 
)
static

Definition at line 1590 of file chttp2_transport.cc.

◆ perform_stream_op_locked()

static void perform_stream_op_locked ( void *  stream_op,
grpc_error_handle   
)
static

Definition at line 1327 of file chttp2_transport.cc.

◆ perform_transport_op()

static void perform_transport_op ( grpc_transport gt,
grpc_transport_op op 
)
static

Definition at line 1917 of file chttp2_transport.cc.

◆ perform_transport_op_locked()

static void perform_transport_op_locked ( void *  stream_op,
grpc_error_handle   
)
static

Definition at line 1870 of file chttp2_transport.cc.

◆ post_benign_reclaimer()

static void post_benign_reclaimer ( grpc_chttp2_transport t)
static

Definition at line 2942 of file chttp2_transport.cc.

◆ post_destructive_reclaimer()

static void post_destructive_reclaimer ( grpc_chttp2_transport t)
static

Definition at line 2962 of file chttp2_transport.cc.

◆ queue_setting_update()

static void queue_setting_update ( grpc_chttp2_transport t,
grpc_chttp2_setting_id  id,
uint32_t  value 
)
static

Definition at line 1071 of file chttp2_transport.cc.

◆ read_action()

static void read_action ( void *  t,
grpc_error_handle  error 
)
static

Definition at line 2505 of file chttp2_transport.cc.

◆ read_action_locked()

static void read_action_locked ( void *  t,
grpc_error_handle  error 
)
static

Definition at line 2512 of file chttp2_transport.cc.

◆ read_channel_args()

static void read_channel_args ( grpc_chttp2_transport t,
const grpc_channel_args channel_args,
bool  is_client 
)
static

Definition at line 288 of file chttp2_transport.cc.

◆ removal_error()

static grpc_error_handle removal_error ( grpc_error_handle  extra_error,
grpc_chttp2_stream s,
const char *  main_error_msg 
)
static

Definition at line 2139 of file chttp2_transport.cc.

◆ remove_stream()

static void remove_stream ( grpc_chttp2_transport t,
uint32_t  id,
grpc_error_handle  error 
)
static

Definition at line 2044 of file chttp2_transport.cc.

◆ retry_initiate_ping_locked()

static void retry_initiate_ping_locked ( void *  tp,
grpc_error_handle  error 
)
static

Definition at line 1695 of file chttp2_transport.cc.

◆ schedule_bdp_ping_locked()

void schedule_bdp_ping_locked ( grpc_chttp2_transport t)

Definition at line 2612 of file chttp2_transport.cc.

◆ send_goaway()

static void send_goaway ( grpc_chttp2_transport t,
grpc_error_handle  error,
bool  immediate_disconnect_hint 
)
static

Definition at line 1815 of file chttp2_transport.cc.

◆ send_keepalive_ping_locked()

static void send_keepalive_ping_locked ( grpc_chttp2_transport t)
static

Definition at line 1652 of file chttp2_transport.cc.

◆ send_ping_locked()

static void send_ping_locked ( grpc_chttp2_transport t,
grpc_closure on_initiate,
grpc_closure on_ack 
)
static

Definition at line 1633 of file chttp2_transport.cc.

◆ set_pollset()

static void set_pollset ( grpc_transport gt,
grpc_stream ,
grpc_pollset pollset 
)
static

Definition at line 2926 of file chttp2_transport.cc.

◆ set_pollset_set()

static void set_pollset_set ( grpc_transport gt,
grpc_stream ,
grpc_pollset_set pollset_set 
)
static

Definition at line 2932 of file chttp2_transport.cc.

◆ set_write_state()

static void set_write_state ( grpc_chttp2_transport t,
grpc_chttp2_write_state  st,
const char *  reason 
)
static

Definition at line 796 of file chttp2_transport.cc.

◆ start_bdp_ping()

static void start_bdp_ping ( void *  tp,
grpc_error_handle  error 
)
static

Definition at line 2623 of file chttp2_transport.cc.

◆ start_bdp_ping_locked()

static void start_bdp_ping_locked ( void *  tp,
grpc_error_handle  error 
)
static

Definition at line 2630 of file chttp2_transport.cc.

◆ start_keepalive_ping()

static void start_keepalive_ping ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2810 of file chttp2_transport.cc.

◆ start_keepalive_ping_locked()

static void start_keepalive_ping_locked ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 2817 of file chttp2_transport.cc.

◆ try_http_parsing()

static grpc_error_handle try_http_parsing ( grpc_chttp2_transport t)
static

Definition at line 2476 of file chttp2_transport.cc.

◆ WithUrgency()

template<class F >
static void WithUrgency ( grpc_chttp2_transport t,
grpc_core::chttp2::FlowControlAction::Urgency  urgency,
grpc_chttp2_initiate_write_reason  reason,
F  action 
)
static

Definition at line 2437 of file chttp2_transport.cc.

◆ write_action()

static void write_action ( void *  t,
grpc_error_handle  error 
)
static

Definition at line 987 of file chttp2_transport.cc.

◆ write_action_begin_locked()

static void write_action_begin_locked ( void *  t,
grpc_error_handle  error 
)
static

Definition at line 947 of file chttp2_transport.cc.

◆ write_action_end()

static void write_action_end ( void *  t,
grpc_error_handle  error 
)
static

Definition at line 1011 of file chttp2_transport.cc.

◆ write_action_end_locked()

static void write_action_end_locked ( void *  t,
grpc_error_handle  error 
)
static

Definition at line 1020 of file chttp2_transport.cc.

◆ write_state_name()

static const char* write_state_name ( grpc_chttp2_write_state  st)
static

Definition at line 784 of file chttp2_transport.cc.

Variable Documentation

◆ g_default_client_keepalive_permit_without_calls

bool g_default_client_keepalive_permit_without_calls
static
Initial value:

Definition at line 128 of file chttp2_transport.cc.

◆ g_default_client_keepalive_time_ms

int g_default_client_keepalive_time_ms
static
Initial value:

Definition at line 120 of file chttp2_transport.cc.

◆ g_default_client_keepalive_timeout_ms

int g_default_client_keepalive_timeout_ms
static
Initial value:

Definition at line 122 of file chttp2_transport.cc.

◆ g_default_max_ping_strikes

int g_default_max_ping_strikes = DEFAULT_MAX_PING_STRIKES
static

Definition at line 136 of file chttp2_transport.cc.

◆ g_default_max_pings_without_data

int g_default_max_pings_without_data = DEFAULT_MAX_PINGS_BETWEEN_DATA
static

Definition at line 135 of file chttp2_transport.cc.

◆ g_default_min_recv_ping_interval_without_data_ms

int g_default_min_recv_ping_interval_without_data_ms
static
Initial value:

Definition at line 133 of file chttp2_transport.cc.

◆ g_default_server_keepalive_permit_without_calls

bool g_default_server_keepalive_permit_without_calls
static
Initial value:

Definition at line 130 of file chttp2_transport.cc.

◆ g_default_server_keepalive_time_ms

int g_default_server_keepalive_time_ms
static
Initial value:

Definition at line 124 of file chttp2_transport.cc.

◆ g_default_server_keepalive_timeout_ms

int g_default_server_keepalive_timeout_ms
static
Initial value:

Definition at line 126 of file chttp2_transport.cc.

◆ grpc_http_trace

grpc_core::TraceFlag grpc_http_trace(false, "http")

◆ grpc_keepalive_trace

grpc_core::TraceFlag grpc_keepalive_trace(false, "http_keepalive")

◆ grpc_trace_chttp2_refcount

grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false, "chttp2_refcount")

◆ vtable

destroy_transport
static void destroy_transport(grpc_transport *gt)
Definition: chttp2_transport.cc:585
set_pollset
static void set_pollset(grpc_transport *gt, grpc_stream *, grpc_pollset *pollset)
Definition: chttp2_transport.cc:2926
DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS
#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS
Definition: chttp2_transport.cc:108
perform_stream_op
static void perform_stream_op(grpc_transport *gt, grpc_stream *gs, grpc_transport_stream_op_batch *op)
Definition: chttp2_transport.cc:1590
perform_transport_op
static void perform_transport_op(grpc_transport *gt, grpc_transport_op *op)
Definition: chttp2_transport.cc:1917
DEFAULT_CLIENT_KEEPALIVE_TIME_MS
#define DEFAULT_CLIENT_KEEPALIVE_TIME_MS
Definition: chttp2_transport.cc:107
grpc_chttp2_stream
struct grpc_chttp2_stream grpc_chttp2_stream
Definition: frame.h:25
DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS
#define DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS
Definition: chttp2_transport.cc:114
set_pollset_set
static void set_pollset_set(grpc_transport *gt, grpc_stream *, grpc_pollset_set *pollset_set)
Definition: chttp2_transport.cc:2932
init_stream
static int init_stream(grpc_transport *gt, grpc_stream *gs, grpc_stream_refcount *refcount, const void *server_data, grpc_core::Arena *arena)
Definition: chttp2_transport.cc:739
destroy_stream
static void destroy_stream(grpc_transport *gt, grpc_stream *gs, grpc_closure *then_schedule_closure)
Definition: chttp2_transport.cc:754
DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS
#define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS
Definition: chttp2_transport.cc:111
DEFAULT_SERVER_KEEPALIVE_TIME_MS
#define DEFAULT_SERVER_KEEPALIVE_TIME_MS
Definition: chttp2_transport.cc:109
DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS
#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS
Definition: chttp2_transport.cc:110
chttp2_get_endpoint
static grpc_endpoint * chttp2_get_endpoint(grpc_transport *t)
Definition: chttp2_transport.cc:3097


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:06