diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-04-23 07:56:33 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-04-23 07:56:33 -0700 |
commit | 3f2c2214b718ee61ddfd52efe922e652535aa537 (patch) | |
tree | 922ec210653fd93b7926f84ec9f52accbbaf40a7 /src/core/transport | |
parent | e5cb23ba550878c2e562cd2df9ba0d857da63667 (diff) |
Fiddling with an initial op
Diffstat (limited to 'src/core/transport')
-rw-r--r-- | src/core/transport/chttp2_transport.c | 1 | ||||
-rw-r--r-- | src/core/transport/transport.h | 36 |
2 files changed, 19 insertions, 18 deletions
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 9c2af560c1..acdc98b86b 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -607,6 +607,7 @@ static int init_stream(grpc_transport *gt, grpc_stream *gs, lock(t); s->id = 0; } else { + /* already locked */ s->id = (gpr_uint32)(gpr_uintptr)server_data; t->incoming_stream = s; grpc_chttp2_stream_map_add(&t->stream_map, s->id, s); diff --git a/src/core/transport/transport.h b/src/core/transport/transport.h index d0007680e3..a51e01d3c9 100644 --- a/src/core/transport/transport.h +++ b/src/core/transport/transport.h @@ -60,6 +60,23 @@ typedef enum grpc_stream_state { GRPC_STREAM_CLOSED } grpc_stream_state; +/* Transport op: a set of operations to perform on a transport */ +typedef struct grpc_transport_op { + grpc_stream_op_buffer *send_ops; + int is_last_send; + void (*on_done_send)(void *user_data, int success); + void *send_user_data; + + grpc_stream_op_buffer *recv_ops; + grpc_stream_state *recv_state; + void (*on_done_recv)(void *user_data, int success); + void *recv_user_data; + + grpc_pollset *bind_pollset; + + grpc_status_code cancel_with_status; +} grpc_transport_op; + /* Callbacks made from the transport to the upper layers of grpc. */ struct grpc_transport_callbacks { /* Initialize a new stream on behalf of the transport. @@ -98,7 +115,7 @@ size_t grpc_transport_stream_size(grpc_transport *transport); server_data - either NULL for a client initiated stream, or a pointer supplied from the accept_stream callback function */ int grpc_transport_init_stream(grpc_transport *transport, grpc_stream *stream, - const void *server_data); + const void *server_data, grpc_transport_op *initial_op); /* Destroy transport data for a stream. @@ -113,23 +130,6 @@ int grpc_transport_init_stream(grpc_transport *transport, grpc_stream *stream, void grpc_transport_destroy_stream(grpc_transport *transport, grpc_stream *stream); -/* Transport op: a set of operations to perform on a transport */ -typedef struct grpc_transport_op { - grpc_stream_op_buffer *send_ops; - int is_last_send; - void (*on_done_send)(void *user_data, int success); - void *send_user_data; - - grpc_stream_op_buffer *recv_ops; - grpc_stream_state *recv_state; - void (*on_done_recv)(void *user_data, int success); - void *recv_user_data; - - grpc_pollset *bind_pollset; - - grpc_status_code cancel_with_status; -} grpc_transport_op; - void grpc_transport_op_finish_with_failure(grpc_transport_op *op); /* TODO(ctiller): remove this */ |