aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-04-29 14:12:17 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-04-29 14:12:17 -0700
commit5f5fd6719b4397c96ae8910088d00b2632f9aec6 (patch)
treed0571fe6ac10f7de6bf21d14e914c4d3593701a3 /src/core
parenteeb428865b8413afce5288689fe6499eda0ece31 (diff)
Remove ungeneratable enum values and union members
Diffstat (limited to 'src/core')
-rw-r--r--src/core/surface/completion_queue.c96
-rw-r--r--src/core/surface/event_string.c45
2 files changed, 1 insertions, 140 deletions
diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c
index c1c97af337..3e9031807e 100644
--- a/src/core/surface/completion_queue.c
+++ b/src/core/surface/completion_queue.c
@@ -183,111 +183,17 @@ void grpc_cq_end_server_shutdown(grpc_completion_queue *cc, void *tag) {
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
}
-void grpc_cq_end_read(grpc_completion_queue *cc, void *tag, grpc_call *call,
- grpc_event_finish_func on_finish, void *user_data,
- grpc_byte_buffer *read) {
- event *ev;
- gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
- ev = add_locked(cc, GRPC_READ, tag, call, on_finish, user_data);
- ev->base.data.read = read;
- end_op_locked(cc, GRPC_READ);
- gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
-}
-
-void grpc_cq_end_write_accepted(grpc_completion_queue *cc, void *tag,
- grpc_call *call,
- grpc_event_finish_func on_finish,
- void *user_data, grpc_op_error error) {
- event *ev;
- gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
- ev = add_locked(cc, GRPC_WRITE_ACCEPTED, tag, call, on_finish, user_data);
- ev->base.data.write_accepted = error;
- end_op_locked(cc, GRPC_WRITE_ACCEPTED);
- gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
-}
-
-void grpc_cq_end_op_complete(grpc_completion_queue *cc, void *tag,
- grpc_call *call, grpc_event_finish_func on_finish,
- void *user_data, grpc_op_error error) {
- event *ev;
- gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
- ev = add_locked(cc, GRPC_OP_COMPLETE, tag, call, on_finish, user_data);
- ev->base.data.write_accepted = error;
- end_op_locked(cc, GRPC_OP_COMPLETE);
- gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
-}
-
void grpc_cq_end_op(grpc_completion_queue *cc, void *tag, grpc_call *call,
grpc_event_finish_func on_finish, void *user_data,
grpc_op_error error) {
event *ev;
gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
ev = add_locked(cc, GRPC_OP_COMPLETE, tag, call, on_finish, user_data);
- ev->base.data.write_accepted = error;
+ ev->base.data.op_complete = error;
end_op_locked(cc, GRPC_OP_COMPLETE);
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
}
-void grpc_cq_end_finish_accepted(grpc_completion_queue *cc, void *tag,
- grpc_call *call,
- grpc_event_finish_func on_finish,
- void *user_data, grpc_op_error error) {
- event *ev;
- gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
- ev = add_locked(cc, GRPC_FINISH_ACCEPTED, tag, call, on_finish, user_data);
- ev->base.data.finish_accepted = error;
- end_op_locked(cc, GRPC_FINISH_ACCEPTED);
- gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
-}
-
-void grpc_cq_end_client_metadata_read(grpc_completion_queue *cc, void *tag,
- grpc_call *call,
- grpc_event_finish_func on_finish,
- void *user_data, size_t count,
- grpc_metadata *elements) {
- event *ev;
- gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
- ev = add_locked(cc, GRPC_CLIENT_METADATA_READ, tag, call, on_finish,
- user_data);
- ev->base.data.client_metadata_read.count = count;
- ev->base.data.client_metadata_read.elements = elements;
- end_op_locked(cc, GRPC_CLIENT_METADATA_READ);
- gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
-}
-
-void grpc_cq_end_finished(grpc_completion_queue *cc, void *tag, grpc_call *call,
- grpc_event_finish_func on_finish, void *user_data,
- grpc_status_code status, const char *details,
- grpc_metadata *metadata_elements,
- size_t metadata_count) {
- event *ev;
- gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
- ev = add_locked(cc, GRPC_FINISHED, tag, call, on_finish, user_data);
- ev->base.data.finished.status = status;
- ev->base.data.finished.details = details;
- ev->base.data.finished.metadata_count = metadata_count;
- ev->base.data.finished.metadata_elements = metadata_elements;
- end_op_locked(cc, GRPC_FINISHED);
- gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
-}
-
-void grpc_cq_end_new_rpc(grpc_completion_queue *cc, void *tag, grpc_call *call,
- grpc_event_finish_func on_finish, void *user_data,
- const char *method, const char *host,
- gpr_timespec deadline, size_t metadata_count,
- grpc_metadata *metadata_elements) {
- event *ev;
- gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
- ev = add_locked(cc, GRPC_SERVER_RPC_NEW, tag, call, on_finish, user_data);
- ev->base.data.server_rpc_new.method = method;
- ev->base.data.server_rpc_new.host = host;
- ev->base.data.server_rpc_new.deadline = deadline;
- ev->base.data.server_rpc_new.metadata_count = metadata_count;
- ev->base.data.server_rpc_new.metadata_elements = metadata_elements;
- end_op_locked(cc, GRPC_SERVER_RPC_NEW);
- gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
-}
-
/* Create a GRPC_QUEUE_SHUTDOWN event without queuing it anywhere */
static event *create_shutdown_event(void) {
event *ev = gpr_malloc(sizeof(event));
diff --git a/src/core/surface/event_string.c b/src/core/surface/event_string.c
index 0fa3f166e2..30bdff6b85 100644
--- a/src/core/surface/event_string.c
+++ b/src/core/surface/event_string.c
@@ -62,7 +62,6 @@ static void adderr(gpr_strvec *buf, grpc_op_error err) {
char *grpc_event_string(grpc_event *ev) {
char *out;
- char *tmp;
gpr_strvec buf;
if (ev == NULL) return gpr_strdup("null");
@@ -76,55 +75,11 @@ char *grpc_event_string(grpc_event *ev) {
case GRPC_QUEUE_SHUTDOWN:
gpr_strvec_add(&buf, gpr_strdup("QUEUE_SHUTDOWN"));
break;
- case GRPC_READ:
- gpr_strvec_add(&buf, gpr_strdup("READ: "));
- addhdr(&buf, ev);
- if (ev->data.read) {
- gpr_asprintf(&tmp, " %d bytes",
- (int)grpc_byte_buffer_length(ev->data.read));
- gpr_strvec_add(&buf, tmp);
- } else {
- gpr_strvec_add(&buf, gpr_strdup(" end-of-stream"));
- }
- break;
case GRPC_OP_COMPLETE:
gpr_strvec_add(&buf, gpr_strdup("OP_COMPLETE: "));
addhdr(&buf, ev);
adderr(&buf, ev->data.op_complete);
break;
- case GRPC_WRITE_ACCEPTED:
- gpr_strvec_add(&buf, gpr_strdup("WRITE_ACCEPTED: "));
- addhdr(&buf, ev);
- adderr(&buf, ev->data.write_accepted);
- break;
- case GRPC_FINISH_ACCEPTED:
- gpr_strvec_add(&buf, gpr_strdup("FINISH_ACCEPTED: "));
- addhdr(&buf, ev);
- adderr(&buf, ev->data.write_accepted);
- break;
- case GRPC_CLIENT_METADATA_READ:
- gpr_strvec_add(&buf, gpr_strdup("CLIENT_METADATA_READ: "));
- addhdr(&buf, ev);
- gpr_asprintf(&tmp, " %d elements",
- (int)ev->data.client_metadata_read.count);
- gpr_strvec_add(&buf, tmp);
- break;
- case GRPC_FINISHED:
- gpr_strvec_add(&buf, gpr_strdup("FINISHED: "));
- addhdr(&buf, ev);
- gpr_asprintf(&tmp, " status=%d details='%s' %d metadata elements",
- ev->data.finished.status, ev->data.finished.details,
- (int)ev->data.finished.metadata_count);
- gpr_strvec_add(&buf, tmp);
- break;
- case GRPC_SERVER_RPC_NEW:
- gpr_strvec_add(&buf, gpr_strdup("SERVER_RPC_NEW: "));
- addhdr(&buf, ev);
- gpr_asprintf(&tmp, " method='%s' host='%s' %d metadata elements",
- ev->data.server_rpc_new.method, ev->data.server_rpc_new.host,
- (int)ev->data.server_rpc_new.metadata_count);
- gpr_strvec_add(&buf, tmp);
- break;
case GRPC_COMPLETION_DO_NOT_USE:
gpr_strvec_add(&buf, gpr_strdup("DO_NOT_USE (this is a bug)"));
addhdr(&buf, ev);