Merge branch 'master' into rpc_mgr

pull/8269/head
Sree Kuchibhotla 8 years ago
commit e4996d6c43
  1. 2
      Makefile
  2. 2
      README.md
  3. 3
      build.yaml
  4. 1
      composer.json
  5. 2
      doc/core/pending_api_cleanups.md
  6. 15
      doc/cpp/pending_api_cleanups.md
  7. 41
      doc/interop-test-descriptions.md
  8. 111
      etc/roots.pem
  9. 2
      examples/node/static_codegen/greeter_client.js
  10. 1
      examples/php/composer.json
  11. 20
      include/grpc++/impl/codegen/client_context.h
  12. 17
      include/grpc/impl/codegen/grpc_types.h
  13. 4
      src/compiler/README.md
  14. 3
      src/compiler/csharp_generator.cc
  15. 6
      src/core/README.md
  16. 44
      src/core/ext/client_config/client_channel.c
  17. 27
      src/core/ext/client_config/lb_policy.h
  18. 81
      src/core/ext/lb_policy/grpclb/grpclb.c
  19. 14
      src/core/ext/resolver/dns/native/dns_resolver.c
  20. 80
      src/core/ext/resolver/sockaddr/sockaddr_resolver.c
  21. 196
      src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c
  22. 33
      src/core/ext/transport/cronet/transport/cronet_transport.c
  23. 14
      src/core/lib/channel/message_size_filter.c
  24. 8
      src/core/lib/iomgr/error.h
  25. 4
      src/core/lib/iomgr/tcp_server.h
  26. 29
      src/core/lib/iomgr/tcp_server_posix.c
  27. 16
      src/core/lib/iomgr/tcp_server_windows.c
  28. 10
      src/core/lib/iomgr/udp_server.c
  29. 11
      src/core/lib/security/credentials/composite/composite_credentials.c
  30. 4
      src/core/lib/security/credentials/composite/composite_credentials.h
  31. 12
      src/core/lib/security/credentials/credentials.c
  32. 10
      src/core/lib/security/credentials/credentials.h
  33. 2
      src/core/lib/security/credentials/fake/fake_credentials.c
  34. 2
      src/core/lib/security/credentials/ssl/ssl_credentials.c
  35. 5
      src/core/lib/surface/byte_buffer.c
  36. 15
      src/core/lib/surface/call.c
  37. 4
      src/cpp/README.md
  38. 3
      src/cpp/client/client_context.cc
  39. 6
      src/cpp/common/channel_filter.h
  40. 83
      src/csharp/Grpc.Examples/Math.cs
  41. 1
      src/csharp/Grpc.Examples/MathGrpc.cs
  42. 35
      src/csharp/Grpc.HealthCheck/Health.cs
  43. 1
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  44. 401
      src/csharp/Grpc.IntegrationTesting/Control.cs
  45. 16
      src/csharp/Grpc.IntegrationTesting/Empty.cs
  46. 211
      src/csharp/Grpc.IntegrationTesting/Messages.cs
  47. 53
      src/csharp/Grpc.IntegrationTesting/Metrics.cs
  48. 1
      src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
  49. 70
      src/csharp/Grpc.IntegrationTesting/Payloads.cs
  50. 1
      src/csharp/Grpc.IntegrationTesting/Services.cs
  51. 2
      src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs
  52. 76
      src/csharp/Grpc.IntegrationTesting/Stats.cs
  53. 1
      src/csharp/Grpc.IntegrationTesting/Test.cs
  54. 3
      src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
  55. 24
      src/csharp/Grpc.Tools.nuspec
  56. 20
      src/csharp/README.md
  57. 3
      src/node/README.md
  58. 20
      src/objective-c/GRPCClient/GRPCCall.h
  59. 25
      src/objective-c/GRPCClient/GRPCCall.m
  60. 4
      src/objective-c/GRPCClient/private/GRPCWrappedCall.h
  61. 12
      src/objective-c/GRPCClient/private/GRPCWrappedCall.m
  62. 33
      src/objective-c/tests/GRPCClientTests.m
  63. 4
      src/php/README.md
  64. 1
      src/php/composer.json
  65. 5
      src/proto/grpc/testing/test.proto
  66. 1
      src/python/grpcio/grpc/_server.py
  67. 7
      src/ruby/README.md
  68. 1
      templates/composer.json.template
  69. 1
      templates/src/php/composer.json.template
  70. 6
      templates/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile.template
  71. 2
      test/core/bad_ssl/bad_ssl_test.c
  72. 6
      test/core/client_config/lb_policies_test.c
  73. 14
      test/core/end2end/connection_refused_test.c
  74. 2
      test/core/end2end/dualstack_socket_test.c
  75. 212
      test/core/end2end/fake_resolver.c
  76. 39
      test/core/end2end/fake_resolver.h
  77. 165
      test/core/end2end/tests/max_message_length.c
  78. 2
      test/core/end2end/tests/simple_delayed_request.c
  79. 3
      test/core/iomgr/tcp_server_posix_test.c
  80. 18
      test/core/iomgr/udp_server_test.c
  81. 31
      test/core/security/credentials_test.c
  82. 4
      test/cpp/end2end/client_crash_test.cc
  83. 10
      test/cpp/end2end/hybrid_end2end_test.cc
  84. 2
      test/cpp/end2end/proto_server_reflection_test.cc
  85. 2
      test/cpp/end2end/server_crash_test_client.cc
  86. 6
      test/cpp/grpclb/grpclb_test.cc
  87. 4
      test/cpp/interop/client.cc
  88. 44
      test/cpp/interop/interop_client.cc
  89. 1
      test/cpp/interop/interop_client.h
  90. 12
      test/cpp/interop/interop_server.cc
  91. 1
      test/cpp/qps/client_async.cc
  92. 6
      test/cpp/qps/driver.cc
  93. 1
      test/cpp/util/grpc_tool.cc
  94. 2
      test/cpp/util/proto_file_parser.cc
  95. 13
      test/cpp/util/proto_reflection_descriptor_database.cc
  96. 6
      test/cpp/util/proto_reflection_descriptor_database.h
  97. 7
      test/distrib/cpp/run_distrib_test.sh
  98. 6
      tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh
  99. 6
      tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh
  100. 6
      tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh
  101. Some files were not shown because too many files have changed in this diff Show More

@ -3070,6 +3070,7 @@ LIBGRPC_TEST_UTIL_SRC = \
test/core/end2end/data/test_root_cert.c \
test/core/security/oauth2_utils.c \
test/core/end2end/cq_verifier.c \
test/core/end2end/fake_resolver.c \
test/core/end2end/fixtures/http_proxy.c \
test/core/end2end/fixtures/proxy.c \
test/core/iomgr/endpoint_tests.c \
@ -3237,6 +3238,7 @@ endif
LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
test/core/end2end/cq_verifier.c \
test/core/end2end/fake_resolver.c \
test/core/end2end/fixtures/http_proxy.c \
test/core/end2end/fixtures/proxy.c \
test/core/iomgr/endpoint_tests.c \

@ -21,7 +21,7 @@ See [tools/run_tests](tools/run_tests) for more guidance on how to run various t
This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core] (src/core).
Libraries in different languages are in different states of development. We are seeking contributions for all of these libraries.
Libraries in different languages may be in different states of development. We are seeking contributions for all of these libraries.
| Language | Source | Status |
|-------------------------|-------------------------------------|---------|

@ -507,6 +507,7 @@ filegroups:
build: test
headers:
- test/core/end2end/cq_verifier.h
- test/core/end2end/fake_resolver.h
- test/core/end2end/fixtures/http_proxy.h
- test/core/end2end/fixtures/proxy.h
- test/core/iomgr/endpoint_tests.h
@ -520,6 +521,7 @@ filegroups:
- test/core/util/slice_splitter.h
src:
- test/core/end2end/cq_verifier.c
- test/core/end2end/fake_resolver.c
- test/core/end2end/fixtures/http_proxy.c
- test/core/end2end/fixtures/proxy.c
- test/core/iomgr/endpoint_tests.c
@ -1097,7 +1099,6 @@ libs:
deps:
- grpc++_reflection
- grpc++
- grpc++_test_config
- name: grpc_plugin_support
build: protoc
language: c++

