|
|
@ -39,6 +39,7 @@ |
|
|
|
#include "src/core/lib/channel/channelz.h" |
|
|
|
#include "src/core/lib/channel/channelz.h" |
|
|
|
#include "src/core/lib/compression/stream_compression.h" |
|
|
|
#include "src/core/lib/compression/stream_compression.h" |
|
|
|
#include "src/core/lib/gprpp/manual_constructor.h" |
|
|
|
#include "src/core/lib/gprpp/manual_constructor.h" |
|
|
|
|
|
|
|
#include "src/core/lib/gprpp/sync.h" |
|
|
|
#include "src/core/lib/iomgr/combiner.h" |
|
|
|
#include "src/core/lib/iomgr/combiner.h" |
|
|
|
#include "src/core/lib/iomgr/endpoint.h" |
|
|
|
#include "src/core/lib/iomgr/endpoint.h" |
|
|
|
#include "src/core/lib/iomgr/timer.h" |
|
|
|
#include "src/core/lib/iomgr/timer.h" |
|
|
@ -253,7 +254,6 @@ class Chttp2IncomingByteStream : public ByteStream { |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
static void NextLocked(void* arg, grpc_error* error_ignored); |
|
|
|
static void NextLocked(void* arg, grpc_error* error_ignored); |
|
|
|
static void OrphanLocked(void* arg, grpc_error* error_ignored); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MaybeCreateStreamDecompressionCtx(); |
|
|
|
void MaybeCreateStreamDecompressionCtx(); |
|
|
|
|
|
|
|
|
|
|
@ -275,7 +275,6 @@ class Chttp2IncomingByteStream : public ByteStream { |
|
|
|
size_t max_size_hint; |
|
|
|
size_t max_size_hint; |
|
|
|
grpc_closure* on_complete; |
|
|
|
grpc_closure* on_complete; |
|
|
|
} next_action_; |
|
|
|
} next_action_; |
|
|
|
grpc_closure destroy_action_; |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
} // namespace grpc_core
|
|
|
|
} // namespace grpc_core
|
|
|
@ -294,14 +293,13 @@ struct grpc_chttp2_transport { |
|
|
|
~grpc_chttp2_transport(); |
|
|
|
~grpc_chttp2_transport(); |
|
|
|
|
|
|
|
|
|
|
|
grpc_transport base; /* must be first */ |
|
|
|
grpc_transport base; /* must be first */ |
|
|
|
|
|
|
|
grpc_core::Mutex mu; |
|
|
|
grpc_core::RefCount refs; |
|
|
|
grpc_core::RefCount refs; |
|
|
|
grpc_endpoint* ep; |
|
|
|
grpc_endpoint* ep; |
|
|
|
char* peer_string; |
|
|
|
char* peer_string; |
|
|
|
|
|
|
|
|
|
|
|
grpc_resource_user* resource_user; |
|
|
|
grpc_resource_user* resource_user; |
|
|
|
|
|
|
|
|
|
|
|
grpc_combiner* combiner; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
grpc_closure* notify_on_receive_settings = nullptr; |
|
|
|
grpc_closure* notify_on_receive_settings = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
/** write execution state of the transport */ |
|
|
|
/** write execution state of the transport */ |
|
|
@ -327,11 +325,11 @@ struct grpc_chttp2_transport { |
|
|
|
/** maps stream id to grpc_chttp2_stream objects */ |
|
|
|
/** maps stream id to grpc_chttp2_stream objects */ |
|
|
|
grpc_chttp2_stream_map stream_map; |
|
|
|
grpc_chttp2_stream_map stream_map; |
|
|
|
|
|
|
|
|
|
|
|
grpc_closure write_action_begin_locked; |
|
|
|
grpc_closure write_action_begin; |
|
|
|
grpc_closure write_action; |
|
|
|
grpc_closure write_action; |
|
|
|
grpc_closure write_action_end_locked; |
|
|
|
grpc_closure write_action_end; |
|
|
|
|
|
|
|
|
|
|
|
grpc_closure read_action_locked; |
|
|
|
grpc_closure read_action; |
|
|
|
|
|
|
|
|
|
|
|
/** incoming read bytes */ |
|
|
|
/** incoming read bytes */ |
|
|
|
grpc_slice_buffer read_buffer; |
|
|
|
grpc_slice_buffer read_buffer; |
|
|
@ -392,7 +390,7 @@ struct grpc_chttp2_transport { |
|
|
|
grpc_chttp2_repeated_ping_policy ping_policy; |
|
|
|
grpc_chttp2_repeated_ping_policy ping_policy; |
|
|
|
grpc_chttp2_repeated_ping_state ping_state; |
|
|
|
grpc_chttp2_repeated_ping_state ping_state; |
|
|
|
uint64_t ping_ctr = 0; /* unique id for pings */ |
|
|
|
uint64_t ping_ctr = 0; /* unique id for pings */ |
|
|
|
grpc_closure retry_initiate_ping_locked; |
|
|
|
grpc_closure retry_initiate_ping; |
|
|
|
|
|
|
|
|
|
|
|
/** ping acks */ |
|
|
|
/** ping acks */ |
|
|
|
size_t ping_ack_count = 0; |
|
|
|
size_t ping_ack_count = 0; |
|
|
@ -442,9 +440,9 @@ struct grpc_chttp2_transport { |
|
|
|
grpc_chttp2_write_cb* write_cb_pool = nullptr; |
|
|
|
grpc_chttp2_write_cb* write_cb_pool = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
/* bdp estimator */ |
|
|
|
/* bdp estimator */ |
|
|
|
grpc_closure next_bdp_ping_timer_expired_locked; |
|
|
|
grpc_closure next_bdp_ping_timer_expired; |
|
|
|
grpc_closure start_bdp_ping_locked; |
|
|
|
grpc_closure start_bdp_ping_locked; |
|
|
|
grpc_closure finish_bdp_ping_locked; |
|
|
|
grpc_closure finish_bdp_ping; |
|
|
|
|
|
|
|
|
|
|
|
/* if non-NULL, close the transport with this error when writes are finished
|
|
|
|
/* if non-NULL, close the transport with this error when writes are finished
|
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -459,9 +457,9 @@ struct grpc_chttp2_transport { |
|
|
|
/** have we scheduled a destructive cleanup? */ |
|
|
|
/** have we scheduled a destructive cleanup? */ |
|
|
|
bool destructive_reclaimer_registered = false; |
|
|
|
bool destructive_reclaimer_registered = false; |
|
|
|
/** benign cleanup closure */ |
|
|
|
/** benign cleanup closure */ |
|
|
|
grpc_closure benign_reclaimer_locked; |
|
|
|
grpc_closure benign_reclaimer; |
|
|
|
/** destructive cleanup closure */ |
|
|
|
/** destructive cleanup closure */ |
|
|
|
grpc_closure destructive_reclaimer_locked; |
|
|
|
grpc_closure destructive_reclaimer; |
|
|
|
|
|
|
|
|
|
|
|
/* next bdp ping timer */ |
|
|
|
/* next bdp ping timer */ |
|
|
|
bool have_next_bdp_ping_timer = false; |
|
|
|
bool have_next_bdp_ping_timer = false; |
|
|
@ -469,13 +467,13 @@ struct grpc_chttp2_transport { |
|
|
|
|
|
|
|
|
|
|
|
/* keep-alive ping support */ |
|
|
|
/* keep-alive ping support */ |
|
|
|
/** Closure to initialize a keepalive ping */ |
|
|
|
/** Closure to initialize a keepalive ping */ |
|
|
|
grpc_closure init_keepalive_ping_locked; |
|
|
|
grpc_closure init_keepalive_ping; |
|
|
|
/** Closure to run when the keepalive ping is sent */ |
|
|
|
/** Closure to run when the keepalive ping is sent */ |
|
|
|
grpc_closure start_keepalive_ping_locked; |
|
|
|
grpc_closure start_keepalive_ping_locked; |
|
|
|
/** Cousure to run when the keepalive ping ack is received */ |
|
|
|
/** Cousure to run when the keepalive ping ack is received */ |
|
|
|
grpc_closure finish_keepalive_ping_locked; |
|
|
|
grpc_closure finish_keepalive_ping; |
|
|
|
/** Closrue to run when the keepalive ping timeouts */ |
|
|
|
/** Closrue to run when the keepalive ping timeouts */ |
|
|
|
grpc_closure keepalive_watchdog_fired_locked; |
|
|
|
grpc_closure keepalive_watchdog_fired; |
|
|
|
/** timer to initiate ping events */ |
|
|
|
/** timer to initiate ping events */ |
|
|
|
grpc_timer keepalive_ping_timer; |
|
|
|
grpc_timer keepalive_ping_timer; |
|
|
|
/** watchdog to kill the transport when waiting for the keepalive ping */ |
|
|
|
/** watchdog to kill the transport when waiting for the keepalive ping */ |
|
|
@ -522,7 +520,6 @@ struct grpc_chttp2_stream { |
|
|
|
explicit Reffer(grpc_chttp2_stream* s); |
|
|
|
explicit Reffer(grpc_chttp2_stream* s); |
|
|
|
} reffer; |
|
|
|
} reffer; |
|
|
|
|
|
|
|
|
|
|
|
grpc_closure destroy_stream; |
|
|
|
|
|
|
|
grpc_closure* destroy_stream_arg; |
|
|
|
grpc_closure* destroy_stream_arg; |
|
|
|
|
|
|
|
|
|
|
|
grpc_chttp2_stream_link links[STREAM_LIST_COUNT]; |
|
|
|
grpc_chttp2_stream_link links[STREAM_LIST_COUNT]; |
|
|
@ -543,7 +540,7 @@ struct grpc_chttp2_stream { |
|
|
|
int64_t next_message_end_offset; |
|
|
|
int64_t next_message_end_offset; |
|
|
|
int64_t flow_controlled_bytes_written = 0; |
|
|
|
int64_t flow_controlled_bytes_written = 0; |
|
|
|
int64_t flow_controlled_bytes_flowed = 0; |
|
|
|
int64_t flow_controlled_bytes_flowed = 0; |
|
|
|
grpc_closure complete_fetch_locked; |
|
|
|
grpc_closure complete_fetch; |
|
|
|
grpc_closure* fetching_send_message_finished = nullptr; |
|
|
|
grpc_closure* fetching_send_message_finished = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
grpc_metadata_batch* recv_initial_metadata; |
|
|
|
grpc_metadata_batch* recv_initial_metadata; |
|
|
|