diff options
-rw-r--r-- | src/core/transport/chttp2/hpack_parser.c | 4 | ||||
-rw-r--r-- | src/core/transport/chttp2/hpack_parser.h | 2 | ||||
-rw-r--r-- | src/objective-c/README.md | 2 | ||||
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 12 | ||||
-rw-r--r-- | test/cpp/end2end/thread_stress_test.cc | 10 | ||||
-rw-r--r-- | test/cpp/qps/worker.cc | 3 | ||||
-rw-r--r-- | tools/dockerfile/grpc_java_android/Dockerfile | 7 |
7 files changed, 25 insertions, 15 deletions
diff --git a/src/core/transport/chttp2/hpack_parser.c b/src/core/transport/chttp2/hpack_parser.c index 3fd8f67226..a489543868 100644 --- a/src/core/transport/chttp2/hpack_parser.c +++ b/src/core/transport/chttp2/hpack_parser.c @@ -654,7 +654,7 @@ static int parse_stream_weight(grpc_chttp2_hpack_parser *p, return 1; } - return parse_begin(p, cur + 1, end); + return p->after_prioritization(p, cur + 1, end); } static int parse_stream_dep3(grpc_chttp2_hpack_parser *p, const gpr_uint8 *cur, @@ -1349,7 +1349,7 @@ void grpc_chttp2_hpack_parser_init(grpc_chttp2_hpack_parser *p, } void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser *p) { - GPR_ASSERT(p->state == parse_begin); + p->after_prioritization = p->state; p->state = parse_stream_dep0; } diff --git a/src/core/transport/chttp2/hpack_parser.h b/src/core/transport/chttp2/hpack_parser.h index bb4c1a1f49..bfc06b3980 100644 --- a/src/core/transport/chttp2/hpack_parser.h +++ b/src/core/transport/chttp2/hpack_parser.h @@ -62,6 +62,8 @@ struct grpc_chttp2_hpack_parser { grpc_chttp2_hpack_parser_state state; /* future states dependent on the opening op code */ const grpc_chttp2_hpack_parser_state *next_state; + /* what to do after skipping prioritization data */ + grpc_chttp2_hpack_parser_state after_prioritization; /* the value we're currently parsing */ union { gpr_uint32 *value; diff --git a/src/objective-c/README.md b/src/objective-c/README.md index cdba3777dd..49d7f43882 100644 --- a/src/objective-c/README.md +++ b/src/objective-c/README.md @@ -22,7 +22,7 @@ If you don't want to create the symbolic link, you can alternatively copy the bi Finally, run _protoc_ with the following flags to generate the client library for your `.proto` files: ```sh -protoc --objc_out=. --objcrpc_out=. *.proto +protoc --objc_out=. --objcgrpc_out=. *.proto ``` This will generate a pair of `.pbobjc.h`/`.pbobjc.m` files for each `.proto` file, with the messages and enums defined in them. And a pair of `.pbrpc.h`/`.pbrpc.m` files for each `.proto` file with services defined. The latter contains the code to make remote calls to the specified API. diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 76271c3e1d..7a15591b44 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -96,14 +96,16 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service { signal_client_ = true; } while (!context->IsCancelled()) { - std::this_thread::sleep_for(std::chrono::microseconds( - request->param().client_cancel_after_us())); + gpr_sleep_until(gpr_time_add( + gpr_now(), + gpr_time_from_micros(request->param().client_cancel_after_us()))); } return Status::Cancelled; } else if (request->has_param() && request->param().server_cancel_after_us()) { - std::this_thread::sleep_for( - std::chrono::microseconds(request->param().server_cancel_after_us())); + gpr_sleep_until(gpr_time_add( + gpr_now(), + gpr_time_from_micros(request->param().server_cancel_after_us()))); return Status::Cancelled; } else { EXPECT_FALSE(context->IsCancelled()); @@ -469,7 +471,7 @@ TEST_F(End2endTest, BadCredentials) { } void CancelRpc(ClientContext* context, int delay_us, TestServiceImpl* service) { - std::this_thread::sleep_for(std::chrono::microseconds(delay_us)); + gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_micros(delay_us))); while (!service->signal_client()) { } context->TryCancel(); diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc index 12656128c0..310227a29c 100644 --- a/test/cpp/end2end/thread_stress_test.cc +++ b/test/cpp/end2end/thread_stress_test.cc @@ -94,14 +94,16 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service { signal_client_ = true; } while (!context->IsCancelled()) { - std::this_thread::sleep_for(std::chrono::microseconds( - request->param().client_cancel_after_us())); + gpr_sleep_until(gpr_time_add( + gpr_now(), + gpr_time_from_micros(request->param().client_cancel_after_us()))); } return Status::Cancelled; } else if (request->has_param() && request->param().server_cancel_after_us()) { - std::this_thread::sleep_for( - std::chrono::microseconds(request->param().server_cancel_after_us())); + gpr_sleep_until(gpr_time_add( + gpr_now(), + gpr_time_from_micros(request->param().server_cancel_after_us()))); return Status::Cancelled; } else { EXPECT_FALSE(context->IsCancelled()); diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc index 281c617382..8c82bce8f2 100644 --- a/test/cpp/qps/worker.cc +++ b/test/cpp/qps/worker.cc @@ -37,6 +37,7 @@ #include <thread> #include <grpc/grpc.h> +#include <grpc/support/time.h> #include <gflags/gflags.h> #include "qps_worker.h" @@ -56,7 +57,7 @@ static void RunServer() { QpsWorker worker(FLAGS_driver_port, FLAGS_server_port); while (!got_sigint) { - std::this_thread::sleep_for(std::chrono::seconds(5)); + gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(5))); } } diff --git a/tools/dockerfile/grpc_java_android/Dockerfile b/tools/dockerfile/grpc_java_android/Dockerfile index d11e88943c..2dc2202e9d 100644 --- a/tools/dockerfile/grpc_java_android/Dockerfile +++ b/tools/dockerfile/grpc_java_android/Dockerfile @@ -44,10 +44,13 @@ ENV PATH $PATH:$ANDROID_HOME/platform-tools ENV HOME /root # Update sdk for android 5.1 (API level 22) -RUN echo y | android update sdk --all --filter platform-tools,build-tools-22.0.1,sys-img-armeabi-v7a-android-22,android-22,extra-android-m2repository,extra-google-m2repository --no-ui --force +RUN echo y | android update sdk --all --filter platform-tools,build-tools-22.0.1,sys-img-armeabi-v7a-addon-google_apis-google-22,sys-img-armeabi-v7a-addon-google_apis-google-21,sys-img-armeabi-v7a-android-19,addon-google_apis-google-22,addon-google_apis-google-21,addon-google_apis-google-19,extra-android-m2repository,extra-google-m2repository --no-ui --force + # Create an AVD with API level 22 -RUN echo no | android create avd --force -n avd-api-22 -t android-22 +RUN echo no | android create avd --force -n avd-google-api-22 -t "Google Inc.:Google APIs:22" --abi google_apis/armeabi-v7a +RUN echo no | android create avd --force -n avd-google-api-21 -t "Google Inc.:Google APIs:21" --abi google_apis/armeabi-v7a +RUN echo no | android create avd --force -n avd-google-api-19 -t "Google Inc.:Google APIs:19" --abi default/armeabi-v7a # Pull gRPC Java and trigger download of needed Maven and Gradle artifacts. RUN git clone --depth 1 https://github.com/grpc/grpc-java.git /var/local/git/grpc-java && \ |