@ -7,6 +7,7 @@
"license": "BSD-3-Clause",
"require": {
"php": ">=5.5.0",
"ext-grpc": "*",
"google/protobuf": "v3.1.0-alpha-1"
},
"require-dev": {

@ -15,3 +15,5 @@ number:
`include/grpc/impl/codegen/grpc_types.h` (commit `af00d8b`)
- remove `ServerBuilder::SetMaxMessageSize()` method from
`include/grpc++/server_builder.h` (commit `6980362`)
- remove `GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY` macro from
`include/grpc/impl/codegen/grpc_types.h` (commit `59c9f90`)

@ -0,0 +1,15 @@
There are times when we make changes that include a temporary shim for
backward-compatibility (e.g., a macro or some other function to preserve
the original API) to avoid having to bump the major version number in
the next release. However, when we do eventually want to release a
feature that does change the API in a non-backward-compatible way, we
will wind up bumping the major version number anyway, at which point we
can take the opportunity to clean up any pending backward-compatibility
shims.
This file lists all pending backward-compatibility changes that should
be cleaned up the next time we are going to bump the major version
number:
- remove `ClientContext::set_fail_fast()` method from
`include/grpc++/impl/codegen/client_context.h` (commit `9477724`)

@ -60,6 +60,35 @@ Client asserts:
*It may be possible to use UnaryCall instead of EmptyCall, but it is harder to
ensure that the proto serialized to zero bytes.*
### cacheable_unary
This test verifies that gRPC requests marked as cacheable use GET verb instead
of POST, and that server sets appropriate cache control headers for the response
to be cached by a proxy. This test requires that the server is behind
a caching proxy. Use of current timestamp in the request prevents accidental
cache matches left over from previous tests.
Server features:
* [CacheableUnaryCall][]
Procedure:
1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload
set to current timestamp. Timestamp format is irrelevant, and resolution is
in nanoseconds.
Client adds a `x-user-ip` header with value `1.2.3.4` to the request.
This is done since some proxys such as GFE will not cache requests from
localhost.
Client marks the request as cacheable by setting the cacheable flag in the
request context. Longer term this should be driven by the method option
specified in the proto file itself.
2. Client calls CacheableUnaryCall with `SimpleRequest` request again
immediately with the same payload as the previous request. Cacheable flag is
also set for this request's context.
Client asserts:
* Both calls were successful
* The payload body of both responses is the same.
### large_unary
This test verifies unary calls succeed in sending messages, and touches on flow
@ -941,6 +970,18 @@ payload body of size `SimpleRequest.response_size` bytes and type as appropriate
for the `SimpleRequest.response_type`. If the server does not support the
`response_type`, then it should fail the RPC with `INVALID_ARGUMENT`.
### CacheableUnaryCall
Server gets the default SimpleRequest proto as the request. The content of the
request is ignored. It returns the SimpleResponse proto with the payload set
to current timestamp. The timestamp is an integer representing current time
with nanosecond resolution. This integer is formated as ASCII decimal in the
response. The format is not really important as long as the response payload
is different for each request. In addition it adds
1. cache control headers such that the response can be cached by proxies in
the response path. Server should be behind a caching proxy for this test
to pass. Currently we set the max-age to 60 seconds.
### CompressedResponse
[CompressedResponse]: #compressedresponse

@ -1706,38 +1706,6 @@ fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv
GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
-----END CERTIFICATE-----
# Issuer: CN=IGC/A O=PM/SGDN OU=DCSSI
# Subject: CN=IGC/A O=PM/SGDN OU=DCSSI
# Label: "IGC/A"
# Serial: 245102874772
# MD5 Fingerprint: 0c:7f:dd:6a:f4:2a:b9:c8:9b:bd:20:7e:a9:db:5c:37
# SHA1 Fingerprint: 60:d6:89:74:b5:c2:65:9e:8a:0f:c1:88:7c:88:d2:46:69:1b:18:2c
# SHA256 Fingerprint: b9:be:a7:86:0a:96:2e:a3:61:1d:ab:97:ab:6d:a3:e2:1c:10:68:b9:7d:55:57:5e:d0:e1:12:79:c1:1c:89:32
-----BEGIN CERTIFICATE-----
MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYT
AkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQ
TS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG
9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMB4XDTAyMTIxMzE0MjkyM1oXDTIw
MTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAM
BgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEO
MAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2
LmZyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaI
s9z4iPf930Pfeo2aSVz2TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2
xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCWSo7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4
u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYyHF2fYPepraX/z9E0+X1b
F8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNdfrGoRpAx
Vs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGd
PDPQtQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNV
HSAEDjAMMAoGCCqBegF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAx
NjAfBgNVHSMEGDAWgBSjBS8YYFDCiQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUF
AAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RKq89toB9RlPhJy3Q2FLwV3duJ
L92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3QMZsyK10XZZOY
YLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg
Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2a
NjSaTFR+FwNIlQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R
0982gaEbeC9xs/FZTEYYKKuF0mBWWg==
-----END CERTIFICATE-----
# Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1
# Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1
# Label: "Security Communication EV RootCA1"
@ -2047,48 +2015,6 @@ h7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5wwDX3OaJdZtB7WZ+oRxKaJyOk
LY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho
-----END CERTIFICATE-----
# Issuer: CN=EBG Elektronik Sertifika Hizmet Sağlayıcısı O=EBG Bilişim Teknolojileri ve Hizmetleri A.Ş.
# Subject: CN=EBG Elektronik Sertifika Hizmet Sağlayıcısı O=EBG Bilişim Teknolojileri ve Hizmetleri A.Ş.
# Label: "EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1"
# Serial: 5525761995591021570
# MD5 Fingerprint: 2c:20:26:9d:cb:1a:4a:00:85:b5:b7:5a:ae:c2:01:37
# SHA1 Fingerprint: 8c:96:ba:eb:dd:2b:07:07:48:ee:30:32:66:a0:f3:98:6e:7c:ae:58
# SHA256 Fingerprint: 35:ae:5b:dd:d8:f7:ae:63:5c:ff:ba:56:82:a8:f0:0b:95:f4:84:62:c7:10:8e:e9:a0:e5:29:2b:07:4a:af:b2
-----BEGIN CERTIFICATE-----
MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNV
BAMML0VCRyBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx
c8SxMTcwNQYDVQQKDC5FQkcgQmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXpt
ZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAeFw0wNjA4MTcwMDIxMDlaFw0xNjA4
MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25payBTZXJ0aWZpa2Eg
SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2ltIFRl
a25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIi
MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h
4fuXd7hxlugTlkaDT7byX3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAk
tiHq6yOU/im/+4mRDGSaBUorzAzu8T2bgmmkTPiab+ci2hC6X5L8GCcKqKpE+i4s
tPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfreYteIAbTdgtsApWjluTL
dlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZTqNGFav4
c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8Um
TDGyY5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z
+kI2sSXFCjEmN1ZnuqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0O
Lna9XvNRiYuoP1Vzv9s6xiQFlpJIqkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMW
OeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vmExH8nYQKE3vwO9D8owrXieqW
fo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0Nokb+Clsi7n2
l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB
/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgw
FoAU587GT/wWZ5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+
8ygjdsZs93/mQJ7ANtyVDR2tFcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI
6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgmzJNSroIBk5DKd8pNSe/iWtkqvTDO
TLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64kXPBfrAowzIpAoHME
wfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqTbCmY
Iai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJn
xk1Gj7sURT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4Q
DgZxGhBM/nV+/x5XOULK1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9q
Kd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11t
hie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQY9iJSrSq3RZj9W6+YKH4
7ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9AahH3eU7
QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT
-----END CERTIFICATE-----
# Issuer: O=certSIGN OU=certSIGN ROOT CA
# Subject: O=certSIGN OU=certSIGN ROOT CA
# Label: "certSIGN ROOT CA"
@ -2427,43 +2353,6 @@ Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z
ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ==
-----END CERTIFICATE-----
# Issuer: CN=Juur-SK O=AS Sertifitseerimiskeskus
# Subject: CN=Juur-SK O=AS Sertifitseerimiskeskus
# Label: "Juur-SK"
# Serial: 999181308
# MD5 Fingerprint: aa:8e:5d:d9:f8:db:0a:58:b7:8d:26:87:6c:82:35:55
# SHA1 Fingerprint: 40:9d:4b:d9:17:b5:5c:27:b6:9b:64:cb:98:22:44:0d:cd:09:b8:89
# SHA256 Fingerprint: ec:c3:e9:c3:40:75:03:be:e0:91:aa:95:2f:41:34:8f:f8:8b:aa:86:3b:22:64:be:fa:c8:07:90:15:74:e9:39
-----BEGIN CERTIFICATE-----
MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcN
AQkBFglwa2lAc2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZp
dHNlZXJpbWlza2Vza3VzMRAwDgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMw
MVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMQsw
CQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEQ
MA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOB
SvZiF3tfTQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkz
ABpTpyHhOEvWgxutr2TC+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvH
LCu3GFH+4Hv2qEivbDtPL+/40UceJlfwUR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMP
PbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDaTpxt4brNj3pssAki14sL
2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQFMAMBAf8w
ggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwIC
MIHDHoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDk
AGwAagBhAHMAdABhAHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0
AHMAZQBlAHIAaQBtAGkAcwBrAGUAcwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABz
AGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABrAGkAbgBuAGkAdABhAG0AaQBz
AGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nwcy8wKwYDVR0f
BCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE
FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcY
P2/v6X2+MA4GA1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOi
CfP+JmeaUOTDBS8rNXiRTHyoERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+g
kcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyLabVAyJRld/JXIWY7zoVAtjNjGr95
HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678IIbsSt4beDI3poHS
na9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkhMp6q
qIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0Z
TbvGRNs2yyqcjg==
-----END CERTIFICATE-----
# Issuer: CN=Hongkong Post Root CA 1 O=Hongkong Post
# Subject: CN=Hongkong Post Root CA 1 O=Hongkong Post
# Label: "Hongkong Post Root CA 1"

@ -39,13 +39,13 @@ var grpc = require('grpc');
function main() {
var client = new services.GreeterClient('localhost:50051',
grpc.credentials.createInsecure());
var request = new messages.HelloRequest();
var user;
if (process.argv.length >= 3) {
user = process.argv[2];
} else {
user = 'world';
}
var request = new messages.HelloRequest();
request.setName(user);
client.sayHello(request, function(err, response) {
console.log('Greeting:', response.getMessage());

@ -2,6 +2,7 @@
"name": "grpc/grpc-demo",
"description": "gRPC example for PHP",
"require": {
"ext-grpc": "*",
"grpc/grpc": "v1.0.0"
}
}

@ -226,8 +226,14 @@ class ClientContext {
/// EXPERIMENTAL: Set this request to be cacheable
void set_cacheable(bool cacheable) { cacheable_ = cacheable; }
/// EXPERIMENTAL: Trigger fail-fast or not on this request
void set_fail_fast(bool fail_fast) { fail_fast_ = fail_fast; }
/// EXPERIMENTAL: Trigger wait-for-ready or not on this request
void set_wait_for_ready(bool wait_for_ready) {
wait_for_ready_ = wait_for_ready;
wait_for_ready_explicitly_set_ = true;
}
/// DEPRECATED: Use set_wait_for_ready() instead.
void set_fail_fast(bool fail_fast) { set_wait_for_ready(!fail_fast); }
#ifndef GRPC_CXX0X_NO_CHRONO
/// Return the deadline for the client call.
@ -347,14 +353,18 @@ class ClientContext {
uint32_t initial_metadata_flags() const {
return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) |
(fail_fast_ ? 0 : GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY) |
(cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0);
(wait_for_ready_ ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0) |
(cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0) |
(wait_for_ready_explicitly_set_
? GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET
: 0);
}
grpc::string authority() { return authority_; }
bool initial_metadata_received_;
bool fail_fast_;
bool wait_for_ready_;
bool wait_for_ready_explicitly_set_;
bool idempotent_;
bool cacheable_;
std::shared_ptr<Channel> channel_;

@ -257,15 +257,22 @@ typedef enum grpc_call_error {
/** Signal that the call is idempotent */
#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST (0x00000010u)
/** Signal that the call should not return UNAVAILABLE before it has started */
#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY (0x00000020u)
#define GRPC_INITIAL_METADATA_WAIT_FOR_READY (0x00000020u)
/** DEPRECATED: for backward compatibility */
#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY \
GRPC_INITIAL_METADATA_WAIT_FOR_READY
/** Signal that the call is cacheable. GRPC is free to use GET verb */
#define GRPC_INITIAL_METADATA_CACHEABLE_REQUEST (0x00000040u)
/** Signal that GRPC_INITIAL_METADATA_WAIT_FOR_READY was explicitly set
by the calling application. */
#define GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET (0x00000080u)
/** Mask of all valid flags */
#define GRPC_INITIAL_METADATA_USED_MASK \
(GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST | \
GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY | \
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST)
#define GRPC_INITIAL_METADATA_USED_MASK \
(GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST | \
GRPC_INITIAL_METADATA_WAIT_FOR_READY | \
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | \
GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET)
/** A single metadata element */
typedef struct grpc_metadata {

@ -0,0 +1,4 @@
#Overview
This directory contains source code for gRPC protocol buffer compiler (*protoc*) plugins. Along with `protoc`,
these plugins are used to generate gRPC client and server stubs from `.proto` files.

@ -494,6 +494,9 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) {
}
// override NewInstance method
out->Print(
"/// <summary>Creates a new instance of client from given "
"<c>ClientBaseConfiguration</c>.</summary>\n");
out->Print(
"protected override $name$ NewInstance(ClientBaseConfiguration "
"configuration)\n",

@ -1,8 +1,4 @@
#Overview
This directory contains source code for shared C library. Libraries in other languages in this repository (C++, Ruby,
This directory contains source code for C library (a.k.a the *gRPC C core*) that provides all gRPC's core functionality through a low level API. Libraries in other languages in this repository (C++, Ruby,
Python, PHP, NodeJS, Objective-C) are layered on top of this library.
#Status
Beta

@ -111,10 +111,10 @@ static void set_channel_connectivity_state_locked(grpc_exec_ctx *exec_ctx,
if ((state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
state == GRPC_CHANNEL_SHUTDOWN) &&
chand->lb_policy != NULL) {
/* cancel fail-fast picks */
/* cancel picks with wait_for_ready=false */
grpc_lb_policy_cancel_picks(
exec_ctx, chand->lb_policy,
/* mask= */ GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY,
/* mask= */ GRPC_INITIAL_METADATA_WAIT_FOR_READY,
/* check= */ 0, GRPC_ERROR_REF(error));
}
grpc_connectivity_state_set(exec_ctx, &chand->state_tracker, state, error,
@ -185,10 +185,35 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg,
lb_policy_args.additional_args =
grpc_resolver_result_get_lb_policy_args(chand->resolver_result);
lb_policy_args.client_channel_factory = chand->client_channel_factory;
lb_policy = grpc_lb_policy_create(
exec_ctx,
grpc_resolver_result_get_lb_policy_name(chand->resolver_result),
&lb_policy_args);
// Special case: If all of the addresses are balancer addresses,
// assume that we should use the grpclb policy, regardless of what the
// resolver actually specified.
const char *lb_policy_name =
grpc_resolver_result_get_lb_policy_name(chand->resolver_result);
bool found_backend_address = false;
for (size_t i = 0; i < lb_policy_args.addresses->num_addresses; ++i) {
if (!lb_policy_args.addresses->addresses[i].is_balancer) {
found_backend_address = true;
break;
}
}
if (!found_backend_address) {
if (lb_policy_name != NULL && strcmp(lb_policy_name, "grpclb") != 0) {
gpr_log(GPR_INFO,
"resolver requested LB policy %s but provided only balancer "
"addresses, no backend addresses -- forcing use of grpclb LB "
"policy",
(lb_policy_name == NULL ? "(none)" : lb_policy_name));
}
lb_policy_name = "grpclb";
}
// Use pick_first if nothing was specified and we didn't select grpclb
// above.
if (lb_policy_name == NULL) lb_policy_name = "pick_first";
lb_policy =
grpc_lb_policy_create(exec_ctx, lb_policy_name, &lb_policy_args);
if (lb_policy != NULL) {
GRPC_LB_POLICY_REF(lb_policy, "config_change");
GRPC_ERROR_UNREF(state_error);
@ -602,9 +627,10 @@ static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
int r;
GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel");
gpr_mu_unlock(&chand->mu);
const grpc_lb_policy_pick_args inputs = {calld->pollent, initial_metadata,
initial_metadata_flags,
&calld->lb_token_mdelem};
// TODO(dgq): make this deadline configurable somehow.
const grpc_lb_policy_pick_args inputs = {
calld->pollent, initial_metadata, initial_metadata_flags,
&calld->lb_token_mdelem, gpr_inf_future(GPR_CLOCK_MONOTONIC)};
r = grpc_lb_policy_pick(exec_ctx, lb_policy, &inputs, connected_subchannel,
NULL, on_ready);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel");

@ -59,10 +59,14 @@ typedef struct grpc_lb_policy_pick_args {
grpc_polling_entity *pollent;
/** Initial metadata associated with the picking call. */
grpc_metadata_batch *initial_metadata;
/** See \a GRPC_INITIAL_METADATA_* in grpc_types.h */
/** Bitmask used for selective cancelling. See \a
* grpc_lb_policy_cancel_picks() and \a GRPC_INITIAL_METADATA_* in
* grpc_types.h */
uint32_t initial_metadata_flags;
/** Storage for LB token in \a initial_metadata, or NULL if not used */
grpc_linked_mdelem *lb_token_mdelem_storage;
/** Deadline for the call to the LB server */
gpr_timespec deadline;
} grpc_lb_policy_pick_args;
struct grpc_lb_policy_vtable {
@ -138,15 +142,18 @@ void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy);
void grpc_lb_policy_init(grpc_lb_policy *policy,
const grpc_lb_policy_vtable *vtable);
/** Find an appropriate target for this call, based on \a pick_args.
Picking can be synchronous or asynchronous. In the synchronous case, when a
pick is readily available, it'll be returned in \a target and a non-zero
value will be returned.
In the asynchronous case, zero is returned and \a on_complete will be called
once \a target and \a user_data have been set. Any IO should be done under
\a pick_args->pollent. The opaque \a user_data output argument corresponds
to information that may need be propagated from the LB policy. It may be
NULL. Errors are signaled by receiving a NULL \a *target. */
/** Finds an appropriate subchannel for a call, based on \a pick_args.
\a target will be set to the selected subchannel, or NULL on failure.
Upon success, \a user_data will be set to whatever opaque information
may need to be propagated from the LB policy, or NULL if not needed.
If the pick succeeds and a result is known immediately, a non-zero
value will be returned. Otherwise, \a on_complete will be invoked
once the pick is complete with its error argument set to indicate
success or failure.
Any I/O should be done under \a pick_args->pollent. */
int grpc_lb_policy_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
const grpc_lb_policy_pick_args *pick_args,
grpc_connected_subchannel **target, void **user_data,

@ -105,6 +105,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "src/core/ext/client_config/client_channel_factory.h"
#include "src/core/ext/client_config/lb_policy_factory.h"
@ -199,18 +200,8 @@ static void wrapped_rr_closure(grpc_exec_ctx *exec_ctx, void *arg,
typedef struct pending_pick {
struct pending_pick *next;
/* polling entity for the pick()'s async notification */
grpc_polling_entity *pollent;
/* the initial metadata for the pick. See grpc_lb_policy_pick() */
grpc_metadata_batch *initial_metadata;
/* storage for the lb token initial metadata mdelem */
grpc_linked_mdelem *lb_token_mdelem_storage;
/* bitmask passed to pick() and used for selective cancelling. See
* grpc_lb_policy_cancel_picks() */
uint32_t initial_metadata_flags;
/* original pick()'s arguments */
grpc_lb_policy_pick_args pick_args;
/* output argument where to store the pick()ed connected subchannel, or NULL
* upon error. */
@ -232,11 +223,8 @@ static void add_pending_pick(pending_pick **root,
memset(pp, 0, sizeof(pending_pick));
memset(&pp->wrapped_on_complete_arg, 0, sizeof(wrapped_rr_closure_arg));
pp->next = *root;
pp->pollent = pick_args->pollent;
pp->pick_args = *pick_args;
pp->target = target;
pp->initial_metadata = pick_args->initial_metadata;
pp->initial_metadata_flags = pick_args->initial_metadata_flags;
pp->lb_token_mdelem_storage = pick_args->lb_token_mdelem_storage;
pp->wrapped_on_complete_arg.wrapped_closure = on_complete;
pp->wrapped_on_complete_arg.target = target;
pp->wrapped_on_complete_arg.initial_metadata = pick_args->initial_metadata;
@ -283,9 +271,13 @@ typedef struct glb_lb_policy {
/** mutex protecting remaining members */
gpr_mu mu;
/** who the client is trying to communicate with */
const char *server_name;
grpc_client_channel_factory *cc_factory;
/** deadline for the LB's call */
gpr_timespec deadline;
/** for communicating with the LB server */
grpc_channel *lb_channel;
@ -337,8 +329,8 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx,
if (server->port >> 16 != 0) {
if (log) {
gpr_log(GPR_ERROR,
"Invalid port '%d' at index %zu of serverlist. Ignoring.",
server->port, idx);
"Invalid port '%d' at index %lu of serverlist. Ignoring.",
server->port, (unsigned long)idx);
}
return false;
}
@ -346,9 +338,9 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx,
if (ip->size != 4 && ip->size != 16) {
if (log) {
gpr_log(GPR_ERROR,
"Expected IP to be 4 or 16 bytes, got %d at index %zu of "
"Expected IP to be 4 or 16 bytes, got %d at index %lu of "
"serverlist. Ignoring",
ip->size, idx);
ip->size, (unsigned long)idx);
}
return false;
}
@ -486,10 +478,8 @@ static void rr_handover(grpc_exec_ctx *exec_ctx, glb_lb_policy *glb_policy,
gpr_log(GPR_INFO, "Pending pick about to PICK from 0x%" PRIxPTR "",
(intptr_t)glb_policy->rr_policy);
}
const grpc_lb_policy_pick_args pick_args = {
pp->pollent, pp->initial_metadata, pp->initial_metadata_flags,
pp->lb_token_mdelem_storage};
grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, &pick_args, pp->target,
grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, &pp->pick_args,
pp->target,
(void **)&pp->wrapped_on_complete_arg.lb_token,
&pp->wrapped_on_complete);
pp->wrapped_on_complete_arg.owning_pending_node = pp;
@ -589,7 +579,7 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx,
&addr_strs[addr_index++],
(const struct sockaddr *)&args->addresses->addresses[i]
.address.addr,
true) == 0);
true) > 0);
}
}
}
@ -660,7 +650,6 @@ static void glb_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
*pp->target = NULL;
grpc_exec_ctx_sched(exec_ctx, &pp->wrapped_on_complete, GRPC_ERROR_NONE,
NULL);
gpr_free(pp);
pp = next;
}
@ -698,12 +687,11 @@ static void glb_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
pending_pick *next = pp->next;
if (pp->target == target) {
grpc_polling_entity_del_from_pollset_set(
exec_ctx, pp->pollent, glb_policy->base.interested_parties);
exec_ctx, pp->pick_args.pollent, glb_policy->base.interested_parties);
*target = NULL;
grpc_exec_ctx_sched(
exec_ctx, &pp->wrapped_on_complete,
GRPC_ERROR_CREATE_REFERENCING("Pick Cancelled", &error, 1), NULL);
gpr_free(pp);
} else {
pp->next = glb_policy->pending_picks;
glb_policy->pending_picks = pp;
@ -729,14 +717,13 @@ static void glb_cancel_picks(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
glb_policy->pending_picks = NULL;
while (pp != NULL) {
pending_pick *next = pp->next;
if ((pp->initial_metadata_flags & initial_metadata_flags_mask) ==
if ((pp->pick_args.initial_metadata_flags & initial_metadata_flags_mask) ==
initial_metadata_flags_eq) {
grpc_polling_entity_del_from_pollset_set(
exec_ctx, pp->pollent, glb_policy->base.interested_parties);
exec_ctx, pp->pick_args.pollent, glb_policy->base.interested_parties);
grpc_exec_ctx_sched(
exec_ctx, &pp->wrapped_on_complete,
GRPC_ERROR_CREATE_REFERENCING("Pick Cancelled", &error, 1), NULL);
gpr_free(pp);
} else {
pp->next = glb_policy->pending_picks;
glb_policy->pending_picks = pp;
@ -767,8 +754,6 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
const grpc_lb_policy_pick_args *pick_args,
grpc_connected_subchannel **target, void **user_data,
grpc_closure *on_complete) {
glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
if (pick_args->lb_token_mdelem_storage == NULL) {
*target = NULL;
grpc_exec_ctx_sched(
@ -776,11 +761,13 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
GRPC_ERROR_CREATE("No mdelem storage for the LB token. Load reporting "
"won't work without it. Failing"),
NULL);
return 1;
return 0;
}
glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
gpr_mu_lock(&glb_policy->mu);
int r;
glb_policy->deadline = pick_args->deadline;
bool pick_done;
if (glb_policy->rr_policy != NULL) {
if (grpc_lb_glb_trace) {
@ -799,10 +786,11 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
grpc_closure_init(&glb_policy->wrapped_on_complete, wrapped_rr_closure,
&glb_policy->wc_arg);
r = grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, pick_args, target,
pick_done =
grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, pick_args, target,
(void **)&glb_policy->wc_arg.lb_token,
&glb_policy->wrapped_on_complete);
if (r != 0) {
if (pick_done) {
/* synchronous grpc_lb_policy_pick call. Unref the RR policy. */
if (grpc_lb_glb_trace) {
gpr_log(GPR_INFO, "Unreffing RR (0x%" PRIxPTR ")",
@ -816,6 +804,8 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
GRPC_MDELEM_REF(glb_policy->wc_arg.lb_token));
}
} else {
/* else, the pending pick will be registered and taken care of by the
* pending pick list inside the RR policy (glb_policy->rr_policy) */
grpc_polling_entity_add_to_pollset_set(exec_ctx, pick_args->pollent,
glb_policy->base.interested_parties);
add_pending_pick(&glb_policy->pending_picks, pick_args, target,
@ -824,10 +814,10 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
if (!glb_policy->started_picking) {
start_picking(exec_ctx, glb_policy);
}
r = 0;
pick_done = false;
}
gpr_mu_unlock(&glb_policy->mu);
return r;
return pick_done;
}
static grpc_connectivity_state glb_check_connectivity(
@ -937,8 +927,7 @@ static lb_client_data *lb_client_data_create(glb_lb_policy *glb_policy) {
grpc_closure_init(&lb_client->close_sent, close_sent_cb, lb_client);
grpc_closure_init(&lb_client->srv_status_rcvd, srv_status_rcvd_cb, lb_client);
/* TODO(dgq): get the deadline from the parent channel. */
lb_client->deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
lb_client->deadline = glb_policy->deadline;
/* Note the following LB call progresses every time there's activity in \a
* glb_policy->base.interested_parties, which is comprised of the polling
@ -1081,8 +1070,8 @@ static void res_recv_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
if (serverlist != NULL) {
gpr_slice_unref(response_slice);
if (grpc_lb_glb_trace) {
gpr_log(GPR_INFO, "Serverlist with %zu servers received",
serverlist->num_servers);
gpr_log(GPR_INFO, "Serverlist with %lu servers received",
(unsigned long)serverlist->num_servers);
}
/* update serverlist */
@ -1166,10 +1155,10 @@ static void srv_status_rcvd_cb(grpc_exec_ctx *exec_ctx, void *arg,
if (grpc_lb_glb_trace) {
gpr_log(GPR_INFO,
"status from lb server received. Status = %d, Details = '%s', "
"Capaticy "
"= %zu",
"Capacity "
"= %lu",
lb_client->status, lb_client->status_details,
lb_client->status_details_capacity);
(unsigned long)lb_client->status_details_capacity);
}
/* TODO(dgq): deal with stream termination properly (fire up another one?
* fail the original call?) */

@ -53,16 +53,12 @@
typedef struct {
/** base class: must be first */
grpc_resolver base;
/** refcount */
gpr_refcount refs;
/** target name */
char *target_name;
/** name to resolve (usually the same as target_name) */
char *name_to_resolve;
/** default port to use */
char *default_port;
/** load balancing policy name */
char *lb_policy_name;
/** mutex guarding the rest of the state */
gpr_mu mu;
@ -181,7 +177,7 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
}
grpc_resolved_addresses_destroy(r->addresses);
result = grpc_resolver_result_create(r->target_name, addresses,
r->lb_policy_name, NULL);
NULL /* lb_policy_name */, NULL);
} else {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
gpr_timespec next_try = gpr_backoff_step(&r->backoff_state, now);
@ -245,13 +241,11 @@ static void dns_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
gpr_free(r->target_name);
gpr_free(r->name_to_resolve);
gpr_free(r->default_port);
gpr_free(r->lb_policy_name);
gpr_free(r);
}
static grpc_resolver *dns_create(grpc_resolver_args *args,
const char *default_port,
const char *lb_policy_name) {
const char *default_port) {
if (0 != strcmp(args->uri->authority, "")) {
gpr_log(GPR_ERROR, "authority based dns uri's not supported");
return NULL;
@ -264,7 +258,6 @@ static grpc_resolver *dns_create(grpc_resolver_args *args,
// Create resolver.
dns_resolver *r = gpr_malloc(sizeof(dns_resolver));
memset(r, 0, sizeof(*r));
gpr_ref_init(&r->refs, 1);
gpr_mu_init(&r->mu);
grpc_resolver_init(&r->base, &dns_resolver_vtable);
r->target_name = gpr_strdup(path);
@ -272,7 +265,6 @@ static grpc_resolver *dns_create(grpc_resolver_args *args,
r->default_port = gpr_strdup(default_port);
gpr_backoff_init(&r->backoff_state, BACKOFF_MULTIPLIER, BACKOFF_JITTER,
BACKOFF_MIN_SECONDS * 1000, BACKOFF_MAX_SECONDS * 1000);
r->lb_policy_name = gpr_strdup(lb_policy_name);
return &r->base;
}
@ -286,7 +278,7 @@ static void dns_factory_unref(grpc_resolver_factory *factory) {}
static grpc_resolver *dns_factory_create_resolver(
grpc_resolver_factory *factory, grpc_resolver_args *args) {
return dns_create(args, "https", "pick_first");
return dns_create(args, "https");
}
static char *dns_factory_get_default_host_name(grpc_resolver_factory *factory,

@ -49,10 +49,6 @@
typedef struct {
/** base class: must be first */
grpc_resolver base;
/** refcount */
gpr_refcount refs;
/** load balancing policy name */
char *lb_policy_name;
/** the path component of the uri passed in */
char *target_name;
/** the addresses that we've 'resolved' */
@ -123,7 +119,7 @@ static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
*r->target_result = grpc_resolver_result_create(
r->target_name,
grpc_lb_addresses_copy(r->addresses, NULL /* user_data_copy */),
r->lb_policy_name, NULL);
NULL /* lb_policy_name */, NULL);
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL;
}
@ -133,7 +129,6 @@ static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
sockaddr_resolver *r = (sockaddr_resolver *)gr;
gpr_mu_destroy(&r->mu);
grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */);
gpr_free(r->lb_policy_name);
gpr_free(r->target_name);
gpr_free(r);
}
@ -163,80 +158,49 @@ char *unix_get_default_authority(grpc_resolver_factory *factory,
static void do_nothing(void *ignored) {}
static grpc_resolver *sockaddr_create(
grpc_resolver_args *args, const char *default_lb_policy_name,
int parse(grpc_uri *uri, struct sockaddr_storage *dst, size_t *len)) {
bool errors_found = false;
sockaddr_resolver *r;
gpr_slice path_slice;
gpr_slice_buffer path_parts;
static grpc_resolver *sockaddr_create(grpc_resolver_args *args,
int parse(grpc_uri *uri,
struct sockaddr_storage *dst,
size_t *len)) {
if (0 != strcmp(args->uri->authority, "")) {
gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme",
args->uri->scheme);
return NULL;
}
r = gpr_malloc(sizeof(sockaddr_resolver));
memset(r, 0, sizeof(*r));
r->lb_policy_name =
gpr_strdup(grpc_uri_get_query_arg(args->uri, "lb_policy"));
const char *lb_enabled_qpart =
grpc_uri_get_query_arg(args->uri, "lb_enabled");
/* anything other than "0" is interpreted as true */
const bool lb_enabled =
(lb_enabled_qpart != NULL && (strcmp("0", lb_enabled_qpart) != 0));
if (r->lb_policy_name != NULL && strcmp("grpclb", r->lb_policy_name) == 0 &&
!lb_enabled) {
/* we want grpclb but the "resolved" addresses aren't LB enabled. Bail
* out, as this is meant mostly for tests. */
gpr_log(GPR_ERROR,
"Requested 'grpclb' LB policy but resolved addresses don't "
"support load balancing.");
abort();
}
if (r->lb_policy_name == NULL) {
r->lb_policy_name = gpr_strdup(default_lb_policy_name);
}
path_slice =
/* Construct addresses. */
gpr_slice path_slice =
gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing);
gpr_slice_buffer path_parts;
gpr_slice_buffer_init(&path_parts);
gpr_slice_split(path_slice, ",", &path_parts);
r->addresses = grpc_lb_addresses_create(path_parts.count);
for (size_t i = 0; i < r->addresses->num_addresses; i++) {
grpc_lb_addresses *addresses = grpc_lb_addresses_create(path_parts.count);
bool errors_found = false;
for (size_t i = 0; i < addresses->num_addresses; i++) {
grpc_uri ith_uri = *args->uri;
char *part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII);
ith_uri.path = part_str;
if (!parse(&ith_uri, (struct sockaddr_storage *)(&r->addresses->addresses[i]
.address.addr),
&r->addresses->addresses[i].address.len)) {
if (!parse(
&ith_uri,
(struct sockaddr_storage *)(&addresses->addresses[i].address.addr),
&addresses->addresses[i].address.len)) {
errors_found = true;
}
gpr_free(part_str);
r->addresses->addresses[i].is_balancer = lb_enabled;
if (errors_found) break;
}
r->target_name = gpr_strdup(args->uri->path);
gpr_slice_buffer_destroy(&path_parts);
gpr_slice_unref(path_slice);
if (errors_found) {
gpr_free(r->lb_policy_name);
gpr_free(r->target_name);
grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */);
gpr_free(r);
grpc_lb_addresses_destroy(addresses, NULL /* user_data_destroy */);
return NULL;
}
gpr_ref_init(&r->refs, 1);
/* Instantiate resolver. */
sockaddr_resolver *r = gpr_malloc(sizeof(sockaddr_resolver));
memset(r, 0, sizeof(*r));
r->target_name = gpr_strdup(args->uri->path);
r->addresses = addresses;
gpr_mu_init(&r->mu);
grpc_resolver_init(&r->base, &sockaddr_resolver_vtable);
return &r->base;
}
@ -251,7 +215,7 @@ static void sockaddr_factory_unref(grpc_resolver_factory *factory) {}
#define DECL_FACTORY(name) \
static grpc_resolver *name##_factory_create_resolver( \
grpc_resolver_factory *factory, grpc_resolver_args *args) { \
return sockaddr_create(args, "pick_first", parse_##name); \
return sockaddr_create(args, parse_##name); \
} \
static const grpc_resolver_factory_vtable name##_factory_vtable = { \
sockaddr_factory_ref, sockaddr_factory_unref, \

@ -61,13 +61,12 @@ typedef struct server_secure_state {
grpc_server_credentials *creds;
bool is_shutdown;
gpr_mu mu;
gpr_refcount refcount;
grpc_closure destroy_closure;
grpc_closure *destroy_callback;
grpc_closure tcp_server_shutdown_complete;
grpc_closure *server_destroy_listener_done;
} server_secure_state;
typedef struct server_secure_connect {
server_secure_state *state;
server_secure_state *server_state;
grpc_pollset *accepting_pollset;
grpc_tcp_server_acceptor *acceptor;
grpc_handshake_manager *handshake_mgr;
@ -77,39 +76,28 @@ typedef struct server_secure_connect {
grpc_channel_args *args;
} server_secure_connect;
static void state_ref(server_secure_state *state) { gpr_ref(&state->refcount); }
static void state_unref(server_secure_state *state) {
if (gpr_unref(&state->refcount)) {
/* ensure all threads have unlocked */
gpr_mu_lock(&state->mu);
gpr_mu_unlock(&state->mu);
/* clean up */
GRPC_SECURITY_CONNECTOR_UNREF(&state->sc->base, "server");
grpc_server_credentials_unref(state->creds);
gpr_free(state);
}
}
static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *statep,
grpc_security_status status,
grpc_endpoint *secure_endpoint,
grpc_auth_context *auth_context) {
server_secure_connect *state = statep;
server_secure_connect *connection_state = statep;
if (status == GRPC_SECURITY_OK) {
if (secure_endpoint) {
gpr_mu_lock(&state->state->mu);
if (!state->state->is_shutdown) {
gpr_mu_lock(&connection_state->server_state->mu);
if (!connection_state->server_state->is_shutdown) {
grpc_transport *transport = grpc_create_chttp2_transport(
exec_ctx, grpc_server_get_channel_args(state->state->server),
exec_ctx, grpc_server_get_channel_args(
connection_state->server_state->server),
secure_endpoint, 0);
grpc_arg args_to_add[2];
args_to_add[0] = grpc_server_credentials_to_arg(state->state->creds);
args_to_add[0] = grpc_server_credentials_to_arg(
connection_state->server_state->creds);
args_to_add[1] = grpc_auth_context_to_arg(auth_context);
grpc_channel_args *args_copy = grpc_channel_args_copy_and_add(
state->args, args_to_add, GPR_ARRAY_SIZE(args_to_add));
grpc_server_setup_transport(exec_ctx, state->state->server, transport,
state->accepting_pollset, args_copy);
connection_state->args, args_to_add, GPR_ARRAY_SIZE(args_to_add));
grpc_server_setup_transport(
exec_ctx, connection_state->server_state->server, transport,
connection_state->accepting_pollset, args_copy);
grpc_channel_args_destroy(args_copy);
grpc_chttp2_transport_start_reading(exec_ctx, transport, NULL);
} else {
@ -117,21 +105,21 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *statep,
* gone away. */
grpc_endpoint_destroy(exec_ctx, secure_endpoint);
}
gpr_mu_unlock(&state->state->mu);
gpr_mu_unlock(&connection_state->server_state->mu);
}
} else {
gpr_log(GPR_ERROR, "Secure transport failed with error %d", status);
}
grpc_channel_args_destroy(state->args);
state_unref(state->state);
gpr_free(state);
grpc_channel_args_destroy(connection_state->args);
grpc_tcp_server_unref(exec_ctx, connection_state->server_state->tcp);
gpr_free(connection_state);
}
static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint,
grpc_channel_args *args,
gpr_slice_buffer *read_buffer, void *user_data,
grpc_error *error) {
server_secure_connect *state = user_data;
server_secure_connect *connection_state = user_data;
if (error != GRPC_ERROR_NONE) {
const char *error_str = grpc_error_string(error);
gpr_log(GPR_ERROR, "Handshaking failed: %s", error_str);
@ -139,81 +127,107 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint,
GRPC_ERROR_UNREF(error);
grpc_channel_args_destroy(args);
gpr_free(read_buffer);
grpc_handshake_manager_shutdown(exec_ctx, state->handshake_mgr);
grpc_handshake_manager_destroy(exec_ctx, state->handshake_mgr);
state_unref(state->state);
gpr_free(state);
grpc_handshake_manager_shutdown(exec_ctx, connection_state->handshake_mgr);
grpc_handshake_manager_destroy(exec_ctx, connection_state->handshake_mgr);
grpc_tcp_server_unref(exec_ctx, connection_state->server_state->tcp);
gpr_free(connection_state);
return;
}
grpc_handshake_manager_destroy(exec_ctx, state->handshake_mgr);
state->handshake_mgr = NULL;
grpc_handshake_manager_destroy(exec_ctx, connection_state->handshake_mgr);
connection_state->handshake_mgr = NULL;
// TODO(roth, jboeuf): Convert security connector handshaking to use new
// handshake API, and then move the code from on_secure_handshake_done()
// into this function.
state->args = args;
connection_state->args = args;
grpc_server_security_connector_do_handshake(
exec_ctx, state->state->sc, state->acceptor, endpoint, read_buffer,
state->deadline, on_secure_handshake_done, state);
exec_ctx, connection_state->server_state->sc, connection_state->acceptor,
endpoint, read_buffer, connection_state->deadline,
on_secure_handshake_done, connection_state);
}
static void on_accept(grpc_exec_ctx *exec_ctx, void *statep, grpc_endpoint *tcp,
grpc_pollset *accepting_pollset,
grpc_tcp_server_acceptor *acceptor) {
server_secure_connect *state = gpr_malloc(sizeof(*state));
state->state = statep;
state_ref(state->state);
state->accepting_pollset = accepting_pollset;
state->acceptor = acceptor;
state->handshake_mgr = grpc_handshake_manager_create();
server_secure_state *server_state = statep;
server_secure_connect *connection_state = NULL;
gpr_mu_lock(&server_state->mu);
if (server_state->is_shutdown) {
gpr_mu_unlock(&server_state->mu);
grpc_endpoint_destroy(exec_ctx, tcp);
return;
}
gpr_mu_unlock(&server_state->mu);
grpc_tcp_server_ref(server_state->tcp);
connection_state = gpr_malloc(sizeof(*connection_state));
connection_state->server_state = server_state;
connection_state->accepting_pollset = accepting_pollset;
connection_state->acceptor = acceptor;
connection_state->handshake_mgr = grpc_handshake_manager_create();
// TODO(roth): We should really get this timeout value from channel
// args instead of hard-coding it.
state->deadline = gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_seconds(120, GPR_TIMESPAN));
connection_state->deadline = gpr_time_add(
gpr_now(GPR_CLOCK_MONOTONIC), gpr_time_from_seconds(120, GPR_TIMESPAN));
grpc_handshake_manager_do_handshake(
exec_ctx, state->handshake_mgr, tcp,
grpc_server_get_channel_args(state->state->server), state->deadline,
acceptor, on_handshake_done, state);
exec_ctx, connection_state->handshake_mgr, tcp,
grpc_server_get_channel_args(connection_state->server_state->server),
connection_state->deadline, acceptor, on_handshake_done,
connection_state);
}
/* Server callback: start listening on our ports */
static void start(grpc_exec_ctx *exec_ctx, grpc_server *server, void *statep,
grpc_pollset **pollsets, size_t pollset_count) {
server_secure_state *state = statep;
grpc_tcp_server_start(exec_ctx, state->tcp, pollsets, pollset_count,
on_accept, state);
static void server_start_listener(grpc_exec_ctx *exec_ctx, grpc_server *server,
void *statep, grpc_pollset **pollsets,
size_t pollset_count) {
server_secure_state *server_state = statep;
gpr_mu_lock(&server_state->mu);
server_state->is_shutdown = false;
gpr_mu_unlock(&server_state->mu);
grpc_tcp_server_start(exec_ctx, server_state->tcp, pollsets, pollset_count,
on_accept, server_state);
}
static void destroy_done(grpc_exec_ctx *exec_ctx, void *statep,
grpc_error *error) {
server_secure_state *state = statep;
if (state->destroy_callback != NULL) {
state->destroy_callback->cb(exec_ctx, state->destroy_callback->cb_arg,
GRPC_ERROR_REF(error));
static void tcp_server_shutdown_complete(grpc_exec_ctx *exec_ctx, void *statep,
grpc_error *error) {
server_secure_state *server_state = statep;
/* ensure all threads have unlocked */
gpr_mu_lock(&server_state->mu);
grpc_closure *destroy_done = server_state->server_destroy_listener_done;
GPR_ASSERT(server_state->is_shutdown);
gpr_mu_unlock(&server_state->mu);
/* clean up */
grpc_server_security_connector_shutdown(exec_ctx, server_state->sc);
/* Flush queued work before a synchronous unref. */
grpc_exec_ctx_flush(exec_ctx);
GRPC_SECURITY_CONNECTOR_UNREF(&server_state->sc->base, "server");
grpc_server_credentials_unref(server_state->creds);
if (destroy_done != NULL) {
destroy_done->cb(exec_ctx, destroy_done->cb_arg, GRPC_ERROR_REF(error));
grpc_exec_ctx_flush(exec_ctx);
}
grpc_server_security_connector_shutdown(exec_ctx, state->sc);
state_unref(state);
gpr_free(server_state);
}
/* Server callback: destroy the tcp listener (so we don't generate further
callbacks) */
static void destroy(grpc_exec_ctx *exec_ctx, grpc_server *server, void *statep,
grpc_closure *callback) {
server_secure_state *state = statep;
static void server_destroy_listener(grpc_exec_ctx *exec_ctx,
grpc_server *server, void *statep,
grpc_closure *callback) {
server_secure_state *server_state = statep;
grpc_tcp_server *tcp;
gpr_mu_lock(&state->mu);
state->is_shutdown = true;
state->destroy_callback = callback;
tcp = state->tcp;
gpr_mu_unlock(&state->mu);
gpr_mu_lock(&server_state->mu);
server_state->is_shutdown = true;
server_state->server_destroy_listener_done = callback;
tcp = server_state->tcp;
gpr_mu_unlock(&server_state->mu);
grpc_tcp_server_shutdown_listeners(exec_ctx, tcp);
grpc_tcp_server_unref(exec_ctx, tcp);
grpc_tcp_server_unref(exec_ctx, server_state->tcp);
}
int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
grpc_server_credentials *creds) {
grpc_resolved_addresses *resolved = NULL;
grpc_tcp_server *tcp = NULL;
server_secure_state *state = NULL;
server_secure_state *server_state = NULL;
size_t i;
size_t count = 0;
int port_num = -1;
@ -253,22 +267,22 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
if (err != GRPC_ERROR_NONE) {
goto error;
}
state = gpr_malloc(sizeof(*state));
memset(state, 0, sizeof(*state));
grpc_closure_init(&state->destroy_closure, destroy_done, state);
err = grpc_tcp_server_create(&state->destroy_closure,
server_state = gpr_malloc(sizeof(*server_state));
memset(server_state, 0, sizeof(*server_state));
grpc_closure_init(&server_state->tcp_server_shutdown_complete,
tcp_server_shutdown_complete, server_state);
err = grpc_tcp_server_create(&server_state->tcp_server_shutdown_complete,
grpc_server_get_channel_args(server), &tcp);
if (err != GRPC_ERROR_NONE) {
goto error;
}
state->server = server;
state->tcp = tcp;
state->sc = sc;
state->creds = grpc_server_credentials_ref(creds);
state->is_shutdown = false;
gpr_mu_init(&state->mu);
gpr_ref_init(&state->refcount, 1);
server_state->server = server;
server_state->tcp = tcp;
server_state->sc = sc;
server_state->creds = grpc_server_credentials_ref(creds);
server_state->is_shutdown = true;
gpr_mu_init(&server_state->mu);
errors = gpr_malloc(sizeof(*errors) * resolved->naddrs);
for (i = 0; i < resolved->naddrs; i++) {
@ -313,7 +327,8 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
grpc_resolved_addresses_destroy(resolved);
/* Register with the server only upon success */
grpc_server_add_listener(&exec_ctx, server, state, start, destroy);
grpc_server_add_listener(&exec_ctx, server, server_state,
server_start_listener, server_destroy_listener);
grpc_exec_ctx_finish(&exec_ctx);
return port_num;
@ -334,10 +349,11 @@ error:
grpc_tcp_server_unref(&exec_ctx, tcp);
} else {
if (sc) {
grpc_exec_ctx_flush(&exec_ctx);
GRPC_SECURITY_CONNECTOR_UNREF(&sc->base, "server");
}
if (state) {
gpr_free(state);
if (server_state) {
gpr_free(server_state);
}
}
grpc_exec_ctx_finish(&exec_ctx);

@ -239,6 +239,14 @@ static const char *op_id_string(enum e_op_id i) {
return "UNKNOWN";
}
static void free_read_buffer(stream_obj *s) {
if (s->state.rs.read_buffer &&
s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) {
gpr_free(s->state.rs.read_buffer);
s->state.rs.read_buffer = NULL;
}
}
/*
Add a new stream op to op storage.
*/
@ -341,6 +349,7 @@ static void on_failed(cronet_bidirectional_stream *stream, int net_error) {
gpr_free(s->state.ws.write_buffer);
s->state.ws.write_buffer = NULL;
}
free_read_buffer(s);
gpr_mu_unlock(&s->mu);
execute_from_storage(s);
}
@ -363,6 +372,7 @@ static void on_canceled(cronet_bidirectional_stream *stream) {
gpr_free(s->state.ws.write_buffer);
s->state.ws.write_buffer = NULL;
}
free_read_buffer(s);
gpr_mu_unlock(&s->mu);
execute_from_storage(s);
}
@ -377,6 +387,7 @@ static void on_succeeded(cronet_bidirectional_stream *stream) {
cronet_bidirectional_stream_destroy(s->cbs);
s->state.state_callback_received[OP_SUCCEEDED] = true;
s->cbs = NULL;
free_read_buffer(s);
gpr_mu_unlock(&s->mu);
execute_from_storage(s);
}
@ -531,7 +542,8 @@ static void create_grpc_frame(gpr_slice_buffer *write_slice_buffer,
*/
static void convert_metadata_to_cronet_headers(
grpc_linked_mdelem *head, const char *host, char **pp_url,
cronet_bidirectional_stream_header **pp_headers, size_t *p_num_headers) {
cronet_bidirectional_stream_header **pp_headers, size_t *p_num_headers,
const char **method) {
grpc_linked_mdelem *curr = head;
/* Walk the linked list and get number of header fields */
size_t num_headers_available = 0;
@ -558,11 +570,20 @@ static void convert_metadata_to_cronet_headers(
curr = curr->next;
const char *key = grpc_mdstr_as_c_string(mdelem->key);
const char *value = grpc_mdstr_as_c_string(mdelem->value);
if (mdelem->key == GRPC_MDSTR_METHOD || mdelem->key == GRPC_MDSTR_SCHEME ||
if (mdelem->key == GRPC_MDSTR_SCHEME ||
mdelem->key == GRPC_MDSTR_AUTHORITY) {
/* Cronet populates these fields on its own */
continue;
}
if (mdelem->key == GRPC_MDSTR_METHOD) {
if (mdelem->value == GRPC_MDSTR_PUT) {
*method = "PUT";
} else {
/* POST method in default*/
*method = "POST";
}
continue;
}
if (mdelem->key == GRPC_MDSTR_PATH) {
/* Create URL by appending :path value to the hostname */
gpr_asprintf(pp_url, "https://%s%s", host, value);
@ -759,15 +780,16 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
s->cbs = cronet_bidirectional_stream_create(s->curr_ct.engine, s->curr_gs,
&cronet_callbacks);
CRONET_LOG(GPR_DEBUG, "%p = cronet_bidirectional_stream_create()", s->cbs);
char *url;
char *url = NULL;
const char *method = "POST";
s->header_array.headers = NULL;
convert_metadata_to_cronet_headers(
stream_op->send_initial_metadata->list.head, s->curr_ct.host, &url,
&s->header_array.headers, &s->header_array.count);
&s->header_array.headers, &s->header_array.count, &method);
s->header_array.capacity = s->header_array.count;
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_start(%p, %s)", s->cbs,
url);
cronet_bidirectional_stream_start(s->cbs, url, 0, "POST", &s->header_array,
cronet_bidirectional_stream_start(s->cbs, url, 0, method, &s->header_array,
false);
stream_state->state_op_done[OP_SEND_INITIAL_METADATA] = true;
result = ACTION_TAKEN_WITH_CALLBACK;
@ -901,6 +923,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
uint8_t *dst_p = GPR_SLICE_START_PTR(read_data_slice);
memcpy(dst_p, stream_state->rs.read_buffer,
(size_t)stream_state->rs.length_field);
free_read_buffer(s);
gpr_slice_buffer_init(&stream_state->rs.read_slice_buffer);
gpr_slice_buffer_add(&stream_state->rs.read_slice_buffer,
read_data_slice);

@ -73,16 +73,22 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
gpr_asprintf(&message_string,
"Received message larger than max (%u vs. %d)",
(*calld->recv_message)->length, chand->max_recv_size);
gpr_slice message = gpr_slice_from_copied_string(message_string);
grpc_error* new_error = grpc_error_set_int(
GRPC_ERROR_CREATE(message_string), GRPC_ERROR_INT_GRPC_STATUS,
GRPC_STATUS_INVALID_ARGUMENT);
if (error == GRPC_ERROR_NONE) {
error = new_error;
} else {
error = grpc_error_add_child(error, new_error);
GRPC_ERROR_UNREF(new_error);
}
gpr_free(message_string);
grpc_call_element_send_close_with_message(
exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT, &message);
}
// Invoke the next callback.
grpc_exec_ctx_sched(exec_ctx, calld->next_recv_message_ready, error, NULL);
}
// Start transport op.
// Start transport stream op.
static void start_transport_stream_op(grpc_exec_ctx* exec_ctx,
grpc_call_element* elem,
grpc_transport_stream_op* op) {

@ -40,6 +40,10 @@
#include <grpc/status.h>
#include <grpc/support/time.h>
#ifdef __cplusplus
extern "C" {
#endif
/// Opaque representation of an error.
/// Errors are refcounted objects that represent the result of an operation.
/// Ownership laws:
@ -204,4 +208,8 @@ bool grpc_log_if_error(const char *what, grpc_error *error, const char *file,
#define GRPC_LOG_IF_ERROR(what, error) \
grpc_log_if_error((what), (error), __FILE__, __LINE__)
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_H */

@ -101,8 +101,8 @@ grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s);
void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
grpc_closure *shutdown_starting);
/* If the refcount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue
a call (exec_ctx!=NULL) to shutdown_complete. */
/* If the refcount drops to zero, enqueue calls on exec_ctx to
shutdown_listeners and delete s. */
void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s);
/* Shutdown the fds of listeners. */

@ -191,6 +191,9 @@ grpc_error *grpc_tcp_server_create(grpc_closure *shutdown_complete,
}
static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
gpr_mu_lock(&s->mu);
GPR_ASSERT(s->shutdown);
gpr_mu_unlock(&s->mu);
if (s->shutdown_complete != NULL) {
grpc_exec_ctx_sched(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE, NULL);
}
@ -652,6 +655,7 @@ unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s,
unsigned port_index) {
unsigned num_fds = 0;
grpc_tcp_listener *sp;
gpr_mu_lock(&s->mu);
for (sp = s->head; sp && port_index != 0; sp = sp->next) {
if (!sp->is_sibling) {
--port_index;
@ -659,12 +663,15 @@ unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s,
}
for (; sp; sp = sp->sibling, ++num_fds)
;
gpr_mu_unlock(&s->mu);
return num_fds;
}
int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index,
unsigned fd_index) {
grpc_tcp_listener *sp;
int fd;
gpr_mu_lock(&s->mu);
for (sp = s->head; sp && port_index != 0; sp = sp->next) {
if (!sp->is_sibling) {
--port_index;
@ -673,10 +680,12 @@ int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index,
for (; sp && fd_index != 0; sp = sp->sibling, --fd_index)
;
if (sp) {
return sp->fd;
fd = sp->fd;
} else {
return -1;
fd = -1;
}
gpr_mu_unlock(&s->mu);
return fd;
}
void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s,
@ -722,7 +731,7 @@ void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s,
}
grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s) {
gpr_ref(&s->refs);
gpr_ref_non_zero(&s->refs);
return s;
}
@ -736,19 +745,11 @@ void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
if (gpr_unref(&s->refs)) {
/* Complete shutdown_starting work before destroying. */
grpc_exec_ctx local_exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_tcp_server_shutdown_listeners(exec_ctx, s);
gpr_mu_lock(&s->mu);
grpc_exec_ctx_enqueue_list(&local_exec_ctx, &s->shutdown_starting, NULL);
grpc_exec_ctx_enqueue_list(exec_ctx, &s->shutdown_starting, NULL);
gpr_mu_unlock(&s->mu);
if (exec_ctx == NULL) {
grpc_exec_ctx_flush(&local_exec_ctx);
tcp_server_destroy(&local_exec_ctx, s);
grpc_exec_ctx_finish(&local_exec_ctx);
} else {
grpc_exec_ctx_finish(&local_exec_ctx);
tcp_server_destroy(exec_ctx, s);
}
tcp_server_destroy(exec_ctx, s);
}
}

@ -139,7 +139,7 @@ static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
}
grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s) {
gpr_ref(&s->refs);
gpr_ref_non_zero(&s->refs);
return s;
}
@ -174,19 +174,11 @@ static void tcp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
if (gpr_unref(&s->refs)) {
/* Complete shutdown_starting work before destroying. */
grpc_exec_ctx local_exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_tcp_server_shutdown_listeners(exec_ctx, s);
gpr_mu_lock(&s->mu);
grpc_exec_ctx_enqueue_list(&local_exec_ctx, &s->shutdown_starting, NULL);
grpc_exec_ctx_enqueue_list(exec_ctx, &s->shutdown_starting, NULL);
gpr_mu_unlock(&s->mu);
if (exec_ctx == NULL) {
grpc_exec_ctx_flush(&local_exec_ctx);
tcp_server_destroy(&local_exec_ctx, s);
grpc_exec_ctx_finish(&local_exec_ctx);
} else {
grpc_exec_ctx_finish(&local_exec_ctx);
tcp_server_destroy(exec_ctx, s);
}
tcp_server_destroy(exec_ctx, s);
}
}

@ -38,7 +38,6 @@
#include <grpc/support/port_platform.h>
#ifdef GRPC_NEED_UDP
#ifdef GPR_POSIX_SOCKET
#include "src/core/lib/iomgr/udp_server.h"
@ -171,6 +170,8 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) {
sp->destroyed_closure.cb = destroyed_port;
sp->destroyed_closure.cb_arg = s;
/* Call the orphan_cb to signal that the FD is about to be closed and
* should no longer be used. */
GPR_ASSERT(sp->orphan_cb);
sp->orphan_cb(sp->emfd);
@ -197,6 +198,12 @@ void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
/* shutdown all fd's */
if (s->active_ports) {
for (i = 0; i < s->nports; i++) {
server_port *sp = &s->ports[i];
/* Call the orphan_cb to signal that the FD is about to be closed and
* should no longer be used. */
GPR_ASSERT(sp->orphan_cb);
sp->orphan_cb(sp->emfd);
grpc_fd_shutdown(exec_ctx, s->ports[i].emfd);
}
gpr_mu_unlock(&s->mu);
@ -439,4 +446,3 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
}
#endif
#endif

@ -242,8 +242,17 @@ static grpc_security_status composite_channel_create_security_connector(
return status;
}
static grpc_channel_credentials *
composite_channel_duplicate_without_call_credentials(
grpc_channel_credentials *creds) {
grpc_composite_channel_credentials *c =
(grpc_composite_channel_credentials *)creds;
return grpc_channel_credentials_ref(c->inner_creds);
}
static grpc_channel_credentials_vtable composite_channel_credentials_vtable = {
composite_channel_destruct, composite_channel_create_security_connector};
composite_channel_destruct, composite_channel_create_security_connector,
composite_channel_duplicate_without_call_credentials};
grpc_channel_credentials *grpc_composite_channel_credentials_create(
grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds,

@ -53,7 +53,7 @@ grpc_call_credentials *grpc_credentials_contains_type(
grpc_call_credentials *creds, const char *type,
grpc_call_credentials **composite_creds);
/* -- Channel composite credentials. -- */
/* -- Composite channel credentials. -- */
typedef struct {
grpc_channel_credentials base;
@ -61,7 +61,7 @@ typedef struct {
grpc_call_credentials *call_creds;
} grpc_composite_channel_credentials;
/* -- Composite credentials. -- */
/* -- Composite call credentials. -- */
typedef struct {
grpc_call_credentials base;

@ -138,6 +138,18 @@ grpc_security_status grpc_channel_credentials_create_security_connector(
channel_creds, NULL, target, args, sc, new_args);
}
grpc_channel_credentials *
grpc_channel_credentials_duplicate_without_call_credentials(
grpc_channel_credentials *channel_creds) {
if (channel_creds != NULL && channel_creds->vtable != NULL &&
channel_creds->vtable->duplicate_without_call_credentials != NULL) {
return channel_creds->vtable->duplicate_without_call_credentials(
channel_creds);
} else {
return grpc_channel_credentials_ref(channel_creds);
}
}
grpc_server_credentials *grpc_server_credentials_ref(
grpc_server_credentials *creds) {
if (creds == NULL) return NULL;

@ -107,6 +107,9 @@ typedef struct {
grpc_channel_credentials *c, grpc_call_credentials *call_creds,
const char *target, const grpc_channel_args *args,
grpc_channel_security_connector **sc, grpc_channel_args **new_args);
grpc_channel_credentials *(*duplicate_without_call_credentials)(
grpc_channel_credentials *c);
} grpc_channel_credentials_vtable;
struct grpc_channel_credentials {
@ -128,6 +131,13 @@ grpc_security_status grpc_channel_credentials_create_security_connector(
const grpc_channel_args *args, grpc_channel_security_connector **sc,
grpc_channel_args **new_args);
/* Creates a version of the channel credentials without any attached call
credentials. This can be used in order to open a channel to a non-trusted
gRPC load balancer. */
grpc_channel_credentials *
grpc_channel_credentials_duplicate_without_call_credentials(
grpc_channel_credentials *creds);
/* --- grpc_credentials_md. --- */
typedef struct {

@ -61,7 +61,7 @@ fake_transport_security_server_create_security_connector(
static grpc_channel_credentials_vtable
fake_transport_security_credentials_vtable = {
NULL, fake_transport_security_create_security_connector};
NULL, fake_transport_security_create_security_connector, NULL};
static grpc_server_credentials_vtable
fake_transport_security_server_credentials_vtable = {

@ -95,7 +95,7 @@ static grpc_security_status ssl_create_security_connector(
}
static grpc_channel_credentials_vtable ssl_vtable = {
ssl_destruct, ssl_create_security_connector};
ssl_destruct, ssl_create_security_connector, NULL};
static void ssl_build_config(const char *pem_root_certs,
grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,

@ -72,8 +72,9 @@ grpc_byte_buffer *grpc_raw_byte_buffer_from_reader(
grpc_byte_buffer *grpc_byte_buffer_copy(grpc_byte_buffer *bb) {
switch (bb->type) {
case GRPC_BB_RAW:
return grpc_raw_byte_buffer_create(bb->data.raw.slice_buffer.slices,
bb->data.raw.slice_buffer.count);
return grpc_raw_compressed_byte_buffer_create(
bb->data.raw.slice_buffer.slices, bb->data.raw.slice_buffer.count,
bb->data.raw.compression);
}
GPR_UNREACHABLE_CODE(return NULL);
}

@ -1103,8 +1103,8 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
}
}
static void process_data_after_md(grpc_exec_ctx *exec_ctx, batch_control *bctl,
bool success) {
static void process_data_after_md(grpc_exec_ctx *exec_ctx,
batch_control *bctl) {
grpc_call *call = bctl->call;
if (call->receiving_stream == NULL) {
*call->receiving_buffer = NULL;
@ -1124,8 +1124,6 @@ static void process_data_after_md(grpc_exec_ctx *exec_ctx, batch_control *bctl,
grpc_closure_init(&call->receiving_slice_ready, receiving_slice_ready,
bctl);
continue_receiving_slices(exec_ctx, bctl);
/* early out */
return;
}
}
@ -1133,12 +1131,17 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
grpc_error *error) {
batch_control *bctl = bctlp;
grpc_call *call = bctl->call;
if (error != GRPC_ERROR_NONE) {
grpc_status_code status;
const char *msg;
grpc_error_get_status(error, &status, &msg);
close_with_status(exec_ctx, call, status, msg);
}
gpr_mu_lock(&bctl->call->mu);
if (bctl->call->has_initial_md_been_received || error != GRPC_ERROR_NONE ||
call->receiving_stream == NULL) {
gpr_mu_unlock(&bctl->call->mu);
process_data_after_md(exec_ctx, bctlp, error);
process_data_after_md(exec_ctx, bctlp);
} else {
call->saved_receiving_stream_ready_bctlp = bctlp;
gpr_mu_unlock(&bctl->call->mu);

@ -3,10 +3,6 @@
This directory contains source code for C++ implementation of gRPC.
#Status
Beta
#Pre-requisites
##Linux

@ -59,7 +59,8 @@ static ClientContext::GlobalCallbacks* g_client_callbacks =
ClientContext::ClientContext()
: initial_metadata_received_(false),
fail_fast_(true),
wait_for_ready_(false),
wait_for_ready_explicitly_set_(false),
idempotent_(false),
cacheable_(false),
call_(nullptr),

@ -42,6 +42,7 @@
#include <vector>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/metadata_batch.h"
@ -54,11 +55,6 @@
/// "name-of-filter", GRPC_SERVER_CHANNEL, INT_MAX, nullptr);
/// \endcode
/// Forward declaration to avoid including the file
/// "src/core/lib/security/context/security_context.h"
struct grpc_client_security_context;
struct grpc_server_security_context;
namespace grpc {
/// A C++ wrapper for the \c grpc_metadata_batch struct.

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Math {
/// <summary>Holder for reflection information generated from math.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class MathReflection {
#region Descriptor
@ -46,30 +45,35 @@ namespace Math {
}
#region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class DivArgs : pb::IMessage<DivArgs> {
private static readonly pb::MessageParser<DivArgs> _parser = new pb::MessageParser<DivArgs>(() => new DivArgs());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DivArgs> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Math.MathReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivArgs() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivArgs(DivArgs other) : this() {
dividend_ = other.dividend_;
divisor_ = other.divisor_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivArgs Clone() {
return new DivArgs(this);
}
@ -77,6 +81,7 @@ namespace Math {
/// <summary>Field number for the "dividend" field.</summary>
public const int DividendFieldNumber = 1;
private long dividend_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Dividend {
get { return dividend_; }
set {
@ -87,6 +92,7 @@ namespace Math {
/// <summary>Field number for the "divisor" field.</summary>
public const int DivisorFieldNumber = 2;
private long divisor_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Divisor {
get { return divisor_; }
set {
@ -94,10 +100,12 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DivArgs);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DivArgs other) {
if (ReferenceEquals(other, null)) {
return false;
@ -110,6 +118,7 @@ namespace Math {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Dividend != 0L) hash ^= Dividend.GetHashCode();
@ -117,10 +126,12 @@ namespace Math {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Dividend != 0L) {
output.WriteRawTag(8);
@ -132,6 +143,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Dividend != 0L) {
@ -143,6 +155,7 @@ namespace Math {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DivArgs other) {
if (other == null) {
return;
@ -155,6 +168,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -176,30 +190,35 @@ namespace Math {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class DivReply : pb::IMessage<DivReply> {
private static readonly pb::MessageParser<DivReply> _parser = new pb::MessageParser<DivReply>(() => new DivReply());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DivReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Math.MathReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivReply() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivReply(DivReply other) : this() {
quotient_ = other.quotient_;
remainder_ = other.remainder_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DivReply Clone() {
return new DivReply(this);
}
@ -207,6 +226,7 @@ namespace Math {
/// <summary>Field number for the "quotient" field.</summary>
public const int QuotientFieldNumber = 1;
private long quotient_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Quotient {
get { return quotient_; }
set {
@ -217,6 +237,7 @@ namespace Math {
/// <summary>Field number for the "remainder" field.</summary>
public const int RemainderFieldNumber = 2;
private long remainder_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Remainder {
get { return remainder_; }
set {
@ -224,10 +245,12 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DivReply);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DivReply other) {
if (ReferenceEquals(other, null)) {
return false;
@ -240,6 +263,7 @@ namespace Math {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Quotient != 0L) hash ^= Quotient.GetHashCode();
@ -247,10 +271,12 @@ namespace Math {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Quotient != 0L) {
output.WriteRawTag(8);
@ -262,6 +288,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Quotient != 0L) {
@ -273,6 +300,7 @@ namespace Math {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DivReply other) {
if (other == null) {
return;
@ -285,6 +313,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -306,29 +335,34 @@ namespace Math {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class FibArgs : pb::IMessage<FibArgs> {
private static readonly pb::MessageParser<FibArgs> _parser = new pb::MessageParser<FibArgs>(() => new FibArgs());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FibArgs> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Math.MathReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibArgs() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibArgs(FibArgs other) : this() {
limit_ = other.limit_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibArgs Clone() {
return new FibArgs(this);
}
@ -336,6 +370,7 @@ namespace Math {
/// <summary>Field number for the "limit" field.</summary>
public const int LimitFieldNumber = 1;
private long limit_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Limit {
get { return limit_; }
set {
@ -343,10 +378,12 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FibArgs);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FibArgs other) {
if (ReferenceEquals(other, null)) {
return false;
@ -358,16 +395,19 @@ namespace Math {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Limit != 0L) hash ^= Limit.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Limit != 0L) {
output.WriteRawTag(8);
@ -375,6 +415,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Limit != 0L) {
@ -383,6 +424,7 @@ namespace Math {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FibArgs other) {
if (other == null) {
return;
@ -392,6 +434,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -409,29 +452,34 @@ namespace Math {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Num : pb::IMessage<Num> {
private static readonly pb::MessageParser<Num> _parser = new pb::MessageParser<Num>(() => new Num());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Num> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Math.MathReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Num() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Num(Num other) : this() {
num_ = other.num_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Num Clone() {
return new Num(this);
}
@ -439,6 +487,7 @@ namespace Math {
/// <summary>Field number for the "num" field.</summary>
public const int Num_FieldNumber = 1;
private long num_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Num_ {
get { return num_; }
set {
@ -446,10 +495,12 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Num);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Num other) {
if (ReferenceEquals(other, null)) {
return false;
@ -461,16 +512,19 @@ namespace Math {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Num_ != 0L) hash ^= Num_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Num_ != 0L) {
output.WriteRawTag(8);
@ -478,6 +532,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Num_ != 0L) {
@ -486,6 +541,7 @@ namespace Math {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Num other) {
if (other == null) {
return;
@ -495,6 +551,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -512,29 +569,34 @@ namespace Math {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class FibReply : pb::IMessage<FibReply> {
private static readonly pb::MessageParser<FibReply> _parser = new pb::MessageParser<FibReply>(() => new FibReply());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FibReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Math.MathReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibReply() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibReply(FibReply other) : this() {
count_ = other.count_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FibReply Clone() {
return new FibReply(this);
}
@ -542,6 +604,7 @@ namespace Math {
/// <summary>Field number for the "count" field.</summary>
public const int CountFieldNumber = 1;
private long count_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Count {
get { return count_; }
set {
@ -549,10 +612,12 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FibReply);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FibReply other) {
if (ReferenceEquals(other, null)) {
return false;
@ -564,16 +629,19 @@ namespace Math {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Count != 0L) hash ^= Count.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Count != 0L) {
output.WriteRawTag(8);
@ -581,6 +649,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Count != 0L) {
@ -589,6 +658,7 @@ namespace Math {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FibReply other) {
if (other == null) {
return;
@ -598,6 +668,7 @@ namespace Math {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {

@ -234,6 +234,7 @@ namespace Math {
{
return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override MathClient NewInstance(ClientBaseConfiguration configuration)
{
return new MathClient(configuration);

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Grpc.Health.V1 {
/// <summary>Holder for reflection information generated from health.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class HealthReflection {
#region Descriptor
@ -42,29 +41,34 @@ namespace Grpc.Health.V1 {
}
#region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HealthCheckRequest : pb::IMessage<HealthCheckRequest> {
private static readonly pb::MessageParser<HealthCheckRequest> _parser = new pb::MessageParser<HealthCheckRequest>(() => new HealthCheckRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HealthCheckRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HealthCheckRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HealthCheckRequest(HealthCheckRequest other) : this() {
service_ = other.service_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HealthCheckRequest Clone() {
return new HealthCheckRequest(this);
}
@ -72,6 +76,7 @@ namespace Grpc.Health.V1 {
/// <summary>Field number for the "service" field.</summary>
public const int ServiceFieldNumber = 1;
private string service_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Service {
get { return service_; }
set {
@ -79,10 +84,12 @@ namespace Grpc.Health.V1 {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as HealthCheckRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HealthCheckRequest other) {
if (ReferenceEquals(other, null)) {
return false;
@ -94,16 +101,19 @@ namespace Grpc.Health.V1 {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Service.Length != 0) hash ^= Service.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Service.Length != 0) {
output.WriteRawTag(10);
@ -111,6 +121,7 @@ namespace Grpc.Health.V1 {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Service.Length != 0) {
@ -119,6 +130,7 @@ namespace Grpc.Health.V1 {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HealthCheckRequest other) {
if (other == null) {
return;
@ -128,6 +140,7 @@ namespace Grpc.Health.V1 {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -145,29 +158,34 @@ namespace Grpc.Health.V1 {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HealthCheckResponse : pb::IMessage<HealthCheckResponse> {
private static readonly pb::MessageParser<HealthCheckResponse> _parser = new pb::MessageParser<HealthCheckResponse>(() => new HealthCheckResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HealthCheckResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HealthCheckResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HealthCheckResponse(HealthCheckResponse other) : this() {
status_ = other.status_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HealthCheckResponse Clone() {
return new HealthCheckResponse(this);
}
@ -175,6 +193,7 @@ namespace Grpc.Health.V1 {
/// <summary>Field number for the "status" field.</summary>
public const int StatusFieldNumber = 1;
private global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus status_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus Status {
get { return status_; }
set {
@ -182,10 +201,12 @@ namespace Grpc.Health.V1 {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as HealthCheckResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HealthCheckResponse other) {
if (ReferenceEquals(other, null)) {
return false;
@ -197,16 +218,19 @@ namespace Grpc.Health.V1 {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Status != 0) hash ^= Status.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Status != 0) {
output.WriteRawTag(8);
@ -214,6 +238,7 @@ namespace Grpc.Health.V1 {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Status != 0) {
@ -222,6 +247,7 @@ namespace Grpc.Health.V1 {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HealthCheckResponse other) {
if (other == null) {
return;
@ -231,6 +257,7 @@ namespace Grpc.Health.V1 {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -248,7 +275,7 @@ namespace Grpc.Health.V1 {
#region Nested types
/// <summary>Container for nested types declared in the HealthCheckResponse message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public enum ServingStatus {
[pbr::OriginalName("UNKNOWN")] Unknown = 0,

@ -107,6 +107,7 @@ namespace Grpc.Health.V1 {
{
return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override HealthClient NewInstance(ClientBaseConfiguration configuration)
{
return new HealthClient(configuration);

File diff suppressed because it is too large Load Diff

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Grpc.Testing {
/// <summary>Holder for reflection information generated from src/proto/grpc/testing/empty.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class EmptyReflection {
#region Descriptor
@ -44,36 +43,43 @@ namespace Grpc.Testing {
/// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
/// };
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Empty : pb::IMessage<Empty> {
private static readonly pb::MessageParser<Empty> _parser = new pb::MessageParser<Empty>(() => new Empty());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Empty> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.EmptyReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Empty() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Empty(Empty other) : this() {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Empty Clone() {
return new Empty(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Empty);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Empty other) {
if (ReferenceEquals(other, null)) {
return false;
@ -84,29 +90,35 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Empty other) {
if (other == null) {
return;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {

File diff suppressed because it is too large Load Diff

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Grpc.Testing {
/// <summary>Holder for reflection information generated from src/proto/grpc/testing/metrics.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class MetricsReflection {
#region Descriptor
@ -47,25 +46,29 @@ namespace Grpc.Testing {
/// <summary>
/// Reponse message containing the gauge name and value
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class GaugeResponse : pb::IMessage<GaugeResponse> {
private static readonly pb::MessageParser<GaugeResponse> _parser = new pb::MessageParser<GaugeResponse>(() => new GaugeResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GaugeResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.MetricsReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GaugeResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GaugeResponse(GaugeResponse other) : this() {
name_ = other.name_;
switch (other.ValueCase) {
@ -82,6 +85,7 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GaugeResponse Clone() {
return new GaugeResponse(this);
}
@ -89,6 +93,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
@ -98,6 +103,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "long_value" field.</summary>
public const int LongValueFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long LongValue {
get { return valueCase_ == ValueOneofCase.LongValue ? (long) value_ : 0L; }
set {
@ -108,6 +114,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "double_value" field.</summary>
public const int DoubleValueFieldNumber = 3;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double DoubleValue {
get { return valueCase_ == ValueOneofCase.DoubleValue ? (double) value_ : 0D; }
set {
@ -118,6 +125,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "string_value" field.</summary>
public const int StringValueFieldNumber = 4;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string StringValue {
get { return valueCase_ == ValueOneofCase.StringValue ? (string) value_ : ""; }
set {
@ -135,19 +143,23 @@ namespace Grpc.Testing {
StringValue = 4,
}
private ValueOneofCase valueCase_ = ValueOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueOneofCase ValueCase {
get { return valueCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearValue() {
valueCase_ = ValueOneofCase.None;
value_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GaugeResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GaugeResponse other) {
if (ReferenceEquals(other, null)) {
return false;
@ -163,6 +175,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
@ -173,10 +186,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
@ -196,6 +211,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
@ -213,6 +229,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GaugeResponse other) {
if (other == null) {
return;
@ -234,6 +251,7 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -266,29 +284,34 @@ namespace Grpc.Testing {
/// <summary>
/// Request message containing the gauge name
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class GaugeRequest : pb::IMessage<GaugeRequest> {
private static readonly pb::MessageParser<GaugeRequest> _parser = new pb::MessageParser<GaugeRequest>(() => new GaugeRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GaugeRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.MetricsReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GaugeRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GaugeRequest(GaugeRequest other) : this() {
name_ = other.name_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GaugeRequest Clone() {
return new GaugeRequest(this);
}
@ -296,6 +319,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
@ -303,10 +327,12 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GaugeRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GaugeRequest other) {
if (ReferenceEquals(other, null)) {
return false;
@ -318,16 +344,19 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
@ -335,6 +364,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
@ -343,6 +373,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GaugeRequest other) {
if (other == null) {
return;
@ -352,6 +383,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -369,36 +401,43 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class EmptyMessage : pb::IMessage<EmptyMessage> {
private static readonly pb::MessageParser<EmptyMessage> _parser = new pb::MessageParser<EmptyMessage>(() => new EmptyMessage());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<EmptyMessage> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.MetricsReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public EmptyMessage() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public EmptyMessage(EmptyMessage other) : this() {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public EmptyMessage Clone() {
return new EmptyMessage(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as EmptyMessage);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(EmptyMessage other) {
if (ReferenceEquals(other, null)) {
return false;
@ -409,29 +448,35 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(EmptyMessage other) {
if (other == null) {
return;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {

@ -161,6 +161,7 @@ namespace Grpc.Testing {
{
return CallInvoker.AsyncUnaryCall(__Method_GetGauge, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override MetricsServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new MetricsServiceClient(configuration);

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Grpc.Testing {
/// <summary>Holder for reflection information generated from src/proto/grpc/testing/payloads.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class PayloadsReflection {
#region Descriptor
@ -45,30 +44,35 @@ namespace Grpc.Testing {
}
#region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ByteBufferParams : pb::IMessage<ByteBufferParams> {
private static readonly pb::MessageParser<ByteBufferParams> _parser = new pb::MessageParser<ByteBufferParams>(() => new ByteBufferParams());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ByteBufferParams> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ByteBufferParams() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ByteBufferParams(ByteBufferParams other) : this() {
reqSize_ = other.reqSize_;
respSize_ = other.respSize_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ByteBufferParams Clone() {
return new ByteBufferParams(this);
}
@ -76,6 +80,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "req_size" field.</summary>
public const int ReqSizeFieldNumber = 1;
private int reqSize_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ReqSize {
get { return reqSize_; }
set {
@ -86,6 +91,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "resp_size" field.</summary>
public const int RespSizeFieldNumber = 2;
private int respSize_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int RespSize {
get { return respSize_; }
set {
@ -93,10 +99,12 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ByteBufferParams);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ByteBufferParams other) {
if (ReferenceEquals(other, null)) {
return false;
@ -109,6 +117,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ReqSize != 0) hash ^= ReqSize.GetHashCode();
@ -116,10 +125,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ReqSize != 0) {
output.WriteRawTag(8);
@ -131,6 +142,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ReqSize != 0) {
@ -142,6 +154,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ByteBufferParams other) {
if (other == null) {
return;
@ -154,6 +167,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -175,30 +189,35 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class SimpleProtoParams : pb::IMessage<SimpleProtoParams> {
private static readonly pb::MessageParser<SimpleProtoParams> _parser = new pb::MessageParser<SimpleProtoParams>(() => new SimpleProtoParams());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SimpleProtoParams> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SimpleProtoParams() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SimpleProtoParams(SimpleProtoParams other) : this() {
reqSize_ = other.reqSize_;
respSize_ = other.respSize_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SimpleProtoParams Clone() {
return new SimpleProtoParams(this);
}
@ -206,6 +225,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "req_size" field.</summary>
public const int ReqSizeFieldNumber = 1;
private int reqSize_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ReqSize {
get { return reqSize_; }
set {
@ -216,6 +236,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "resp_size" field.</summary>
public const int RespSizeFieldNumber = 2;
private int respSize_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int RespSize {
get { return respSize_; }
set {
@ -223,10 +244,12 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SimpleProtoParams);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SimpleProtoParams other) {
if (ReferenceEquals(other, null)) {
return false;
@ -239,6 +262,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ReqSize != 0) hash ^= ReqSize.GetHashCode();
@ -246,10 +270,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ReqSize != 0) {
output.WriteRawTag(8);
@ -261,6 +287,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ReqSize != 0) {
@ -272,6 +299,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SimpleProtoParams other) {
if (other == null) {
return;
@ -284,6 +312,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -309,36 +338,43 @@ namespace Grpc.Testing {
/// TODO (vpai): Fill this in once the details of complex, representative
/// protos are decided
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ComplexProtoParams : pb::IMessage<ComplexProtoParams> {
private static readonly pb::MessageParser<ComplexProtoParams> _parser = new pb::MessageParser<ComplexProtoParams>(() => new ComplexProtoParams());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ComplexProtoParams> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ComplexProtoParams() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ComplexProtoParams(ComplexProtoParams other) : this() {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ComplexProtoParams Clone() {
return new ComplexProtoParams(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ComplexProtoParams);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ComplexProtoParams other) {
if (ReferenceEquals(other, null)) {
return false;
@ -349,29 +385,35 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ComplexProtoParams other) {
if (other == null) {
return;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -385,25 +427,29 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class PayloadConfig : pb::IMessage<PayloadConfig> {
private static readonly pb::MessageParser<PayloadConfig> _parser = new pb::MessageParser<PayloadConfig>(() => new PayloadConfig());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<PayloadConfig> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PayloadConfig() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PayloadConfig(PayloadConfig other) : this() {
switch (other.PayloadCase) {
case PayloadOneofCase.BytebufParams:
@ -419,12 +465,14 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PayloadConfig Clone() {
return new PayloadConfig(this);
}
/// <summary>Field number for the "bytebuf_params" field.</summary>
public const int BytebufParamsFieldNumber = 1;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.ByteBufferParams BytebufParams {
get { return payloadCase_ == PayloadOneofCase.BytebufParams ? (global::Grpc.Testing.ByteBufferParams) payload_ : null; }
set {
@ -435,6 +483,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "simple_params" field.</summary>
public const int SimpleParamsFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.SimpleProtoParams SimpleParams {
get { return payloadCase_ == PayloadOneofCase.SimpleParams ? (global::Grpc.Testing.SimpleProtoParams) payload_ : null; }
set {
@ -445,6 +494,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "complex_params" field.</summary>
public const int ComplexParamsFieldNumber = 3;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.ComplexProtoParams ComplexParams {
get { return payloadCase_ == PayloadOneofCase.ComplexParams ? (global::Grpc.Testing.ComplexProtoParams) payload_ : null; }
set {
@ -462,19 +512,23 @@ namespace Grpc.Testing {
ComplexParams = 3,
}
private PayloadOneofCase payloadCase_ = PayloadOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PayloadOneofCase PayloadCase {
get { return payloadCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearPayload() {
payloadCase_ = PayloadOneofCase.None;
payload_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as PayloadConfig);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(PayloadConfig other) {
if (ReferenceEquals(other, null)) {
return false;
@ -489,6 +543,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (payloadCase_ == PayloadOneofCase.BytebufParams) hash ^= BytebufParams.GetHashCode();
@ -498,10 +553,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (payloadCase_ == PayloadOneofCase.BytebufParams) {
output.WriteRawTag(10);
@ -517,6 +574,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (payloadCase_ == PayloadOneofCase.BytebufParams) {
@ -531,6 +589,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(PayloadConfig other) {
if (other == null) {
return;
@ -549,6 +608,7 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Grpc.Testing {
/// <summary>Holder for reflection information generated from src/proto/grpc/testing/services.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class ServicesReflection {
#region Descriptor

@ -161,6 +161,7 @@ namespace Grpc.Testing {
{
return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new BenchmarkServiceClient(configuration);
@ -396,6 +397,7 @@ namespace Grpc.Testing {
{
return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new WorkerServiceClient(configuration);

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Grpc.Testing {
/// <summary>Holder for reflection information generated from src/proto/grpc/testing/stats.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class StatsReflection {
#region Descriptor
@ -46,31 +45,36 @@ namespace Grpc.Testing {
}
#region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ServerStats : pb::IMessage<ServerStats> {
private static readonly pb::MessageParser<ServerStats> _parser = new pb::MessageParser<ServerStats>(() => new ServerStats());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ServerStats> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServerStats() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServerStats(ServerStats other) : this() {
timeElapsed_ = other.timeElapsed_;
timeUser_ = other.timeUser_;
timeSystem_ = other.timeSystem_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServerStats Clone() {
return new ServerStats(this);
}
@ -81,6 +85,7 @@ namespace Grpc.Testing {
/// <summary>
/// wall clock time change in seconds since last reset
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double TimeElapsed {
get { return timeElapsed_; }
set {
@ -94,6 +99,7 @@ namespace Grpc.Testing {
/// <summary>
/// change in user time (in seconds) used by the server since last reset
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double TimeUser {
get { return timeUser_; }
set {
@ -108,6 +114,7 @@ namespace Grpc.Testing {
/// change in server time (in seconds) used by the server process and all
/// threads since last reset
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double TimeSystem {
get { return timeSystem_; }
set {
@ -115,10 +122,12 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ServerStats);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ServerStats other) {
if (ReferenceEquals(other, null)) {
return false;
@ -132,6 +141,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (TimeElapsed != 0D) hash ^= TimeElapsed.GetHashCode();
@ -140,10 +150,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (TimeElapsed != 0D) {
output.WriteRawTag(9);
@ -159,6 +171,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (TimeElapsed != 0D) {
@ -173,6 +186,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ServerStats other) {
if (other == null) {
return;
@ -188,6 +202,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -216,30 +231,35 @@ namespace Grpc.Testing {
/// <summary>
/// Histogram params based on grpc/support/histogram.c
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HistogramParams : pb::IMessage<HistogramParams> {
private static readonly pb::MessageParser<HistogramParams> _parser = new pb::MessageParser<HistogramParams>(() => new HistogramParams());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HistogramParams> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HistogramParams() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HistogramParams(HistogramParams other) : this() {
resolution_ = other.resolution_;
maxPossible_ = other.maxPossible_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HistogramParams Clone() {
return new HistogramParams(this);
}
@ -250,6 +270,7 @@ namespace Grpc.Testing {
/// <summary>
/// first bucket is [0, 1 + resolution)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double Resolution {
get { return resolution_; }
set {
@ -263,6 +284,7 @@ namespace Grpc.Testing {
/// <summary>
/// use enough buckets to allow this value
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double MaxPossible {
get { return maxPossible_; }
set {
@ -270,10 +292,12 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as HistogramParams);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HistogramParams other) {
if (ReferenceEquals(other, null)) {
return false;
@ -286,6 +310,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Resolution != 0D) hash ^= Resolution.GetHashCode();
@ -293,10 +318,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Resolution != 0D) {
output.WriteRawTag(9);
@ -308,6 +335,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Resolution != 0D) {
@ -319,6 +347,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HistogramParams other) {
if (other == null) {
return;
@ -331,6 +360,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -355,25 +385,29 @@ namespace Grpc.Testing {
/// <summary>
/// Histogram data based on grpc/support/histogram.c
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HistogramData : pb::IMessage<HistogramData> {
private static readonly pb::MessageParser<HistogramData> _parser = new pb::MessageParser<HistogramData>(() => new HistogramData());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HistogramData> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HistogramData() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HistogramData(HistogramData other) : this() {
bucket_ = other.bucket_.Clone();
minSeen_ = other.minSeen_;
@ -383,6 +417,7 @@ namespace Grpc.Testing {
count_ = other.count_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HistogramData Clone() {
return new HistogramData(this);
}
@ -392,6 +427,7 @@ namespace Grpc.Testing {
private static readonly pb::FieldCodec<uint> _repeated_bucket_codec
= pb::FieldCodec.ForUInt32(10);
private readonly pbc::RepeatedField<uint> bucket_ = new pbc::RepeatedField<uint>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<uint> Bucket {
get { return bucket_; }
}
@ -399,6 +435,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "min_seen" field.</summary>
public const int MinSeenFieldNumber = 2;
private double minSeen_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double MinSeen {
get { return minSeen_; }
set {
@ -409,6 +446,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "max_seen" field.</summary>
public const int MaxSeenFieldNumber = 3;
private double maxSeen_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double MaxSeen {
get { return maxSeen_; }
set {
@ -419,6 +457,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "sum" field.</summary>
public const int SumFieldNumber = 4;
private double sum_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double Sum {
get { return sum_; }
set {
@ -429,6 +468,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "sum_of_squares" field.</summary>
public const int SumOfSquaresFieldNumber = 5;
private double sumOfSquares_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double SumOfSquares {
get { return sumOfSquares_; }
set {
@ -439,6 +479,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "count" field.</summary>
public const int CountFieldNumber = 6;
private double count_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double Count {
get { return count_; }
set {
@ -446,10 +487,12 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as HistogramData);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HistogramData other) {
if (ReferenceEquals(other, null)) {
return false;
@ -466,6 +509,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= bucket_.GetHashCode();
@ -477,10 +521,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
bucket_.WriteTo(output, _repeated_bucket_codec);
if (MinSeen != 0D) {
@ -505,6 +551,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += bucket_.CalculateSize(_repeated_bucket_codec);
@ -526,6 +573,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HistogramData other) {
if (other == null) {
return;
@ -548,6 +596,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
@ -586,25 +635,29 @@ namespace Grpc.Testing {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ClientStats : pb::IMessage<ClientStats> {
private static readonly pb::MessageParser<ClientStats> _parser = new pb::MessageParser<ClientStats>(() => new ClientStats());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ClientStats> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClientStats() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClientStats(ClientStats other) : this() {
Latencies = other.latencies_ != null ? other.Latencies.Clone() : null;
timeElapsed_ = other.timeElapsed_;
@ -612,6 +665,7 @@ namespace Grpc.Testing {
timeSystem_ = other.timeSystem_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ClientStats Clone() {
return new ClientStats(this);
}
@ -622,6 +676,7 @@ namespace Grpc.Testing {
/// <summary>
/// Latency histogram. Data points are in nanoseconds.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.HistogramData Latencies {
get { return latencies_; }
set {
@ -635,6 +690,7 @@ namespace Grpc.Testing {
/// <summary>
/// See ServerStats for details.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double TimeElapsed {
get { return timeElapsed_; }
set {
@ -645,6 +701,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "time_user" field.</summary>
public const int TimeUserFieldNumber = 3;
private double timeUser_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double TimeUser {
get { return timeUser_; }
set {
@ -655,6 +712,7 @@ namespace Grpc.Testing {
/// <summary>Field number for the "time_system" field.</summary>
public const int TimeSystemFieldNumber = 4;
private double timeSystem_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double TimeSystem {
get { return timeSystem_; }
set {
@ -662,10 +720,12 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ClientStats);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ClientStats other) {
if (ReferenceEquals(other, null)) {
return false;
@ -680,6 +740,7 @@ namespace Grpc.Testing {
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (latencies_ != null) hash ^= Latencies.GetHashCode();
@ -689,10 +750,12 @@ namespace Grpc.Testing {
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (latencies_ != null) {
output.WriteRawTag(10);
@ -712,6 +775,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (latencies_ != null) {
@ -729,6 +793,7 @@ namespace Grpc.Testing {
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ClientStats other) {
if (other == null) {
return;
@ -750,6 +815,7 @@ namespace Grpc.Testing {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Grpc.Testing {
/// <summary>Holder for reflection information generated from src/proto/grpc/testing/test.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class TestReflection {
#region Descriptor

@ -314,6 +314,7 @@ namespace Grpc.Testing {
{
return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new TestServiceClient(configuration);
@ -420,6 +421,7 @@ namespace Grpc.Testing {
{
return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override UnimplementedServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new UnimplementedServiceClient(configuration);
@ -535,6 +537,7 @@ namespace Grpc.Testing {
{
return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override ReconnectServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new ReconnectServiceClient(configuration);

@ -17,17 +17,17 @@
</metadata>
<files>
<!-- forward slashes in src path enable building on Linux -->
<file src="protoc_plugins/windows_x86/protoc.exe" target="tools\windows_x86\protoc.exe" />
<file src="protoc_plugins/windows_x86/grpc_csharp_plugin.exe" target="tools\windows_x86\grpc_csharp_plugin.exe" />
<file src="protoc_plugins/windows_x64/protoc.exe" target="tools\windows_x64\protoc.exe" />
<file src="protoc_plugins/windows_x64/grpc_csharp_plugin.exe" target="tools\windows_x64\grpc_csharp_plugin.exe" />
<file src="protoc_plugins/linux_x86/protoc" target="tools\linux_x86\protoc" />
<file src="protoc_plugins/linux_x86/grpc_csharp_plugin" target="tools\linux_x86\grpc_csharp_plugin" />
<file src="protoc_plugins/linux_x64/protoc" target="tools\linux_x64\protoc" />
<file src="protoc_plugins/linux_x64/grpc_csharp_plugin" target="tools\linux_x64\grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x86/protoc" target="tools\macosx_x86\protoc" />
<file src="protoc_plugins/macosx_x86/grpc_csharp_plugin" target="tools\macosx_x86\grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x64/protoc" target="tools\macosx_x64\protoc" />
<file src="protoc_plugins/macosx_x64/grpc_csharp_plugin" target="tools\macosx_x64\grpc_csharp_plugin" />
<file src="protoc_plugins/windows_x86/protoc.exe" target="tools/windows_x86/protoc.exe" />
<file src="protoc_plugins/windows_x86/grpc_csharp_plugin.exe" target="tools/windows_x86/grpc_csharp_plugin.exe" />
<file src="protoc_plugins/windows_x64/protoc.exe" target="tools/windows_x64/protoc.exe" />
<file src="protoc_plugins/windows_x64/grpc_csharp_plugin.exe" target="tools/windows_x64/grpc_csharp_plugin.exe" />
<file src="protoc_plugins/linux_x86/protoc" target="tools/linux_x86/protoc" />
<file src="protoc_plugins/linux_x86/grpc_csharp_plugin" target="tools/linux_x86/grpc_csharp_plugin" />
<file src="protoc_plugins/linux_x64/protoc" target="tools/linux_x64/protoc" />
<file src="protoc_plugins/linux_x64/grpc_csharp_plugin" target="tools/linux_x64/grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x86/protoc" target="tools/macosx_x86/protoc" />
<file src="protoc_plugins/macosx_x86/grpc_csharp_plugin" target="tools/macosx_x86/grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x64/protoc" target="tools/macosx_x64/protoc" />
<file src="protoc_plugins/macosx_x64/grpc_csharp_plugin" target="tools/macosx_x64/grpc_csharp_plugin" />
</files>
</package>

@ -4,10 +4,13 @@ gRPC C#
A C# implementation of gRPC.
Status
------
SUPPORTED PLATFORMS
------------------
- .NET Framework 4.5+ (Windows)
- [.NET Core](https://dotnet.github.io/) on Linux, Windows and Mac OS X (starting from version 1.0.1)
- Mono 4+ on Linux, Windows and Mac OS X
Beta
PREREQUISITES
--------------
@ -16,6 +19,7 @@ PREREQUISITES
- Linux: Mono 4+, MonoDevelop 5.9+ (with NuGet add-in installed)
- Mac OS X: Xamarin Studio 5.9+
HOW TO USE
--------------
@ -69,12 +73,6 @@ different languages.
tools/run_tests/run_tests.py -l csharp
```
ON .NET CORE SUPPORT
------------------
We are committed to providing full support for [.NET Core](https://dotnet.github.io/) in near future,
but currently, the support is for .NET Core is experimental/work-in-progress.
DOCUMENTATION
-------------
- [API Reference][]
@ -102,9 +100,7 @@ CONTENTS
THE NATIVE DEPENDENCY
---------------
Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. `grpc_csharp_ext` library is a native extension library that facilitates this by wrapping some C core API into a form that's more digestible for P/Invoke.
Prior to version 0.13, installing `grpc_csharp_ext` was required to make gRPC work on Linux and MacOS. Starting with version 0.13, we have improved the packaging story significantly and precompiled versions of the native library for all supported platforms are now shipped with the NuGet package. Just installing the `Grpc` NuGet package should be the only step needed to use gRPC C#, regardless of your platform (Windows, Linux or Mac) and the bitness (32 or 64bit).
Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. The fact that a native library is used should be fully transparent to the users and just installing the `Grpc.Core` NuGet package is the only step needed to use gRPC C# on all supported platforms.
[API Reference]: http://www.grpc.io/grpc/csharp/
[Helloworld Example]: ../../examples/csharp/helloworld

@ -1,9 +1,6 @@
[![npm](https://img.shields.io/npm/v/grpc.svg)](https://www.npmjs.com/package/grpc)
# Node.js gRPC Library
## Status
Beta
## PREREQUISITES
- `node`: This requires `node` to be installed, version `0.12` or above. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package.

@ -154,6 +154,18 @@ typedef NS_ENUM(NSUInteger, GRPCErrorCode) {
GRPCErrorCodeDataLoss = 15,
};
/**
* Safety remark of a gRPC method as defined in RFC 2616 Section 9.1
*/
typedef NS_ENUM(NSUInteger, GRPCCallSafety) {
/** Signal that there is no guarantees on how the call affects the server state. */
GRPCCallSafetyDefault = 0,
/** Signal that the call is idempotent. gRPC is free to use PUT verb. */
GRPCCallSafetyIdempotentRequest = 1,
/** Signal that the call is cacheable and will not affect server state. gRPC is free to use GET verb. */
GRPCCallSafetyCacheableRequest = 2,
};
/**
* Keys used in |NSError|'s |userInfo| dictionary to store the response headers and trailers sent by
* the server.
@ -233,6 +245,14 @@ extern id const kGRPCTrailersKey;
*/
- (void)cancel;
/**
* Set the call flag for a specific host path.
*
* Host parameter should not contain the scheme (http:// or https://), only the name or IP addr
* and the port number, for example @"localhost:5050".
*/
+ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path;
// TODO(jcanizales): Let specify a deadline. As a category of GRXWriter?
@end

@ -47,6 +47,7 @@
NSString * const kGRPCHeadersKey = @"io.grpc.HeadersKey";
NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey";
static NSMutableDictionary *callFlags;
@interface GRPCCall () <GRXWriteable>
// Make them read-write.
@ -106,6 +107,29 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey";
// TODO(jcanizales): If grpc_init is idempotent, this should be changed from load to initialize.
+ (void)load {
grpc_init();
callFlags = [NSMutableDictionary dictionary];
}
+ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path {
NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path];
switch (callSafety) {
case GRPCCallSafetyDefault:
callFlags[hostAndPath] = @0;
break;
case GRPCCallSafetyIdempotentRequest:
callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
break;
case GRPCCallSafetyCacheableRequest:
callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
break;
default:
break;
}
}
+ (uint32_t)callFlagsForHost:(NSString *)host path:(NSString *)path {
NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path];
return [callFlags[hostAndPath] intValue];
}
- (instancetype)init {
@ -231,6 +255,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey";
- (void)sendHeaders:(NSDictionary *)headers {
// TODO(jcanizales): Add error handlers for async failures
[_wrappedCall startBatchWithOperations:@[[[GRPCOpSendMetadata alloc] initWithMetadata:headers
flags:[GRPCCall callFlagsForHost:_host path:_path]
handler:nil]]];
}

@ -45,6 +45,10 @@
@interface GRPCOpSendMetadata : GRPCOperation
- (instancetype)initWithMetadata:(NSDictionary *)metadata
handler:(void(^)())handler;
- (instancetype)initWithMetadata:(NSDictionary *)metadata
flags:(uint32_t)flags
handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
@end

@ -64,16 +64,24 @@
@implementation GRPCOpSendMetadata
- (instancetype)init {
return [self initWithMetadata:nil handler:nil];
return [self initWithMetadata:nil flags:0 handler:nil];
}
- (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void (^)())handler {
- (instancetype)initWithMetadata:(NSDictionary *)metadata
handler:(void (^)())handler {
return [self initWithMetadata:metadata flags:0 handler:handler];
}
- (instancetype)initWithMetadata:(NSDictionary *)metadata
flags:(uint32_t)flags
handler:(void (^)())handler {
if (self = [super init]) {
_op.op = GRPC_OP_SEND_INITIAL_METADATA;
_op.data.send_initial_metadata.count = metadata.count;
_op.data.send_initial_metadata.metadata = metadata.grpc_metadataArray;
_op.data.send_initial_metadata.maybe_compression_level.is_set = false;
_op.data.send_initial_metadata.maybe_compression_level.level = 0;
_op.flags = flags;
_handler = handler;
}
return self;

@ -317,4 +317,37 @@ static GRPCProtoMethod *kUnaryCallMethod;
}
- (void)testIdempotentProtoRPC {
__weak XCTestExpectation *response = [self expectationWithDescription:@"Expected response."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."];
RMTSimpleRequest *request = [RMTSimpleRequest message];
request.responseSize = 100;
request.fillUsername = YES;
request.fillOauthScope = YES;
GRXWriter *requestsWriter = [GRXWriter writerWithValue:[request data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress
path:kUnaryCallMethod.HTTPPath
requestsWriter:requestsWriter];
[GRPCCall setCallSafety:GRPCCallSafetyIdempotentRequest host:kHostAddress path:kUnaryCallMethod.HTTPPath];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
XCTAssertNotNil(value, @"nil value received as response.");
XCTAssertGreaterThan(value.length, 0, @"Empty response received.");
RMTSimpleResponse *responseProto = [RMTSimpleResponse parseFromData:value error:NULL];
// We expect empty strings, not nil:
XCTAssertNotNil(responseProto.username, @"Response's username is nil.");
XCTAssertNotNil(responseProto.oauthScope, @"Response's OAuth scope is nil.");
[response fulfill];
} completionHandler:^(NSError *errorOrNil) {
XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil);
[completion fulfill];
}];
[call startWithWriteable:responsesWriteable];
[self waitForExpectationsWithTimeout:8 handler:nil];
}
@end

@ -4,10 +4,6 @@
This directory contains source code for PHP implementation of gRPC layered on
shared C library.
#Status
GA
## Environment
**Prerequisite:**

@ -8,6 +8,7 @@
"version": "1.1.0",
"require": {
"php": ">=5.5.0",
"ext-grpc": "*",
"google/protobuf": "v3.1.0-alpha-1"
},
"require-dev": {

@ -47,6 +47,11 @@ service TestService {
// One request followed by one response.
rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
// One request followed by one response. Response has cache control
// headers set such that a caching HTTP proxy (such as GFE) can
// satisfy subsequent requests.
rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse);
// One request followed by a sequence of responses (streamed download).
// The server returns the payload with client desired type and sizes.
rpc StreamingOutputCall(StreamingOutputCallRequest)

@ -462,7 +462,6 @@ def _unary_response_in_pool(
rpc_event, state, response, response_serializer)
if serialized_response is not None:
_status(rpc_event, state, serialized_response)
return
def _stream_response_in_pool(

@ -4,11 +4,6 @@ gRPC Ruby
A Ruby implementation of gRPC.
Status
------
Beta
PREREQUISITES
-------------
@ -73,5 +68,5 @@ Directory structure is the layout for [ruby extensions][]
[ruby extensions]:http://guides.rubygems.org/gems-with-extensions/
[rubydoc]: http://www.rubydoc.info/gems/grpc
[grpc.io]: http://www.grpc.io/docs/installation/ruby.html
[grpc.io]: http://www.grpc.io/docs/quickstart/ruby.html
[Debian jessie-backports]:http://backports.debian.org/Instructions/

@ -9,6 +9,7 @@
"license": "BSD-3-Clause",
"require": {
"php": ">=5.5.0",
"ext-grpc": "*",
"google/protobuf": "v3.1.0-alpha-1"
},
"require-dev": {

@ -10,6 +10,7 @@
"version": "${settings.php_version.php_composer()}",
"require": {
"php": ">=5.5.0",
"ext-grpc": "*",
"google/protobuf": "v3.1.0-alpha-1"
},
"require-dev": {

@ -41,6 +41,12 @@
g++-4.4 ${'\\'}
g++-4.4-multilib
# set up backport to allow installation of Git version > 1.7
RUN echo "deb http://http.debian.net/debian wheezy-backports main" \
>/etc/apt/sources.list.d/wheezy-backports.list
RUN apt-get update -qq
RUN apt-get -t wheezy-backports install -qq git
RUN wget ${openssl_fallback.base_uri + openssl_fallback.tarball}
ENV POST_GIT_STEP tools/dockerfile/test/cxx_wheezy_x64/post-git-setup.sh

@ -88,7 +88,7 @@ static void run_test(const char *target, size_t nops) {
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY;
op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;

@ -48,6 +48,7 @@
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/fake_resolver.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@ -508,7 +509,7 @@ void run_spec(const test_spec *spec) {
/* Create client. */
servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports,
f->num_servers, ",", NULL);
gpr_asprintf(&client_hostport, "ipv4:%s?lb_policy=round_robin",
gpr_asprintf(&client_hostport, "test:%s?lb_policy=round_robin",
servers_hostports_str);
arg.type = GRPC_ARG_INTEGER;
@ -544,7 +545,7 @@ static grpc_channel *create_client(const servers_fixture *f) {
servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports,
f->num_servers, ",", NULL);
gpr_asprintf(&client_hostport, "ipv4:%s?lb_policy=round_robin",
gpr_asprintf(&client_hostport, "test:%s?lb_policy=round_robin",
servers_hostports_str);
arg.type = GRPC_ARG_INTEGER;
@ -874,6 +875,7 @@ int main(int argc, char **argv) {
const size_t NUM_SERVERS = 4;
grpc_test_init(argc, argv);
grpc_fake_resolver_init();
grpc_init();
grpc_tracer_set_enabled("round_robin", 1);

@ -44,7 +44,7 @@
static void *tag(intptr_t i) { return (void *)i; }
static void run_test(bool fail_fast) {
static void run_test(bool wait_for_ready) {
grpc_channel *chan;
grpc_call *call;
gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2);
@ -57,7 +57,7 @@ static void run_test(bool fail_fast) {
char *details = NULL;
size_t details_capacity = 0;
gpr_log(GPR_INFO, "TEST: fail_fast=%d", fail_fast);
gpr_log(GPR_INFO, "TEST: wait_for_ready=%d", wait_for_ready);
grpc_init();
@ -81,7 +81,7 @@ static void run_test(bool fail_fast) {
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = fail_fast ? 0 : GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY;
op->flags = wait_for_ready ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
@ -98,10 +98,10 @@ static void run_test(bool fail_fast) {
CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
cq_verify(cqv);
if (fail_fast) {
GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
} else {
if (wait_for_ready) {
GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
} else {
GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
}
grpc_completion_queue_shutdown(cq);
@ -122,7 +122,7 @@ static void run_test(bool fail_fast) {
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
run_test(true);
run_test(false);
run_test(true);
return 0;
}

@ -171,7 +171,7 @@ void test_connect(const char *server_host, const char *client_host, int port,
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = expect_ok ? GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY : 0;
op->flags = expect_ok ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;

@ -0,0 +1,212 @@
//
// Copyright 2016, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is similar to the sockaddr resolver, except that it supports a
// bunch of query args that are useful for dependency injection in tests.
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/client_config/parse_address.h"
#include "src/core/ext/client_config/resolver_registry.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/support/string.h"
//
// fake_resolver
//
typedef struct {
// base class -- must be first
grpc_resolver base;
// passed-in parameters
char* target_name; // the path component of the uri passed in
grpc_lb_addresses* addresses;
char* lb_policy_name;
// mutex guarding the rest of the state
gpr_mu mu;
// have we published?
bool published;
// pending next completion, or NULL
grpc_closure* next_completion;
// target result address for next completion
grpc_resolver_result** target_result;
} fake_resolver;
static void fake_resolver_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* gr) {
fake_resolver* r = (fake_resolver*)gr;
gpr_mu_destroy(&r->mu);
gpr_free(r->target_name);
grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */);
gpr_free(r->lb_policy_name);
gpr_free(r);
}
static void fake_resolver_shutdown(grpc_exec_ctx* exec_ctx,
grpc_resolver* resolver) {
fake_resolver* r = (fake_resolver*)resolver;
gpr_mu_lock(&r->mu);
if (r->next_completion != NULL) {
*r->target_result = NULL;
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL;
}
gpr_mu_unlock(&r->mu);
}
static void fake_resolver_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx,
fake_resolver* r) {
if (r->next_completion != NULL && !r->published) {
r->published = true;
*r->target_result = grpc_resolver_result_create(
r->target_name,
grpc_lb_addresses_copy(r->addresses, NULL /* user_data_copy */),
r->lb_policy_name, NULL /* lb_policy_args */);
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL;
}
}
static void fake_resolver_channel_saw_error(grpc_exec_ctx* exec_ctx,
grpc_resolver* resolver) {
fake_resolver* r = (fake_resolver*)resolver;
gpr_mu_lock(&r->mu);
r->published = false;
fake_resolver_maybe_finish_next_locked(exec_ctx, r);
gpr_mu_unlock(&r->mu);
}
static void fake_resolver_next(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver,
grpc_resolver_result** target_result,
grpc_closure* on_complete) {
fake_resolver* r = (fake_resolver*)resolver;
gpr_mu_lock(&r->mu);
GPR_ASSERT(!r->next_completion);
r->next_completion = on_complete;
r->target_result = target_result;
fake_resolver_maybe_finish_next_locked(exec_ctx, r);
gpr_mu_unlock(&r->mu);
}
static const grpc_resolver_vtable fake_resolver_vtable = {
fake_resolver_destroy, fake_resolver_shutdown,
fake_resolver_channel_saw_error, fake_resolver_next};
//
// fake_resolver_factory
//
static void fake_resolver_factory_ref(grpc_resolver_factory* factory) {}
static void fake_resolver_factory_unref(grpc_resolver_factory* factory) {}
static void do_nothing(void* ignored) {}
static grpc_resolver* fake_resolver_create(grpc_resolver_factory* factory,
grpc_resolver_args* args) {
if (0 != strcmp(args->uri->authority, "")) {
gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme",
args->uri->scheme);
return NULL;
}
// Get lb_enabled arg. Anything other than "0" is interpreted as true.
const char* lb_enabled_qpart =
grpc_uri_get_query_arg(args->uri, "lb_enabled");
const bool lb_enabled =
lb_enabled_qpart != NULL && strcmp("0", lb_enabled_qpart) != 0;
// Construct addresses.
gpr_slice path_slice =
gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing);
gpr_slice_buffer path_parts;
gpr_slice_buffer_init(&path_parts);
gpr_slice_split(path_slice, ",", &path_parts);
grpc_lb_addresses* addresses = grpc_lb_addresses_create(path_parts.count);
bool errors_found = false;
for (size_t i = 0; i < addresses->num_addresses; i++) {
grpc_uri ith_uri = *args->uri;
char* part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII);
ith_uri.path = part_str;
if (!parse_ipv4(
&ith_uri,
(struct sockaddr_storage*)(&addresses->addresses[i].address.addr),
&addresses->addresses[i].address.len)) {
errors_found = true;
}
gpr_free(part_str);
addresses->addresses[i].is_balancer = lb_enabled;
if (errors_found) break;
}
gpr_slice_buffer_destroy(&path_parts);
gpr_slice_unref(path_slice);
if (errors_found) {
grpc_lb_addresses_destroy(addresses, NULL /* user_data_destroy */);
return NULL;
}
// Instantiate resolver.
fake_resolver* r = gpr_malloc(sizeof(fake_resolver));
memset(r, 0, sizeof(*r));
r->target_name = gpr_strdup(args->uri->path);
r->addresses = addresses;
r->lb_policy_name =
gpr_strdup(grpc_uri_get_query_arg(args->uri, "lb_policy"));
gpr_mu_init(&r->mu);
grpc_resolver_init(&r->base, &fake_resolver_vtable);
return &r->base;
}
static char* fake_resolver_get_default_authority(grpc_resolver_factory* factory,
grpc_uri* uri) {
const char* path = uri->path;
if (path[0] == '/') ++path;
return gpr_strdup(path);
}
static const grpc_resolver_factory_vtable fake_resolver_factory_vtable = {
fake_resolver_factory_ref, fake_resolver_factory_unref,
fake_resolver_create, fake_resolver_get_default_authority, "test"};
static grpc_resolver_factory fake_resolver_factory = {
&fake_resolver_factory_vtable};
void grpc_fake_resolver_init(void) {
grpc_register_resolver_type(&fake_resolver_factory);
}

@ -0,0 +1,39 @@
//
// Copyright 2016, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H
#define GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H
#include "test/core/util/test_config.h"
void grpc_fake_resolver_init();
#endif /* GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H */

@ -98,9 +98,12 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->cq);
}
static void test_max_message_length(grpc_end2end_test_config config,
bool send_limit) {
gpr_log(GPR_INFO, "testing with send_limit=%d", send_limit);
// Test with request larger than the limit.
// If send_limit is true, applies send limit on client; otherwise, applies
// recv limit on server.
static void test_max_message_length_on_request(grpc_end2end_test_config config,
bool send_limit) {
gpr_log(GPR_INFO, "testing request with send_limit=%d", send_limit);
grpc_end2end_test_fixture f;
grpc_arg channel_arg;
@ -239,9 +242,161 @@ done:
config.tear_down_data(&f);
}
// Test with response larger than the limit.
// If send_limit is true, applies send limit on server; otherwise, applies
// recv limit on client.
static void test_max_message_length_on_response(grpc_end2end_test_config config,
bool send_limit) {
gpr_log(GPR_INFO, "testing response with send_limit=%d", send_limit);
grpc_end2end_test_fixture f;
grpc_arg channel_arg;
grpc_channel_args channel_args;
grpc_call *c = NULL;
grpc_call *s = NULL;
cq_verifier *cqv;
grpc_op ops[6];
grpc_op *op;
gpr_slice response_payload_slice =
gpr_slice_from_copied_string("hello world");
grpc_byte_buffer *response_payload =
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
grpc_byte_buffer *recv_payload = NULL;
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
grpc_call_details call_details;
grpc_status_code status;
grpc_call_error error;
char *details = NULL;
size_t details_capacity = 0;
int was_cancelled = 2;
channel_arg.key = send_limit ? GRPC_ARG_MAX_SEND_MESSAGE_LENGTH
: GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH;
channel_arg.type = GRPC_ARG_INTEGER;
channel_arg.value.integer = 5;
channel_args.num_args = 1;
channel_args.args = &channel_arg;
f = begin_test(config, "test_max_message_length",
send_limit ? NULL : &channel_args,
send_limit ? &channel_args : NULL);
cqv = cq_verifier_create(f.cq);
c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
"/foo", "foo.test.google.fr:1234",
gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
grpc_metadata_array_init(&trailing_metadata_recv);
grpc_metadata_array_init(&request_metadata_recv);
grpc_call_details_init(&call_details);
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata = &initial_metadata_recv;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &recv_payload;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
op->data.recv_status_on_client.status_details_capacity = &details_capacity;
op->flags = 0;
op->reserved = NULL;
op++;
error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
error =
grpc_server_request_call(f.server, &s, &call_details,
&request_metadata_recv, f.cq, f.cq, tag(101));
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
cq_verify(cqv);
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
op->data.recv_close_on_server.cancelled = &was_cancelled;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message = response_payload;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
op->data.send_status_from_server.trailing_metadata_count = 0;
op->data.send_status_from_server.status = GRPC_STATUS_OK;
op->data.send_status_from_server.status_details = "xyz";
op->flags = 0;
op->reserved = NULL;
op++;
error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
cq_verify(cqv);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(status == GRPC_STATUS_INVALID_ARGUMENT);
GPR_ASSERT(strcmp(details,
send_limit
? "Sent message larger than max (11 vs. 5)"
: "Received message larger than max (11 vs. 5)") == 0);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
grpc_metadata_array_destroy(&request_metadata_recv);
grpc_call_details_destroy(&call_details);
grpc_byte_buffer_destroy(response_payload);
grpc_byte_buffer_destroy(recv_payload);
grpc_call_destroy(c);
if (s != NULL) grpc_call_destroy(s);
cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
}
void max_message_length(grpc_end2end_test_config config) {
test_max_message_length(config, true);
test_max_message_length(config, false);
test_max_message_length_on_request(config, false /* send_limit */);
test_max_message_length_on_request(config, true /* send_limit */);
test_max_message_length_on_response(config, false /* send_limit */);
test_max_message_length_on_response(config, true /* send_limit */);
}
void max_message_length_pre_init(void) {}

@ -119,7 +119,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY;
op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;

@ -314,11 +314,10 @@ static void test_connect(unsigned n) {
GPR_ASSERT(grpc_tcp_server_port_fd(s, 0, 0) >= 0);
grpc_tcp_server_unref(&exec_ctx, s);
grpc_exec_ctx_finish(&exec_ctx);
/* Weak ref lost. */
GPR_ASSERT(weak_ref.server == NULL);
grpc_exec_ctx_finish(&exec_ctx);
}
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,

@ -48,8 +48,6 @@
#include "src/core/lib/iomgr/iomgr.h"
#include "test/core/util/test_config.h"
#ifdef GRPC_NEED_UDP
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
static grpc_pollset *g_pollset;
@ -133,8 +131,9 @@ static void test_no_op_with_port_and_start(void) {
grpc_udp_server_destroy(&exec_ctx, s, NULL);
grpc_exec_ctx_finish(&exec_ctx);
/* The server had a single FD, which should have been orphaned. */
GPR_ASSERT(g_number_of_orphan_calls == 1);
/* The server had a single FD, which is orphaned once in *
* deactivated_all_ports, and once in grpc_udp_server_destroy. */
GPR_ASSERT(g_number_of_orphan_calls == 2);
}
static void test_receive(int number_of_clients) {
@ -198,8 +197,9 @@ static void test_receive(int number_of_clients) {
grpc_udp_server_destroy(&exec_ctx, s, NULL);
grpc_exec_ctx_finish(&exec_ctx);
/* The server had a single FD, which should have been orphaned. */
GPR_ASSERT(g_number_of_orphan_calls == 1);
/* The server had a single FD, which is orphaned once in *
* deactivated_all_ports, and once in grpc_udp_server_destroy. */
GPR_ASSERT(g_number_of_orphan_calls == 2);
}
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
@ -229,9 +229,3 @@ int main(int argc, char **argv) {
grpc_iomgr_shutdown();
return 0;
}
#else
int main(int argc, char **argv) { return 0; }
#endif

@ -46,6 +46,7 @@
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/security/credentials/composite/composite_credentials.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
@ -411,7 +412,7 @@ static grpc_security_status check_channel_oauth2_create_security_connector(
static void test_channel_oauth2_composite_creds(void) {
grpc_channel_args *new_args;
grpc_channel_credentials_vtable vtable = {
NULL, check_channel_oauth2_create_security_connector};
NULL, check_channel_oauth2_create_security_connector, NULL};
grpc_channel_credentials *channel_creds =
grpc_mock_channel_credentials_create(&vtable);
grpc_call_credentials *oauth2_creds =
@ -495,7 +496,7 @@ check_channel_oauth2_google_iam_create_security_connector(
static void test_channel_oauth2_google_iam_composite_creds(void) {
grpc_channel_args *new_args;
grpc_channel_credentials_vtable vtable = {
NULL, check_channel_oauth2_google_iam_create_security_connector};
NULL, check_channel_oauth2_google_iam_create_security_connector, NULL};
grpc_channel_credentials *channel_creds =
grpc_mock_channel_credentials_create(&vtable);
grpc_call_credentials *oauth2_creds =
@ -1148,6 +1149,31 @@ static void test_get_well_known_google_credentials_file_path(void) {
#endif
}
static void test_channel_creds_duplicate_without_call_creds(void) {
grpc_channel_credentials *channel_creds =
grpc_fake_transport_security_credentials_create();
grpc_channel_credentials *dup =
grpc_channel_credentials_duplicate_without_call_credentials(
channel_creds);
GPR_ASSERT(dup == channel_creds);
grpc_channel_credentials_unref(dup);
grpc_call_credentials *call_creds =
grpc_access_token_credentials_create("blah", NULL);
grpc_channel_credentials *composite_creds =
grpc_composite_channel_credentials_create(channel_creds, call_creds,
NULL);
grpc_call_credentials_unref(call_creds);
dup = grpc_channel_credentials_duplicate_without_call_credentials(
composite_creds);
GPR_ASSERT(dup == channel_creds);
grpc_channel_credentials_unref(dup);
grpc_channel_credentials_unref(channel_creds);
grpc_channel_credentials_unref(composite_creds);
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
@ -1182,6 +1208,7 @@ int main(int argc, char **argv) {
test_metadata_plugin_success();
test_metadata_plugin_failure();
test_get_well_known_google_credentials_file_path();
test_channel_creds_duplicate_without_call_creds();
grpc_shutdown();
return 0;
}

@ -89,7 +89,7 @@ TEST_F(CrashTest, KillBeforeWrite) {
EchoRequest request;
EchoResponse response;
ClientContext context;
context.set_fail_fast(false);
context.set_wait_for_ready(true);
auto stream = stub->BidiStream(&context);
@ -115,7 +115,7 @@ TEST_F(CrashTest, KillAfterWrite) {
EchoRequest request;
EchoResponse response;
ClientContext context;
context.set_fail_fast(false);
context.set_wait_for_ready(true);
auto stream = stub->BidiStream(&context);

@ -261,7 +261,7 @@ class HybridEnd2endTest : public ::testing::Test {
EchoRequest send_request;
EchoResponse recv_response;
ClientContext cli_ctx;
cli_ctx.set_fail_fast(false);
cli_ctx.set_wait_for_ready(true);
send_request.set_message("Hello");
Status recv_status = stub_->Echo(&cli_ctx, send_request, &recv_response);
EXPECT_EQ(send_request.message(), recv_response.message());
@ -275,7 +275,7 @@ class HybridEnd2endTest : public ::testing::Test {
EchoRequest send_request;
EchoResponse recv_response;
ClientContext cli_ctx;
cli_ctx.set_fail_fast(false);
cli_ctx.set_wait_for_ready(true);
send_request.set_message("Hello");
Status recv_status = stub->Echo(&cli_ctx, send_request, &recv_response);
EXPECT_EQ(send_request.message() + "_dup", recv_response.message());
@ -287,7 +287,7 @@ class HybridEnd2endTest : public ::testing::Test {
EchoResponse recv_response;
grpc::string expected_message;
ClientContext cli_ctx;
cli_ctx.set_fail_fast(false);
cli_ctx.set_wait_for_ready(true);
send_request.set_message("Hello");
auto stream = stub_->RequestStream(&cli_ctx, &recv_response);
for (int i = 0; i < 5; i++) {
@ -304,7 +304,7 @@ class HybridEnd2endTest : public ::testing::Test {
EchoRequest request;
EchoResponse response;
ClientContext context;
context.set_fail_fast(false);
context.set_wait_for_ready(true);
request.set_message("hello");
auto stream = stub_->ResponseStream(&context, request);
@ -324,7 +324,7 @@ class HybridEnd2endTest : public ::testing::Test {
EchoRequest request;
EchoResponse response;
ClientContext context;
context.set_fail_fast(false);
context.set_wait_for_ready(true);
grpc::string msg("hello");
auto stream = stub_->BidiStream(&context);

@ -144,7 +144,7 @@ class ProtoServerReflectionTest : public ::testing::Test {
TEST_F(ProtoServerReflectionTest, CheckResponseWithLocalDescriptorPool) {
ResetStub();
std::vector<std::string> services;
std::vector<grpc::string> services;
desc_db_->GetServices(&services);
// The service list has at least one service (reflection servcie).
EXPECT_TRUE(services.size() > 0);

@ -65,7 +65,7 @@ int main(int argc, char** argv) {
EchoRequest request;
EchoResponse response;
grpc::ClientContext context;
context.set_fail_fast(false);
context.set_wait_for_ready(true);
if (FLAGS_mode == "bidi") {
auto stream = stub->BidiStream(&context);

@ -59,6 +59,7 @@ extern "C" {
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/fake_resolver.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
}
@ -460,7 +461,7 @@ static void perform_request(client_fixture *cf) {
c = grpc_channel_create_call(cf->client, NULL, GRPC_PROPAGATE_DEFAULTS,
cf->cq, "/foo", "foo.test.google.fr:1234",
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1000), NULL);
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL);
gpr_log(GPR_INFO, "Call 0x%" PRIxPTR " created", (intptr_t)c);
GPR_ASSERT(c);
char *peer;
@ -633,7 +634,7 @@ static test_fixture setup_test_fixture(int lb_server_update_delay_ms) {
gpr_thd_new(&tf.lb_server.tid, fork_lb_server, &tf.lb_server, &options);
char *server_uri;
gpr_asprintf(&server_uri, "ipv4:%s?lb_policy=grpclb&lb_enabled=1",
gpr_asprintf(&server_uri, "test:%s?lb_policy=grpclb&lb_enabled=1",
tf.lb_server.servers_hostport);
setup_client(server_uri, &tf.client);
gpr_free(server_uri);
@ -716,6 +717,7 @@ TEST(GrpclbTest, InvalidAddressInServerlist) {}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
grpc_test_init(argc, argv);
grpc_fake_resolver_init();
grpc_init();
const auto result = RUN_ALL_TESTS();
grpc_shutdown();

@ -149,6 +149,8 @@ int main(int argc, char** argv) {
client.DoStatusWithMessage();
} else if (FLAGS_test_case == "custom_metadata") {
client.DoCustomMetadata();
} else if (FLAGS_test_case == "cacheable_unary") {
client.DoCacheableUnary();
} else if (FLAGS_test_case == "all") {
client.DoEmpty();
client.DoLargeUnary();
@ -166,6 +168,7 @@ int main(int argc, char** argv) {
client.DoEmptyStream();
client.DoStatusWithMessage();
client.DoCustomMetadata();
client.DoCacheableUnary();
// service_account_creds and jwt_token_creds can only run with ssl.
if (FLAGS_use_tls) {
grpc::string json_key = GetServiceAccountJsonKey();
@ -177,6 +180,7 @@ int main(int argc, char** argv) {
// compute_engine_creds only runs in GCE.
} else {
const char* testcases[] = {"all",
"cacheable_unary",
"cancel_after_begin",
"cancel_after_first_response",
"client_compressed_streaming",

@ -846,6 +846,50 @@ bool InteropClient::DoStatusWithMessage() {
return true;
}
bool InteropClient::DoCacheableUnary() {
gpr_log(GPR_DEBUG, "Sending RPC with cacheable response");
// Create request with current timestamp
gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE);
std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec);
SimpleRequest request;
request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size());
// Request 1
ClientContext context1;
SimpleResponse response1;
context1.set_cacheable(true);
// Add fake user IP since some proxy's (GFE) won't cache requests from
// localhost.
context1.AddMetadata("x-user-ip", "1.2.3.4");
Status s1 =
serviceStub_.Get()->CacheableUnaryCall(&context1, request, &response1);
if (!AssertStatusOk(s1)) {
return false;
}
gpr_log(GPR_DEBUG, "response 1 payload: %s",
response1.payload().body().c_str());
// Request 2
ClientContext context2;
SimpleResponse response2;
context2.set_cacheable(true);
context2.AddMetadata("x-user-ip", "1.2.3.4");
Status s2 =
serviceStub_.Get()->CacheableUnaryCall(&context2, request, &response2);
if (!AssertStatusOk(s2)) {
return false;
}
gpr_log(GPR_DEBUG, "response 2 payload: %s",
response2.payload().body().c_str());
// Check that the body is same for both requests. It will be the same if the
// second response is a cached copy of the first response
GPR_ASSERT(response2.payload().body() == response1.payload().body());
return true;
}
bool InteropClient::DoCustomMetadata() {
const grpc::string kEchoInitialMetadataKey("x-grpc-test-echo-initial");
const grpc::string kInitialMetadataValue("test_initial_metadata_value");

@ -79,6 +79,7 @@ class InteropClient {
bool DoEmptyStream();
bool DoStatusWithMessage();
bool DoCustomMetadata();
bool DoCacheableUnary();
// Auth tests.
// username is a string containing the user email
bool DoJwtTokenCreds(const grpc::string& username);

@ -47,6 +47,7 @@
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/support/string.h"
#include "src/core/lib/transport/byte_stream.h"
#include "src/proto/grpc/testing/empty.grpc.pb.h"
#include "src/proto/grpc/testing/messages.grpc.pb.h"
@ -153,6 +154,17 @@ class TestServiceImpl : public TestService::Service {
return Status::OK;
}
// Response contains current timestamp. We ignore everything in the request.
Status CacheableUnaryCall(ServerContext* context,
const SimpleRequest* request,
SimpleResponse* response) {
gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE);
std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec);
response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size());
context->AddInitialMetadata("cache-control", "max-age=60, public");
return Status::OK;
}
Status UnaryCall(ServerContext* context, const SimpleRequest* request,
SimpleResponse* response) {
MaybeEchoMetadata(context);

@ -243,6 +243,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
// this thread isn't supposed to shut down
std::lock_guard<std::mutex> l(shutdown_state_[thread_idx]->mutex);
if (shutdown_state_[thread_idx]->shutdown) {
delete ctx;
return true;
} else if (!ctx->RunNextState(ok, entry)) {
// The RPC and callback are done, so clone the ctx

@ -83,7 +83,7 @@ static std::unordered_map<string, std::deque<int>> get_hosts_and_cores(
auto stub = WorkerService::NewStub(
CreateChannel(*it, InsecureChannelCredentials()));
grpc::ClientContext ctx;
ctx.set_fail_fast(false);
ctx.set_wait_for_ready(true);
CoreRequest dummy;
CoreResponse cores;
grpc::Status s = stub->CoreCount(&ctx, dummy, &cores);
@ -167,7 +167,7 @@ namespace runsc {
static ClientContext* AllocContext(list<ClientContext>* contexts) {
contexts->emplace_back();
auto context = &contexts->back();
context->set_fail_fast(false);
context->set_wait_for_ready(true);
return context;
}
@ -527,7 +527,7 @@ bool RunQuit() {
CreateChannel(workers[i], InsecureChannelCredentials()));
Void dummy;
grpc::ClientContext ctx;
ctx.set_fail_fast(false);
ctx.set_wait_for_ready(true);
Status s = stub->QuitWorker(&ctx, dummy, &dummy);
if (!s.ok()) {
gpr_log(GPR_ERROR, "Worker %zu could not be properly quit because %s", i,

@ -52,7 +52,6 @@
#include "test/cpp/util/proto_file_parser.h"
#include "test/cpp/util/proto_reflection_descriptor_database.h"
#include "test/cpp/util/service_describer.h"
#include "test/cpp/util/test_config.h"
namespace grpc {
namespace testing {

@ -82,7 +82,7 @@ ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
const grpc::string& proto_path,
const grpc::string& protofiles)
: has_error_(false) {
std::vector<std::string> service_list;
std::vector<grpc::string> service_list;
if (channel) {
reflection_db_.reset(new grpc::ProtoReflectionDescriptorDatabase(channel));
reflection_db_->GetServices(&service_list);

@ -255,7 +255,7 @@ bool ProtoReflectionDescriptorDatabase::FindAllExtensionNumbers(
}
bool ProtoReflectionDescriptorDatabase::GetServices(
std::vector<std::string>* output) {
std::vector<grpc::string>* output) {
ServerReflectionRequest request;
request.set_list_services("");
ServerReflectionResponse response;
@ -288,7 +288,7 @@ bool ProtoReflectionDescriptorDatabase::GetServices(
const protobuf::FileDescriptorProto
ProtoReflectionDescriptorDatabase::ParseFileDescriptorProtoResponse(
const std::string& byte_fd_proto) {
const grpc::string& byte_fd_proto) {
protobuf::FileDescriptorProto file_desc_proto;
file_desc_proto.ParseFromString(byte_fd_proto);
return file_desc_proto;
@ -314,13 +314,16 @@ ProtoReflectionDescriptorDatabase::GetStream() {
return stream_;
}
void ProtoReflectionDescriptorDatabase::DoOneRequest(
bool ProtoReflectionDescriptorDatabase::DoOneRequest(
const ServerReflectionRequest& request,
ServerReflectionResponse& response) {
bool success = false;
stream_mutex_.lock();
GetStream()->Write(request);
GetStream()->Read(&response);
if (GetStream()->Write(request) && GetStream()->Read(&response)) {
success = true;
}
stream_mutex_.unlock();
return success;
}
} // namespace grpc

@ -95,7 +95,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase {
std::vector<int>* output) GRPC_OVERRIDE;
// Provide a list of full names of registered services
bool GetServices(std::vector<std::string>* output);
bool GetServices(std::vector<grpc::string>* output);
private:
typedef ClientReaderWriter<
@ -104,14 +104,14 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase {
ClientStream;
const protobuf::FileDescriptorProto ParseFileDescriptorProtoResponse(
const std::string& byte_fd_proto);
const grpc::string& byte_fd_proto);
void AddFileFromResponse(
const grpc::reflection::v1alpha::FileDescriptorResponse& response);
const std::shared_ptr<ClientStream> GetStream();
void DoOneRequest(
bool DoOneRequest(
const grpc::reflection::v1alpha::ServerReflectionRequest& request,
grpc::reflection::v1alpha::ServerReflectionResponse& response);

@ -30,7 +30,12 @@
set -ex
git clone --recursive $EXTERNAL_GIT_ROOT
git clone $EXTERNAL_GIT_ROOT
# clone gRPC submodules, use data from locally cloned submodules where possible
(cd ${EXTERNAL_GIT_ROOT} && git submodule foreach 'cd /var/local/git/grpc \
&& git submodule update --init --reference ${EXTERNAL_GIT_ROOT}/${name} \
${name}')
cd grpc
cd third_party/protobuf && ./autogen.sh && \

@ -31,7 +31,11 @@
set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
git clone /var/local/jenkins/grpc /var/local/git/grpc
# clone gRPC submodules, use data from locally cloned submodules where possible
(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
${name}')
cd /var/local/git/grpc

@ -32,7 +32,11 @@
set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
git clone /var/local/jenkins/grpc /var/local/git/grpc
# clone gRPC submodules, use data from locally cloned submodules where possible
(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
${name}')
# copy service account keys if available
cp -r /var/local/jenkins/service_account $HOME || true

@ -32,7 +32,11 @@
set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
git clone /var/local/jenkins/grpc /var/local/git/grpc
# clone gRPC submodules, use data from locally cloned submodules where possible
(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
${name}')
# copy service account keys if available
cp -r /var/local/jenkins/service_account $HOME || true

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save