grpc 1.3.4 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (286) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +581 -450
  3. data/include/grpc/census.h +49 -49
  4. data/include/grpc/grpc.h +16 -70
  5. data/include/grpc/grpc_security.h +59 -59
  6. data/include/grpc/grpc_security_constants.h +9 -9
  7. data/include/grpc/impl/codegen/atm.h +1 -1
  8. data/include/grpc/impl/codegen/atm_windows.h +4 -4
  9. data/include/grpc/impl/codegen/byte_buffer_reader.h +2 -2
  10. data/include/grpc/impl/codegen/compression_types.h +4 -5
  11. data/include/grpc/impl/codegen/gpr_slice.h +5 -5
  12. data/include/grpc/impl/codegen/gpr_types.h +6 -7
  13. data/include/grpc/impl/codegen/grpc_types.h +128 -59
  14. data/include/grpc/impl/codegen/port_platform.h +6 -0
  15. data/include/grpc/impl/codegen/propagation_bits.h +2 -2
  16. data/include/grpc/impl/codegen/slice.h +13 -12
  17. data/include/grpc/impl/codegen/status.h +23 -18
  18. data/include/grpc/impl/codegen/sync.h +1 -1
  19. data/include/grpc/load_reporting.h +6 -6
  20. data/include/grpc/slice.h +47 -25
  21. data/include/grpc/slice_buffer.h +18 -14
  22. data/include/grpc/support/alloc.h +7 -7
  23. data/include/grpc/support/cmdline.h +10 -10
  24. data/include/grpc/support/cpu.h +3 -3
  25. data/include/grpc/support/histogram.h +1 -1
  26. data/include/grpc/support/host_port.h +2 -2
  27. data/include/grpc/support/log.h +9 -9
  28. data/include/grpc/support/log_windows.h +1 -1
  29. data/include/grpc/support/string_util.h +3 -3
  30. data/include/grpc/support/subprocess.h +3 -3
  31. data/include/grpc/support/sync.h +31 -31
  32. data/include/grpc/support/thd.h +11 -11
  33. data/include/grpc/support/time.h +12 -12
  34. data/include/grpc/support/tls.h +1 -1
  35. data/include/grpc/support/tls_gcc.h +2 -2
  36. data/include/grpc/support/tls_msvc.h +1 -1
  37. data/include/grpc/support/tls_pthread.h +1 -1
  38. data/include/grpc/support/useful.h +2 -2
  39. data/include/grpc/support/workaround_list.h +46 -0
  40. data/src/core/ext/census/context.c +1 -1
  41. data/src/core/ext/census/intrusive_hash_map.c +319 -0
  42. data/src/core/ext/census/intrusive_hash_map.h +167 -0
  43. data/src/core/ext/census/intrusive_hash_map_internal.h +63 -0
  44. data/src/core/ext/census/resource.c +3 -1
  45. data/src/core/ext/filters/client_channel/channel_connectivity.c +1 -1
  46. data/src/core/ext/filters/client_channel/client_channel.c +173 -103
  47. data/src/core/ext/filters/client_channel/client_channel_plugin.c +3 -2
  48. data/src/core/ext/filters/client_channel/lb_policy.c +2 -1
  49. data/src/core/ext/filters/client_channel/lb_policy.h +8 -7
  50. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c +153 -0
  51. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +42 -0
  52. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c +405 -102
  53. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c +133 -0
  54. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +65 -0
  55. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c +90 -51
  56. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +7 -1
  57. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +19 -8
  58. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +63 -34
  59. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c +2 -1
  60. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +188 -294
  61. data/src/core/ext/filters/client_channel/lb_policy_factory.c +28 -5
  62. data/src/core/ext/filters/client_channel/lb_policy_factory.h +18 -4
  63. data/src/core/ext/filters/client_channel/parse_address.c +90 -59
  64. data/src/core/ext/filters/client_channel/parse_address.h +17 -8
  65. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c +11 -7
  66. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +59 -14
  67. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +6 -0
  68. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c +3 -3
  69. data/src/core/ext/filters/client_channel/subchannel.c +20 -17
  70. data/src/core/ext/filters/client_channel/subchannel.h +1 -0
  71. data/src/core/ext/filters/client_channel/subchannel_index.c +11 -1
  72. data/src/core/ext/filters/client_channel/uri_parser.c +36 -22
  73. data/src/core/ext/filters/client_channel/uri_parser.h +1 -1
  74. data/src/core/{lib/channel → ext/filters/deadline}/deadline_filter.c +42 -17
  75. data/src/core/{lib/channel → ext/filters/deadline}/deadline_filter.h +8 -9
  76. data/src/core/{lib/channel → ext/filters/http/client}/http_client_filter.c +19 -11
  77. data/src/core/{lib/channel → ext/filters/http/client}/http_client_filter.h +3 -6
  78. data/src/core/ext/filters/http/http_filters_plugin.c +104 -0
  79. data/src/core/{lib/channel/compress_filter.c → ext/filters/http/message_compress/message_compress_filter.c} +124 -23
  80. data/src/core/{lib/channel/compress_filter.h → ext/filters/http/message_compress/message_compress_filter.h} +5 -6
  81. data/src/core/{lib/channel → ext/filters/http/server}/http_server_filter.c +4 -6
  82. data/src/core/{lib/channel → ext/filters/http/server}/http_server_filter.h +3 -3
  83. data/src/core/ext/filters/load_reporting/load_reporting.c +2 -25
  84. data/src/core/ext/filters/load_reporting/load_reporting_filter.c +26 -1
  85. data/src/core/ext/filters/max_age/max_age_filter.c +14 -14
  86. data/src/core/{lib/channel → ext/filters/message_size}/message_size_filter.c +91 -47
  87. data/src/core/{lib/channel → ext/filters/message_size}/message_size_filter.h +3 -3
  88. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c +223 -0
  89. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +40 -0
  90. data/src/core/ext/filters/workarounds/workaround_utils.c +65 -0
  91. data/src/core/ext/filters/workarounds/workaround_utils.h +52 -0
  92. data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +1 -1
  93. data/src/core/ext/transport/chttp2/server/chttp2_server.c +3 -2
  94. data/src/core/ext/transport/chttp2/transport/bin_decoder.c +2 -2
  95. data/src/core/ext/transport/chttp2/transport/bin_encoder.c +3 -3
  96. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +319 -175
  97. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -2
  98. data/src/core/ext/transport/chttp2/transport/frame_data.c +203 -164
  99. data/src/core/ext/transport/chttp2/transport/frame_data.h +8 -14
  100. data/src/core/ext/transport/chttp2/transport/frame_goaway.c +1 -1
  101. data/src/core/ext/transport/chttp2/transport/frame_ping.c +1 -1
  102. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +1 -1
  103. data/src/core/ext/transport/chttp2/transport/frame_settings.c +5 -5
  104. data/src/core/ext/transport/chttp2/transport/frame_window_update.c +1 -1
  105. data/src/core/ext/transport/chttp2/transport/hpack_encoder.c +4 -4
  106. data/src/core/ext/transport/chttp2/transport/hpack_parser.c +2 -4
  107. data/src/core/ext/transport/chttp2/transport/hpack_table.c +4 -3
  108. data/src/core/ext/transport/chttp2/transport/internal.h +50 -33
  109. data/src/core/ext/transport/chttp2/transport/parsing.c +10 -11
  110. data/src/core/ext/transport/chttp2/transport/writing.c +32 -13
  111. data/src/core/lib/channel/channel_args.c +30 -9
  112. data/src/core/lib/channel/channel_args.h +5 -1
  113. data/src/core/lib/channel/channel_stack.c +1 -1
  114. data/src/core/lib/channel/channel_stack.h +2 -2
  115. data/src/core/lib/channel/channel_stack_builder.c +13 -1
  116. data/src/core/lib/channel/channel_stack_builder.h +5 -1
  117. data/src/core/lib/channel/connected_channel.c +3 -1
  118. data/src/core/lib/channel/context.h +2 -2
  119. data/src/core/lib/compression/message_compress.c +2 -2
  120. data/src/core/lib/debug/trace.c +13 -6
  121. data/src/core/lib/debug/trace.h +27 -1
  122. data/src/core/lib/http/httpcli.c +1 -1
  123. data/src/core/lib/http/httpcli_security_connector.c +9 -11
  124. data/src/core/lib/http/parser.c +2 -2
  125. data/src/core/lib/http/parser.h +2 -1
  126. data/src/core/lib/iomgr/combiner.c +6 -6
  127. data/src/core/lib/iomgr/combiner.h +2 -1
  128. data/src/core/lib/iomgr/error.c +12 -5
  129. data/src/core/lib/iomgr/error.h +13 -13
  130. data/src/core/lib/iomgr/ev_epoll1_linux.c +984 -0
  131. data/src/core/lib/iomgr/ev_epoll1_linux.h +44 -0
  132. data/src/core/lib/iomgr/ev_epoll_limited_pollers_linux.c +2146 -0
  133. data/src/core/lib/iomgr/ev_epoll_limited_pollers_linux.h +43 -0
  134. data/src/core/lib/iomgr/ev_epoll_thread_pool_linux.c +1337 -0
  135. data/src/core/lib/iomgr/ev_epoll_thread_pool_linux.h +43 -0
  136. data/src/core/lib/iomgr/ev_epollex_linux.c +1511 -0
  137. data/src/core/lib/iomgr/ev_epollex_linux.h +43 -0
  138. data/src/core/lib/iomgr/{ev_epoll_linux.c → ev_epollsig_linux.c} +41 -33
  139. data/src/core/lib/iomgr/{ev_epoll_linux.h → ev_epollsig_linux.h} +4 -4
  140. data/src/core/lib/iomgr/ev_poll_posix.c +12 -27
  141. data/src/core/lib/iomgr/ev_poll_posix.h +2 -2
  142. data/src/core/lib/iomgr/ev_posix.c +22 -8
  143. data/src/core/lib/iomgr/ev_posix.h +4 -3
  144. data/src/core/lib/iomgr/ev_windows.c +43 -0
  145. data/src/core/lib/iomgr/exec_ctx.c +5 -0
  146. data/src/core/lib/iomgr/exec_ctx.h +2 -0
  147. data/src/core/lib/iomgr/iomgr.c +4 -0
  148. data/src/core/lib/iomgr/iomgr.h +3 -0
  149. data/src/core/lib/iomgr/is_epollexclusive_available.c +116 -0
  150. data/src/core/lib/iomgr/is_epollexclusive_available.h +41 -0
  151. data/src/core/lib/iomgr/lockfree_event.c +16 -0
  152. data/src/core/lib/iomgr/pollset.h +2 -5
  153. data/src/core/lib/iomgr/pollset_uv.c +1 -1
  154. data/src/core/lib/iomgr/pollset_windows.c +3 -3
  155. data/src/core/lib/iomgr/resource_quota.c +9 -8
  156. data/src/core/lib/iomgr/resource_quota.h +2 -1
  157. data/src/core/lib/iomgr/sockaddr_utils.h +1 -1
  158. data/src/core/lib/iomgr/socket_mutator.h +2 -0
  159. data/src/core/lib/iomgr/sys_epoll_wrapper.h +43 -0
  160. data/src/core/lib/iomgr/tcp_client_posix.c +6 -6
  161. data/src/core/lib/iomgr/tcp_client_uv.c +3 -3
  162. data/src/core/lib/iomgr/tcp_posix.c +7 -7
  163. data/src/core/lib/iomgr/tcp_posix.h +2 -1
  164. data/src/core/lib/iomgr/tcp_server_posix.c +1 -1
  165. data/src/core/lib/iomgr/tcp_uv.c +6 -6
  166. data/src/core/lib/iomgr/tcp_uv.h +2 -1
  167. data/src/core/lib/iomgr/tcp_windows.c +1 -1
  168. data/src/core/lib/iomgr/timer_generic.c +24 -25
  169. data/src/core/lib/iomgr/timer_manager.c +276 -0
  170. data/src/core/lib/iomgr/timer_manager.h +52 -0
  171. data/src/core/lib/iomgr/timer_uv.c +6 -0
  172. data/src/core/lib/iomgr/udp_server.c +42 -9
  173. data/src/core/lib/iomgr/udp_server.h +3 -1
  174. data/src/core/lib/security/credentials/credentials.c +0 -1
  175. data/src/core/lib/security/credentials/fake/fake_credentials.c +23 -0
  176. data/src/core/lib/security/credentials/fake/fake_credentials.h +12 -9
  177. data/src/core/lib/security/credentials/google_default/google_default_credentials.c +1 -1
  178. data/src/core/lib/security/credentials/jwt/jwt_credentials.c +1 -1
  179. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +1 -1
  180. data/src/core/lib/security/credentials/ssl/ssl_credentials.c +24 -53
  181. data/src/core/lib/security/transport/client_auth_filter.c +9 -3
  182. data/src/core/lib/security/transport/secure_endpoint.c +7 -7
  183. data/src/core/lib/security/transport/secure_endpoint.h +1 -1
  184. data/src/core/lib/security/transport/security_connector.c +45 -57
  185. data/src/core/lib/security/transport/security_connector.h +10 -14
  186. data/src/core/lib/security/transport/security_handshaker.c +123 -97
  187. data/src/core/lib/slice/b64.c +1 -1
  188. data/src/core/lib/slice/percent_encoding.c +3 -3
  189. data/src/core/lib/slice/slice.c +66 -33
  190. data/src/core/lib/slice/slice_buffer.c +25 -6
  191. data/src/core/lib/slice/slice_hash_table.c +33 -35
  192. data/src/core/lib/slice/slice_hash_table.h +7 -12
  193. data/src/core/lib/support/atomic.h +45 -0
  194. data/src/core/lib/support/atomic_with_atm.h +70 -0
  195. data/src/core/lib/support/atomic_with_std.h +48 -0
  196. data/src/core/lib/support/avl.c +14 -14
  197. data/src/core/lib/support/cmdline.c +3 -3
  198. data/src/core/lib/support/histogram.c +2 -2
  199. data/src/core/lib/support/host_port.c +1 -1
  200. data/src/core/lib/support/memory.h +74 -0
  201. data/src/core/lib/support/mpscq.c +36 -2
  202. data/src/core/lib/support/mpscq.h +28 -1
  203. data/src/core/lib/support/stack_lockfree.c +3 -36
  204. data/src/core/lib/support/string.c +12 -12
  205. data/src/core/lib/support/string_posix.c +1 -1
  206. data/src/core/lib/support/subprocess_posix.c +2 -2
  207. data/src/core/lib/support/thd_posix.c +1 -1
  208. data/src/core/lib/support/time_posix.c +8 -0
  209. data/src/core/lib/support/tmpfile_posix.c +10 -10
  210. data/src/core/lib/surface/alarm.c +3 -1
  211. data/src/core/lib/surface/api_trace.c +2 -1
  212. data/src/core/lib/surface/api_trace.h +2 -2
  213. data/src/core/lib/surface/byte_buffer_reader.c +1 -1
  214. data/src/core/lib/surface/call.c +65 -22
  215. data/src/core/lib/surface/call.h +4 -2
  216. data/src/core/lib/surface/channel_init.c +2 -19
  217. data/src/core/lib/surface/channel_stack_type.c +18 -0
  218. data/src/core/lib/surface/channel_stack_type.h +2 -0
  219. data/src/core/lib/surface/completion_queue.c +694 -247
  220. data/src/core/lib/surface/completion_queue.h +30 -13
  221. data/src/core/lib/surface/completion_queue_factory.c +24 -9
  222. data/src/core/lib/surface/init.c +1 -52
  223. data/src/core/lib/surface/{lame_client.c → lame_client.cc} +37 -26
  224. data/src/core/lib/surface/server.c +79 -110
  225. data/src/core/lib/surface/server.h +2 -1
  226. data/src/core/lib/surface/version.c +2 -2
  227. data/src/core/lib/transport/bdp_estimator.c +25 -9
  228. data/src/core/lib/transport/bdp_estimator.h +7 -1
  229. data/src/core/lib/transport/byte_stream.c +23 -9
  230. data/src/core/lib/transport/byte_stream.h +15 -6
  231. data/src/core/lib/transport/connectivity_state.c +6 -6
  232. data/src/core/lib/transport/connectivity_state.h +2 -1
  233. data/src/core/lib/transport/service_config.c +6 -13
  234. data/src/core/lib/transport/service_config.h +2 -2
  235. data/src/core/lib/transport/static_metadata.c +403 -389
  236. data/src/core/lib/transport/static_metadata.h +127 -114
  237. data/src/core/plugin_registry/grpc_plugin_registry.c +16 -0
  238. data/src/core/tsi/fake_transport_security.c +5 -4
  239. data/src/core/tsi/ssl_transport_security.c +71 -82
  240. data/src/core/tsi/ssl_transport_security.h +39 -61
  241. data/src/core/tsi/transport_security.c +83 -2
  242. data/src/core/tsi/transport_security.h +27 -2
  243. data/src/core/tsi/transport_security_adapter.c +236 -0
  244. data/src/core/tsi/transport_security_adapter.h +62 -0
  245. data/src/core/tsi/transport_security_interface.h +179 -66
  246. data/src/ruby/ext/grpc/extconf.rb +2 -1
  247. data/src/ruby/ext/grpc/rb_byte_buffer.c +8 -6
  248. data/src/ruby/ext/grpc/rb_call.c +56 -48
  249. data/src/ruby/ext/grpc/rb_call.h +3 -4
  250. data/src/ruby/ext/grpc/rb_call_credentials.c +23 -22
  251. data/src/ruby/ext/grpc/rb_channel.c +2 -3
  252. data/src/ruby/ext/grpc/rb_channel_args.c +11 -9
  253. data/src/ruby/ext/grpc/rb_channel_credentials.c +16 -12
  254. data/src/ruby/ext/grpc/rb_completion_queue.c +7 -9
  255. data/src/ruby/ext/grpc/rb_compression_options.c +7 -6
  256. data/src/ruby/ext/grpc/rb_event_thread.c +10 -12
  257. data/src/ruby/ext/grpc/rb_event_thread.h +1 -2
  258. data/src/ruby/ext/grpc/rb_grpc.c +11 -15
  259. data/src/ruby/ext/grpc/rb_grpc.h +2 -2
  260. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +16 -6
  261. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +25 -10
  262. data/src/ruby/ext/grpc/rb_server.c +26 -28
  263. data/src/ruby/lib/grpc/grpc.rb +1 -1
  264. data/src/ruby/lib/grpc/version.rb +1 -1
  265. data/third_party/cares/config_linux/ares_config.h +36 -2
  266. data/third_party/zlib/adler32.c +14 -7
  267. data/third_party/zlib/compress.c +24 -18
  268. data/third_party/zlib/crc32.c +29 -12
  269. data/third_party/zlib/deflate.c +499 -303
  270. data/third_party/zlib/deflate.h +19 -16
  271. data/third_party/zlib/gzguts.h +16 -7
  272. data/third_party/zlib/gzlib.c +17 -14
  273. data/third_party/zlib/gzread.c +108 -48
  274. data/third_party/zlib/gzwrite.c +210 -122
  275. data/third_party/zlib/infback.c +2 -2
  276. data/third_party/zlib/inffast.c +34 -51
  277. data/third_party/zlib/inflate.c +86 -37
  278. data/third_party/zlib/inflate.h +7 -4
  279. data/third_party/zlib/inftrees.c +12 -14
  280. data/third_party/zlib/trees.c +38 -61
  281. data/third_party/zlib/uncompr.c +66 -32
  282. data/third_party/zlib/zconf.h +32 -9
  283. data/third_party/zlib/zlib.h +298 -154
  284. data/third_party/zlib/zutil.c +25 -24
  285. data/third_party/zlib/zutil.h +35 -17
  286. metadata +63 -30
