diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-04-05 14:31:33 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-04-05 14:31:33 -0700 |
commit | abb4f5f3ab911d0b0c5bc7d76c27592a1656bd12 (patch) | |
tree | 24545de119aefca873a79dc50e4f7139051fbf4d /include | |
parent | e3e91a3d3f1fa5ee731d40253223587e68e4fc9b (diff) | |
parent | 725aaf23367d88ef83c0fce538120eb35b9bf641 (diff) |
Merge pull request #6070 from ctiller/head-of-line-blocking
Fix a head of line blocking issue in the C++ server
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/grpc.h | 15 | ||||
-rw-r--r-- | include/grpc/impl/codegen/grpc_types.h | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 8b460722e2..5c868aece3 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -289,6 +289,14 @@ GRPCAPI grpc_call_error grpc_server_request_call( grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new); +/** How to handle payloads for a registered method */ +typedef enum { + /** Don't try to read the payload */ + GRPC_SRM_PAYLOAD_NONE, + /** Read the initial payload as a byte buffer */ + GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER +} grpc_server_register_method_payload_handling; + /** Registers a method in the server. Methods to this (host, method) pair will not be reported by grpc_server_request_call, but instead be reported by @@ -296,9 +304,10 @@ GRPCAPI grpc_call_error grpc_server_request_call( registered_method (as returned by this function). Must be called before grpc_server_start. Returns NULL on failure. */ -GRPCAPI void *grpc_server_register_method(grpc_server *server, - const char *method, const char *host, - uint32_t flags); +GRPCAPI void *grpc_server_register_method( + grpc_server *server, const char *method, const char *host, + grpc_server_register_method_payload_handling payload_handling, + uint32_t flags); /** Request notification of a new pre-registered call. 'cq_for_notification' must have been registered to the server via diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index aba4217d6a..4c7373006b 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -187,7 +187,9 @@ typedef enum grpc_call_error { server */ GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE, /** this batch of operations leads to more operations than allowed */ - GRPC_CALL_ERROR_BATCH_TOO_BIG + GRPC_CALL_ERROR_BATCH_TOO_BIG, + /** payload type requested is not the type registered */ + GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH } grpc_call_error; /* Write Flags: */ |