Android-related binder classes are only available if
GPR_SUPPORT_BINDER_TRANSPORT is defined. Thus, BinderServerCredentials
should only work if GPR_SUPPORT_BINDER_TRANSPORT (instead of
GPR_ANDROID) is defined as well.
* Fix ReadableParcelAndroid::ReadString interface
Also uses implementation from android/binder_parcel_utils.h to read
ByteArray and string from Parcel
Test example app on device, works correctly
There was a bug found by the fuzzer where we might access wire_writer_ before
finishing SETUP_TRANSPORT (and thus constructing wire_writer_). This PR
fixes such issue by making sure that we won't proceed with any requests
until the connection is fully established.
Since binder transactions may be coming from multiple different threads,
this PRs guard some of the WireReaderImpl's member with a mutex to make
sure there's no races between threads.
* xDS Security: Use new way to fetch certificate provider plugin instance
config
* Reviewer comments
* Additional fields to NACK
* Move NACKing tests for tls_certificates and tls_certificate_sds_securet_configs to client-side
Add `grpc::BinderServerCredentials()` and other related functionalities for the server to listen to binder transactions through a phony "binder port".
The APIs are temporarily placed in internal headers until the corresponding gRFC is merged.
* Remove iterator interface from LBPolicy Metadata
Trying to clear the way to think about how metadata is handled in core.
Right now this interface is only used for tests, so a single method that
does what's needed for that (and marked TestOnly) is provided for now.
In the future we'll certainly likely need API to access metadata from
load balancing policies. However, it seems likely that we'll want to
encourage access via lookup-by-key rather than lookup-by-iteration, and
so it seems likely we'll want to expose interfaces phrased in those
terms.
In the meantime, this change localizes some complexity to make it easier
to transition to new internal API's.
* mdcleanup
* fix retry code to fail batches instead of creating attempt if previously cancelled from surface
* add xDS end2end tests covering the FI use-case that triggered the bug
* fix memory leak
* add test proving that we fail to take refs to send_initial_metadart payload
* fix grpc_slice_from_copied_string() to take refs and grpc_metadata_batch_copy() to copy the mdelems when necessary
* fix criteria used to determine if mdelem is reffable
* add support for inline slices
* fix sanity
* Avoid copy constructor
```
src/core/lib/gpr/log_linux.cc:78:33: error: copying variable of type 'grpc_core::PthreadTlsImpl<long>' invokes deleted constructor
static GPR_THREAD_LOCAL(long) tid = 0;
^ ~
./src/core/lib/gpr/tls.h:64:3: note: 'PthreadTlsImpl' has been explicitly marked deleted here
PthreadTlsImpl(const PthreadTlsImpl&) = delete;
^
1 error generated.
```
* Generalize pthread TLS to any trivial type
Use multiple pthread keys for types larger than a machine word.
Implement generic timer TLS optimization on all platforms.
If we continue to call `Write()` after `WriteLast()` (because client is still sending us data and thus `Read()` returns `true`), the buffer might become invalid and results in assertion failures.
This PR imports unit tests and end-to-end tests of binder transport from the internal repository. No further changes will be made to internal repository.