@@ -45,30 +45,30 @@ extern "C" {
45
45
  #define GRPC_X509_SAN_PROPERTY_NAME "x509_subject_alternative_name"
46
46
  #define GRPC_X509_PEM_CERT_PROPERTY_NAME "x509_pem_cert"
47
47
 
48
- /* Environment variable that points to the default SSL roots file. This file
48
+ /** Environment variable that points to the default SSL roots file. This file
49
49
  must be a PEM encoded file with all the roots such as the one that can be
50
50
  downloaded from https://pki.google.com/roots.pem. */
51
51
  #define GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR \
52
52
  "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH"
53
53
 
54
- /* Environment variable that points to the google default application
54
+ /** Environment variable that points to the google default application
55
55
  credentials json key or refresh token. Used in the
56
56
  grpc_google_default_credentials_create function. */
57
57
  #define GRPC_GOOGLE_CREDENTIALS_ENV_VAR "GOOGLE_APPLICATION_CREDENTIALS"
58
58
 
59
- /* Results for the SSL roots override callback. */
59
+ /** Results for the SSL roots override callback. */
60
60
  typedef enum {
61
61
  GRPC_SSL_ROOTS_OVERRIDE_OK,
62
- GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY, /* Do not try fallback options. */
62
+ GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY, /** Do not try fallback options. */
63
63
  GRPC_SSL_ROOTS_OVERRIDE_FAIL
64
64
  } grpc_ssl_roots_override_result;
65
65
 
66
66
  typedef enum {
67
- /* Server does not request client certificate. A client can present a self
67
+ /** Server does not request client certificate. A client can present a self
68
68
  signed or signed certificates if it wishes to do so and they would be
69
69
  accepted. */
70
70
  GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE,
71
- /* Server requests client certificate but does not enforce that the client
71
+ /** Server requests client certificate but does not enforce that the client
72
72
  presents a certificate.
73
73
 
74
74
  If the client presents a certificate, the client authentication is left to
@@ -77,7 +77,7 @@ typedef enum {
77
77
  The key cert pair should still be valid for the SSL connection to be
78
78
  established. */
79
79
  GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY,
80
- /* Server requests client certificate but does not enforce that the client
80
+ /** Server requests client certificate but does not enforce that the client
81
81
  presents a certificate.
82
82
 
83
83
  If the client presents a certificate, the client authentication is done by
@@ -87,7 +87,7 @@ typedef enum {
87
87
  The key cert pair should still be valid for the SSL connection to be
88
88
  established. */
89
89
  GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY,
90
- /* Server requests client certificate but enforces that the client presents a
90
+ /** Server requests client certificate but enforces that the client presents a
91
91
  certificate.
92
92
 
93
93
  If the client presents a certificate, the client authentication is left to
@@ -96,7 +96,7 @@ typedef enum {
96
96
  The key cert pair should still be valid for the SSL connection to be
97
97
  established. */
98
98
  GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY,
99
- /* Server requests client certificate but enforces that the client presents a
99
+ /** Server requests client certificate but enforces that the client presents a
100
100
  certificate.
101
101
 
102
102
  The cerificate presented by the client is verified by grpc framework (The
@@ -34,7 +34,7 @@
34
34
  #ifndef GRPC_IMPL_CODEGEN_ATM_H
35
35
  #define GRPC_IMPL_CODEGEN_ATM_H
36
36
 
37
- /* This interface provides atomic operations and barriers.
37
+ /** This interface provides atomic operations and barriers.
38
38
  It is internal to gpr support code and should not be used outside it.
39
39
 
40
40
  If an operation with acquire semantics precedes another memory access by the
@@ -34,7 +34,7 @@
34
34
  #ifndef GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
35
35
  #define GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
36
36
 
37
- /* Win32 variant of atm_platform.h */
37
+ /** Win32 variant of atm_platform.h */
38
38
  #include <grpc/impl/codegen/port_platform.h>
39
39
 
40
40
  typedef intptr_t gpr_atm;
@@ -64,7 +64,7 @@ static __inline void gpr_atm_no_barrier_store(gpr_atm *p, gpr_atm value) {
64
64
  }
65
65
 
66
66
  static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
67
- /* InterlockedCompareExchangePointerNoFence() not available on vista or
67
+ /** InterlockedCompareExchangePointerNoFence() not available on vista or
68
68
  windows7 */
69
69
  #ifdef GPR_ARCH_64
70
70
  return o == (gpr_atm)InterlockedCompareExchangeAcquire64(
@@ -107,7 +107,7 @@ static __inline int gpr_atm_full_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
107
107
 
108
108
  static __inline gpr_atm gpr_atm_no_barrier_fetch_add(gpr_atm *p,
109
109
  gpr_atm delta) {
110
- /* Use the CAS operation to get pointer-sized fetch and add */
110
+ /** Use the CAS operation to get pointer-sized fetch and add */
111
111
  gpr_atm old;
112
112
  do {
113
113
  old = *p;
@@ -116,7 +116,7 @@ static __inline gpr_atm gpr_atm_no_barrier_fetch_add(gpr_atm *p,
116
116
  }
117
117
 
118
118
  static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) {
119
- /* Use a CAS operation to get pointer-sized fetch and add */
119
+ /** Use a CAS operation to get pointer-sized fetch and add */
120
120
  gpr_atm old;
121
121
  #ifdef GPR_ARCH_64
122
122
  do {
@@ -43,9 +43,9 @@ struct grpc_byte_buffer;
43
43
  struct grpc_byte_buffer_reader {
44
44
  struct grpc_byte_buffer *buffer_in;
45
45
  struct grpc_byte_buffer *buffer_out;
46
- /* Different current objects correspond to different types of byte buffers */
46
+ /** Different current objects correspond to different types of byte buffers */
47
47
  union {
48
- /* Index into a slice buffer's array of slices */
48
+ /** Index into a slice buffer's array of slices */
49
49
  unsigned index;
50
50
  } current;
51
51
  };
@@ -34,8 +34,7 @@
34
34
  #ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
35
35
  #define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
36
36
 
37
- #include <stdbool.h>
38
- #include <stdint.h>
37
+ #include <grpc/impl/codegen/port_platform.h>
39
38
 
40
39
  #ifdef __cplusplus
41
40
  extern "C" {
@@ -68,7 +67,7 @@ extern "C" {
68
67
  "grpc.compression_enabled_algorithms_bitset"
69
68
  /** \} */
70
69
 
71
- /* The various compression algorithms supported by gRPC */
70
+ /** The various compression algorithms supported by gRPC */
72
71
  typedef enum {
73
72
  GRPC_COMPRESS_NONE = 0,
74
73
  GRPC_COMPRESS_DEFLATE,
@@ -101,7 +100,7 @@ typedef struct grpc_compression_options {
101
100
  * precedence over \a default_algorithm.
102
101
  * TODO(dgq): currently only available for server channels. */
103
102
  struct {
104
- bool is_set;
103
+ int is_set;
105
104
  grpc_compression_level level;
106
105
  } default_level;
107
106
 
@@ -109,7 +108,7 @@ typedef struct grpc_compression_options {
109
108
  * call specific settings. This option corresponds to the channel argument key
110
109
  * behind \a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM. */
111
110
  struct {
112
- bool is_set;
111
+ int is_set;
113
112
  grpc_compression_algorithm algorithm;
114
113
  } default_algorithm;
115
114
 
@@ -33,11 +33,11 @@
33
33
  #ifndef GRPC_IMPL_CODEGEN_GPR_SLICE_H
34
34
  #define GRPC_IMPL_CODEGEN_GPR_SLICE_H
35
35
 
36
- /* WARNING: Please do not use this header. This was added as a temporary measure
37
- * to not break some of the external projects that depend on gpr_slice_*
38
- * functions. We are actively working on moving all the gpr_slice_* references
39
- * to grpc_slice_* and this file will be removed
40
- * */
36
+ /** WARNING: Please do not use this header. This was added as a temporary
37
+ * measure to not break some of the external projects that depend on
38
+ * gpr_slice_* functions. We are actively working on moving all the
39
+ * gpr_slice_* references to grpc_slice_* and this file will be removed
40
+ */
41
41
 
42
42
  /* TODO (sreek) - Allowed by default but will be very soon turned off */
43
43
  #define GRPC_ALLOW_GPR_SLICE_FUNCTIONS 1
@@ -37,28 +37,27 @@
37
37
  #include <grpc/impl/codegen/port_platform.h>
38
38
 
39
39
  #include <stddef.h>
40
- #include <stdint.h>
41
40
 
42
41
  #ifdef __cplusplus
43
42
  extern "C" {
44
43
  #endif
45
44
 
46
- /* The clocks we support. */
45
+ /** The clocks we support. */
47
46
  typedef enum {
48
- /* Monotonic clock. Epoch undefined. Always moves forwards. */
47
+ /** Monotonic clock. Epoch undefined. Always moves forwards. */
49
48
  GPR_CLOCK_MONOTONIC = 0,
50
- /* Realtime clock. May jump forwards or backwards. Settable by
49
+ /** Realtime clock. May jump forwards or backwards. Settable by
51
50
  the system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970. */
52
51
  GPR_CLOCK_REALTIME,
53
- /* CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch
52
+ /** CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch
54
53
  undefined. Degrades to GPR_CLOCK_REALTIME on other platforms. */
55
54
  GPR_CLOCK_PRECISE,
56
- /* Unmeasurable clock type: no base, created by taking the difference
55
+ /** Unmeasurable clock type: no base, created by taking the difference
57
56
  between two times */
58
57
  GPR_TIMESPAN
59
58
  } gpr_clock_type;
60
59
 
61
- /* Analogous to struct timespec. On some machines, absolute times may be in
60
+ /** Analogous to struct timespec. On some machines, absolute times may be in
62
61
  * local time. */
63
62
  typedef struct gpr_timespec {
64
63
  int64_t tv_sec;
@@ -34,6 +34,8 @@
34
34
  #ifndef GRPC_IMPL_CODEGEN_GRPC_TYPES_H
35
35
  #define GRPC_IMPL_CODEGEN_GRPC_TYPES_H
36
36
 
37
+ #include <grpc/impl/codegen/port_platform.h>
38
+
37
39
  #include <grpc/impl/codegen/compression_types.h>
38
40
  #include <grpc/impl/codegen/exec_ctx_fwd.h>
39
41
  #include <grpc/impl/codegen/gpr_types.h>
@@ -41,7 +43,6 @@
41
43
  #include <grpc/impl/codegen/status.h>
42
44
 
43
45
  #include <stddef.h>
44
- #include <stdint.h>
45
46
 
46
47
  #ifdef __cplusplus
47
48
  extern "C" {
@@ -49,7 +50,7 @@ extern "C" {
49
50
 
50
51
  typedef enum {
51
52
  GRPC_BB_RAW
52
- /* Future types may include GRPC_BB_PROTOBUF, etc. */
53
+ /** Future types may include GRPC_BB_PROTOBUF, etc. */
53
54
  } grpc_byte_buffer_type;
54
55
 
55
56
  typedef struct grpc_byte_buffer {
@@ -66,8 +67,8 @@ typedef struct grpc_byte_buffer {
66
67
  } data;
67
68
  } grpc_byte_buffer;
68
69
 
69
- /** Completion Queues enable notification of the completion of asynchronous
70
- actions. */
70
+ /** Completion Queues enable notification of the completion of
71
+ * asynchronous actions. */
71
72
  typedef struct grpc_completion_queue grpc_completion_queue;
72
73
 
73
74
  /** An alarm associated with a completion queue. */
@@ -133,9 +134,9 @@ typedef struct {
133
134
  Used to set optional channel-level configuration.
134
135
  These configuration options are modelled as key-value pairs as defined
135
136
  by grpc_arg; keys are strings to allow easy backwards-compatible extension
136
- by arbitrary parties.
137
- All evaluation is performed at channel creation time (i.e. the values in
138
- this structure need only live through the creation invocation).
137
+ by arbitrary parties. All evaluation is performed at channel creation
138
+ time (i.e. the values in this structure need only live through the
139
+ creation invocation).
139
140
 
140
141
  See the description of the \ref grpc_arg_keys "available args" for more
141
142
  details. */
@@ -161,7 +162,8 @@ typedef struct {
161
162
  /** Maximum message length that the channel can receive. Int valued, bytes.
162
163
  -1 means unlimited. */
163
164
  #define GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH "grpc.max_receive_message_length"
164
- /** \deprecated For backward compatibility. */
165
+ /** \deprecated For backward compatibility.
166
+ * Use GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH instead. */
165
167
  #define GRPC_ARG_MAX_MESSAGE_LENGTH GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH
166
168
  /** Maximum message length that the channel can send. Int valued, bytes.
167
169
  -1 means unlimited. */
@@ -169,13 +171,19 @@ typedef struct {
169
171
  /** Maximum time that a channel may have no outstanding rpcs. Int valued,
170
172
  milliseconds. INT_MAX means unlimited. */
171
173
  #define GRPC_ARG_MAX_CONNECTION_IDLE_MS "grpc.max_connection_idle_ms"
172
- /** Maximum time that a channel may exist. Int valued, milliseconds. INT_MAX
173
- means unlimited. */
174
+ /** Maximum time that a channel may exist. Int valued, milliseconds.
175
+ * INT_MAX means unlimited. */
174
176
  #define GRPC_ARG_MAX_CONNECTION_AGE_MS "grpc.max_connection_age_ms"
175
177
  /** Grace period after the chennel reaches its max age. Int valued,
176
178
  milliseconds. INT_MAX means unlimited. */
177
179
  #define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms"
178
- /** Initial sequence number for http2 transports. Int valued. */
180
+ /** Enable/disable support for per-message compression. Defaults to 1, unless
181
+ GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0. */
182
+ #define GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION "grpc.per_message_compression"
183
+ /** Enable/disable support for deadline checking. Defaults to 1, unless
184
+ GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0 */
185
+ #define GRPC_ARG_ENABLE_DEADLINE_CHECKS "grpc.enable_deadline_checking"
186
+ /** Initial stream ID for http2 transports. Int valued. */
179
187
  #define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
180
188
  "grpc.http2.initial_sequence_number"
181
189
  /** Amount to read ahead on individual streams. Defaults to 64kb, larger
@@ -190,25 +198,24 @@ typedef struct {
190
198
  #define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER \
191
199
  "grpc.http2.hpack_table_size.encoder"
192
200
  /** How big a frame are we willing to receive via HTTP2.
193
- Min 16384, max 16777215.
194
- Larger values give lower CPU usage for large messages, but more head of line
195
- blocking for small messages. */
201
+ Min 16384, max 16777215. Larger values give lower CPU usage for large
202
+ messages, but more head of line blocking for small messages. */
196
203
  #define GRPC_ARG_HTTP2_MAX_FRAME_SIZE "grpc.http2.max_frame_size"
197
204
  /** Should BDP probing be performed? */
198
205
  #define GRPC_ARG_HTTP2_BDP_PROBE "grpc.http2.bdp_probe"
199
206
  /** Minimum time (in milliseconds) between successive ping frames being sent */
200
207
  #define GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS \
201
208
  "grpc.http2.min_time_between_pings_ms"
209
+ /** Channel arg to override the http2 :scheme header */
210
+ #define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
202
211
  /** How many pings can we send before needing to send a data frame or header
203
- frame?
204
- (0 indicates that an infinite number of pings can be sent without sending
205
- a data frame or header frame) */
212
+ frame? (0 indicates that an infinite number of pings can be sent without
213
+ sending a data frame or header frame) */
206
214
  #define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \
207
215
  "grpc.http2.max_pings_without_data"
208
216
  /** How many misbehaving pings the server can bear before sending goaway and
209
- closing the transport?
210
- (0 indicates that the server can bear an infinite number of misbehaving
211
- pings) */
217
+ closing the transport? (0 indicates that the server can bear an infinite
218
+ number of misbehaving pings) */
212
219
  #define GRPC_ARG_HTTP2_MAX_PING_STRIKES "grpc.http2.max_ping_strikes"
213
220
  /** Minimum allowed time between two pings without sending any data frame. Int
214
221
  valued, seconds */
@@ -240,25 +247,29 @@ typedef struct {
240
247
  /** Secondary user agent: goes at the end of the user-agent metadata
241
248
  sent on each request. A string. */
242
249
  #define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent"
250
+ /** The minimum time between subsequent connection attempts, in ms */
251
+ #define GRPC_ARG_MIN_RECONNECT_BACKOFF_MS "grpc.min_reconnect_backoff_ms"
243
252
  /** The maximum time between subsequent connection attempts, in ms */
244
253
  #define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS "grpc.max_reconnect_backoff_ms"
245
254
  /** The time between the first and second connection attempts, in ms */
246
255
  #define GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS \
247
256
  "grpc.initial_reconnect_backoff_ms"
248
- /* The caller of the secure_channel_create functions may override the target
249
- name used for SSL host name checking using this channel argument which is of
250
- type \a GRPC_ARG_STRING. This *should* be used for testing only.
251
- If this argument is not specified, the name used for SSL host name checking
252
- will be the target parameter (assuming that the secure channel is an SSL
253
- channel). If this parameter is specified and the underlying is not an SSL
254
- channel, it will just be ignored. */
257
+ /** This *should* be used for testing only.
258
+ The caller of the secure_channel_create functions may override the target
259
+ name used for SSL host name checking using this channel argument which is of
260
+ type \a GRPC_ARG_STRING. If this argument is not specified, the name used
261
+ for SSL host name checking will be the target parameter (assuming that the
262
+ secure channel is an SSL channel). If this parameter is specified and the
263
+ underlying is not an SSL channel, it will just be ignored. */
255
264
  #define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override"
256
- /* Maximum metadata size, in bytes. */
265
+ /** Maximum metadata size, in bytes. Note this limit applies to the max sum of
266
+ all metadata key-value entries in a batch of headers. */
257
267
  #define GRPC_ARG_MAX_METADATA_SIZE "grpc.max_metadata_size"
258
268
  /** If non-zero, allow the use of SO_REUSEPORT if it's available (default 1) */
259
269
  #define GRPC_ARG_ALLOW_REUSEPORT "grpc.so_reuseport"
260
- /** If non-zero, a pointer to a buffer pool (use grpc_resource_quota_arg_vtable
261
- to fetch an appropriate pointer arg vtable) */
270
+ /** If non-zero, a pointer to a buffer pool (a pointer of type
271
+ * grpc_resource_quota*). (use grpc_resource_quota_arg_vtable() to fetch an
272
+ * appropriate pointer arg vtable) */
262
273
  #define GRPC_ARG_RESOURCE_QUOTA "grpc.resource_quota"
263
274
  /** If non-zero, expand wildcard addresses to a list of local addresses. */
264
275
  #define GRPC_ARG_EXPAND_WILDCARD_ADDRS "grpc.expand_wildcard_addrs"
@@ -270,18 +281,27 @@ typedef struct {
270
281
  #define GRPC_ARG_SOCKET_MUTATOR "grpc.socket_mutator"
271
282
  /** The grpc_socket_factory instance to create and bind sockets. A pointer. */
272
283
  #define GRPC_ARG_SOCKET_FACTORY "grpc.socket_factory"
273
- /** If non-zero, Cronet transport will coalesce packets to fewer frames when
274
- * possible. */
284
+ /** If non-zero, Cronet transport will coalesce packets to fewer frames
285
+ * when possible. */
275
286
  #define GRPC_ARG_USE_CRONET_PACKET_COALESCING \
276
287
  "grpc.use_cronet_packet_coalescing"
277
- /* Channel arg (integer) setting how large a slice to try and read from the wire
278
- each time recvmsg (or equivalent) is called */
288
+ /** Channel arg (integer) setting how large a slice to try and read from the
289
+ wire each time recvmsg (or equivalent) is called **/
279
290
  #define GRPC_ARG_TCP_READ_CHUNK_SIZE "grpc.experimental.tcp_read_chunk_size"
291
+ /** Note this is not a "channel arg" key. This is the default slice size to use
292
+ * when trying to read from the wire if the GRPC_ARG_TCP_READ_CHUNK_SIZE
293
+ * channel arg is unspecified. */
280
294
  #define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192
281
295
  #define GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE \
282
296
  "grpc.experimental.tcp_min_read_chunk_size"
283
297
  #define GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE \
284
298
  "grpc.experimental.tcp_max_read_chunk_size"
299
+ /* Timeout in milliseconds to use for calls to the grpclb load balancer.
300
+ If 0 or unset, the balancer calls will have no deadline. */
301
+ #define GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS "grpc.grpclb_timeout_ms"
302
+ /** If non-zero, grpc server's cronet compression workaround will be enabled */
303
+ #define GRPC_ARG_WORKAROUND_CRONET_COMPRESSION \
304
+ "grpc.workaround.cronet_compression"
285
305
  /** \} */
286
306
 
287
307
  /** Result of a grpc call. If the caller satisfies the prerequisites of a
@@ -314,8 +334,8 @@ typedef enum grpc_call_error {
314
334
  GRPC_CALL_ERROR_INVALID_METADATA,
315
335
  /** invalid message was passed to this call */
316
336
  GRPC_CALL_ERROR_INVALID_MESSAGE,
317
- /** completion queue for notification has not been registered with the
318
- server */
337
+ /** completion queue for notification has not been registered
338
+ * with the server */
319
339
  GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE,
320
340
  /** this batch of operations leads to more operations than allowed */
321
341
  GRPC_CALL_ERROR_BATCH_TOO_BIG,
@@ -323,12 +343,12 @@ typedef enum grpc_call_error {
323
343
  GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH
324
344
  } grpc_call_error;
325
345
 
326
- /* Default send/receive message size limits in bytes. -1 for unlimited. */
327
- /* TODO(roth) Make this match the default receive limit after next release */
346
+ /** Default send/receive message size limits in bytes. -1 for unlimited. */
347
+ /** TODO(roth) Make this match the default receive limit after next release */
328
348
  #define GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH -1
329
349
  #define GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH (4 * 1024 * 1024)
330
350
 
331
- /* Write Flags: */
351
+ /** Write Flags: */
332
352
  /** Hint that the write may be buffered and need not go out on the wire
333
353
  immediately. GRPC is free to buffer the message until the next non-buffered
334
354
  write, or until writes_done, but it need not buffer completely or at all. */
@@ -339,7 +359,7 @@ typedef enum grpc_call_error {
339
359
  /** Mask of all valid flags. */
340
360
  #define GRPC_WRITE_USED_MASK (GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS)
341
361
 
342
- /* Initial metadata flags */
362
+ /** Initial metadata flags */
343
363
  /** Signal that the call is idempotent */
344
364
  #define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST (0x00000010u)
345
365
  /** Signal that the call should not return UNAVAILABLE before it has started */
@@ -362,8 +382,8 @@ typedef enum grpc_call_error {
362
382
 
363
383
  /** A single metadata element */
364
384
  typedef struct grpc_metadata {
365
- /* the key, value values are expected to line up with grpc_mdelem: if changing
366
- them, update metadata.h at the same time. */
385
+ /** the key, value values are expected to line up with grpc_mdelem: if
386
+ changing them, update metadata.h at the same time. */
367
387
  grpc_slice key;
368
388
  grpc_slice value;
369
389
 
@@ -393,8 +413,11 @@ typedef enum grpc_completion_type {
393
413
  typedef struct grpc_event {
394
414
  /** The type of the completion. */
395
415
  grpc_completion_type type;
396
- /** non-zero if the operation was successful, 0 upon failure.
397
- Only GRPC_OP_COMPLETE can succeed or fail. */
416
+ /** If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates
417
+ whether the operation was successful or not; 0 in case of failure and
418
+ non-zero in case of success.
419
+ If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this
420
+ field is guaranteed to be 0 */
398
421
  int success;
399
422
  /** The tag passed to grpc_call_start_batch etc to start this operation.
400
423
  Only GRPC_OP_COMPLETE has a tag. */
@@ -427,15 +450,13 @@ typedef enum {
427
450
  GRPC_OP_SEND_MESSAGE,
428
451
  /** Send a close from the client: one and only one instance MUST be sent from
429
452
  the client, unless the call was cancelled - in which case this can be
430
- skipped.
431
- This op completes after all bytes for the call (including the close)
432
- have passed outgoing flow control. */
453
+ skipped. This op completes after all bytes for the call
454
+ (including the close) have passed outgoing flow control. */
433
455
  GRPC_OP_SEND_CLOSE_FROM_CLIENT,
434
456
  /** Send status from the server: one and only one instance MUST be sent from
435
457
  the server unless the call was cancelled - in which case this can be
436
- skipped.
437
- This op completes after all bytes for the call (including the status)
438
- have passed outgoing flow control. */
458
+ skipped. This op completes after all bytes for the call
459
+ (including the status) have passed outgoing flow control. */
439
460
  GRPC_OP_SEND_STATUS_FROM_SERVER,
440
461
  /** Receive initial metadata: one and only one MUST be made on the client,
441
462
  must not be made on the server.
@@ -453,10 +474,10 @@ typedef enum {
453
474
  This op completes after all activity on the call has completed. */
454
475
  GRPC_OP_RECV_STATUS_ON_CLIENT,
455
476
  /** Receive close on the server: one and only one must be made on the
456
- server.
457
- This op completes after the close has been received by the server.
458
- This operation always succeeds, meaning ops paired with this operation
459
- will also appear to succeed, even though they may not have. */
477
+ server. This op completes after the close has been received by the
478
+ server. This operation always succeeds, meaning ops paired with
479
+ this operation will also appear to succeed, even though they may not
480
+ have. */
460
481
  GRPC_OP_RECV_CLOSE_ON_SERVER
461
482
  } grpc_op_type;
462
483
 
@@ -493,7 +514,7 @@ typedef struct grpc_op {
493
514
  size_t trailing_metadata_count;
494
515
  grpc_metadata *trailing_metadata;
495
516
  grpc_status_code status;
496
- /* optional: set to NULL if no details need sending, non-NULL if they do
517
+ /** optional: set to NULL if no details need sending, non-NULL if they do
497
518
  * pointer will not be retained past the start_batch call
498
519
  */
499
520
  grpc_slice *status_details;
@@ -517,8 +538,7 @@ typedef struct grpc_op {
517
538
  elements stays with the call object (ie key, value members are owned
518
539
  by the call object, trailing_metadata->array is owned by the caller).
519
540
  After the operation completes, call grpc_metadata_array_destroy on
520
- this
521
- value, or reuse it in a future op. */
541
+ this value, or reuse it in a future op. */
522
542
  grpc_metadata_array *trailing_metadata;
523
543
  grpc_status_code *status;
524
544
  grpc_slice *status_details;
@@ -533,16 +553,65 @@ typedef struct grpc_op {
533
553
 
534
554
  /** Information requested from the channel. */
535
555
  typedef struct {
536
- /* If non-NULL, will be set to point to a string indicating the LB
556
+ /** If non-NULL, will be set to point to a string indicating the LB
537
557
  * policy name. Caller takes ownership. */
538
558
  char **lb_policy_name;
539
- /* If non-NULL, will be set to point to a string containing the
559
+ /** If non-NULL, will be set to point to a string containing the
540
560
  * service config used by the channel in JSON form. */
541
561
  char **service_config_json;
542
562
  } grpc_channel_info;
543
563
 
544
564
  typedef struct grpc_resource_quota grpc_resource_quota;
545
565
 
566
+ /** Completion queues internally MAY maintain a set of file descriptors in a
567
+ structure called 'pollset'. This enum specifies if a completion queue has an
568
+ associated pollset and any restrictions on the type of file descriptors that
569
+ can be present in the pollset.
570
+
571
+ I/O progress can only be made when grpc_completion_queue_next() or
572
+ grpc_completion_queue_pluck() are called on the completion queue (unless the
573
+ grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important
574
+ to actively call these APIs */
575
+ typedef enum {
576
+ /** The completion queue will have an associated pollset and there is no
577
+ restriction on the type of file descriptors the pollset may contain */
578
+ GRPC_CQ_DEFAULT_POLLING,
579
+
580
+ /** Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will
581
+ not contain any 'listening file descriptors' (i.e file descriptors used to
582
+ listen to incoming channels) */
583
+ GRPC_CQ_NON_LISTENING,
584
+
585
+ /** The completion queue will not have an associated pollset. Note that
586
+ grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still
587
+ be called to pop events from the completion queue; it is not required to
588
+ call them actively to make I/O progress */
589
+ GRPC_CQ_NON_POLLING
590
+ } grpc_cq_polling_type;
591
+
592
+ /** Specifies the type of APIs to use to pop events from the completion queue */
593
+ typedef enum {
594
+ /** Events are popped out by calling grpc_completion_queue_next() API ONLY */
595
+ GRPC_CQ_NEXT,
596
+
597
+ /** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/
598
+ GRPC_CQ_PLUCK
599
+ } grpc_cq_completion_type;
600
+
601
+ #define GRPC_CQ_CURRENT_VERSION 1
602
+ typedef struct grpc_completion_queue_attributes {
603
+ /** The version number of this structure. More fields might be added to this
604
+ structure in future. */
605
+ int version; /** Set to GRPC_CQ_CURRENT_VERSION */
606
+
607
+ grpc_cq_completion_type cq_completion_type;
608
+
609
+ grpc_cq_polling_type cq_polling_type;
610
+ } grpc_completion_queue_attributes;
611
+
612
+ /** The completion queue factory structure is opaque to the callers of grpc */
613
+ typedef struct grpc_completion_queue_factory grpc_completion_queue_factory;
614
+
546
615
  #ifdef __cplusplus
547
616
  }
548
617
  #endif