diff options
author | Craig Tiller <ctiller@google.com> | 2015-04-22 11:14:26 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-04-22 11:14:26 -0700 |
commit | 629b0ed8041f96968e8e61c2b4992d08a38cf28a (patch) | |
tree | 8b07c219b83ce999efcf8db9a81f388007ec4ba4 /src/core/transport/stream_op.h | |
parent | 77979b08607a1e408fdbd8b0445dee3667742161 (diff) |
Call compiles
Diffstat (limited to 'src/core/transport/stream_op.h')
-rw-r--r-- | src/core/transport/stream_op.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/core/transport/stream_op.h b/src/core/transport/stream_op.h index dabe68f3bd..c3901bf608 100644 --- a/src/core/transport/stream_op.h +++ b/src/core/transport/stream_op.h @@ -50,9 +50,22 @@ typedef enum grpc_stream_op_code { Must be ignored by receivers */ GRPC_NO_OP, GRPC_OP_METADATA, - GRPC_OP_MESSAGE + /* Begin a message/metadata element/status - as defined by + grpc_message_type. */ + GRPC_OP_BEGIN_MESSAGE, + /* Add a slice of data to the current message/metadata element/status. + Must not overflow the forward declared length. */ + GRPC_OP_SLICE } grpc_stream_op_code; +/* Arguments for GRPC_OP_BEGIN */ +typedef struct grpc_begin_message { + /* How many bytes of data will this message contain */ + gpr_uint32 length; + /* Write flags for the message: see grpc.h GRPC_WRITE_xxx */ + gpr_uint32 flags; +} grpc_begin_message; + typedef struct grpc_linked_mdelem { grpc_mdelem *md; struct grpc_linked_mdelem *next; @@ -105,8 +118,9 @@ typedef struct grpc_stream_op { /* the arguments to this operation. union fields are named according to the associated op-code */ union { - grpc_byte_buffer *message; + grpc_begin_message begin_message; grpc_metadata_batch metadata; + gpr_slice slice; } data; } grpc_stream_op; @@ -134,8 +148,16 @@ void grpc_stream_ops_unref_owned_objects(grpc_stream_op *ops, size_t nops); /* Append a GRPC_NO_OP to a buffer */ void grpc_sopb_add_no_op(grpc_stream_op_buffer *sopb); -void grpc_sopb_add_message(grpc_stream_op_buffer *sopb, grpc_byte_buffer *bb); +/* Append a GRPC_OP_BEGIN to a buffer */ +void grpc_sopb_add_begin_message(grpc_stream_op_buffer *sopb, gpr_uint32 length, + gpr_uint32 flags); void grpc_sopb_add_metadata(grpc_stream_op_buffer *sopb, grpc_metadata_batch metadata); +/* Append a GRPC_SLICE to a buffer - does not ref/unref the slice */ +void grpc_sopb_add_slice(grpc_stream_op_buffer *sopb, gpr_slice slice); +/* Append a GRPC_OP_FLOW_CTL_CB to a buffer */ +void grpc_sopb_add_flow_ctl_cb(grpc_stream_op_buffer *sopb, + void (*cb)(void *arg, grpc_op_error error), + void *arg); /* Append a buffer to a buffer - does not ref/unref any internal objects */ void grpc_sopb_append(grpc_stream_op_buffer *sopb, grpc_stream_op *ops, size_t nops); |