Skip to content
Snippets Groups Projects
Commit 65233917 authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

sanity fixes

parent b4e51b52
No related branches found
No related tags found
No related merge requests found
...@@ -92,12 +92,10 @@ class ClientAsyncResponseReader GRPC_FINAL ...@@ -92,12 +92,10 @@ class ClientAsyncResponseReader GRPC_FINAL
ClientContext* context_; ClientContext* context_;
Call call_; Call call_;
SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> CallOpClientSendClose> init_buf_;
init_buf_;
CallOpSet<CallOpRecvInitialMetadata> meta_buf_; CallOpSet<CallOpRecvInitialMetadata> meta_buf_;
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>, CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>,
CallOpClientRecvStatus> CallOpClientRecvStatus> finish_buf_;
finish_buf_;
}; };
template <class W> template <class W>
...@@ -150,8 +148,7 @@ class ServerAsyncResponseWriter GRPC_FINAL ...@@ -150,8 +148,7 @@ class ServerAsyncResponseWriter GRPC_FINAL
ServerContext* ctx_; ServerContext* ctx_;
CallOpSet<CallOpSendInitialMetadata> meta_buf_; CallOpSet<CallOpSendInitialMetadata> meta_buf_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> CallOpServerSendStatus> finish_buf_;
finish_buf_;
}; };
} // namespace grpc } // namespace grpc
......
...@@ -55,8 +55,7 @@ Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, ...@@ -55,8 +55,7 @@ Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
Call call(channel->CreateCall(method, context, &cq)); Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>, CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
CallOpClientSendClose, CallOpClientRecvStatus> CallOpClientSendClose, CallOpClientRecvStatus> ops;
ops;
Status status = ops.SendMessage(request); Status status = ops.SendMessage(request);
if (!status.ok()) { if (!status.ok()) {
return status; return status;
......
...@@ -43,10 +43,10 @@ namespace grpc { ...@@ -43,10 +43,10 @@ namespace grpc {
template <class ServiceType, class RequestType, class ResponseType> template <class ServiceType, class RequestType, class ResponseType>
class RpcMethodHandler : public MethodHandler { class RpcMethodHandler : public MethodHandler {
public: public:
RpcMethodHandler(std::function<Status(ServiceType*, ServerContext*, RpcMethodHandler(
const RequestType*, ResponseType*)> std::function<Status(ServiceType*, ServerContext*, const RequestType*,
func, ResponseType*)> func,
ServiceType* service) ServiceType* service)
: func_(func), service_(service) {} : func_(func), service_(service) {}
void RunHandler(const HandlerParameter& param) GRPC_FINAL { void RunHandler(const HandlerParameter& param) GRPC_FINAL {
...@@ -60,8 +60,7 @@ class RpcMethodHandler : public MethodHandler { ...@@ -60,8 +60,7 @@ class RpcMethodHandler : public MethodHandler {
GPR_ASSERT(!param.server_context->sent_initial_metadata_); GPR_ASSERT(!param.server_context->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> CallOpServerSendStatus> ops;
ops;
ops.SendInitialMetadata(param.server_context->initial_metadata_); ops.SendInitialMetadata(param.server_context->initial_metadata_);
if (status.ok()) { if (status.ok()) {
status = ops.SendMessage(rsp); status = ops.SendMessage(rsp);
...@@ -74,8 +73,7 @@ class RpcMethodHandler : public MethodHandler { ...@@ -74,8 +73,7 @@ class RpcMethodHandler : public MethodHandler {
private: private:
// Application provided rpc handler function. // Application provided rpc handler function.
std::function<Status(ServiceType*, ServerContext*, const RequestType*, std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ResponseType*)> ResponseType*)> func_;
func_;
// The class the above handler function lives in. // The class the above handler function lives in.
ServiceType* service_; ServiceType* service_;
}; };
...@@ -86,8 +84,7 @@ class ClientStreamingHandler : public MethodHandler { ...@@ -86,8 +84,7 @@ class ClientStreamingHandler : public MethodHandler {
public: public:
ClientStreamingHandler( ClientStreamingHandler(
std::function<Status(ServiceType*, ServerContext*, std::function<Status(ServiceType*, ServerContext*,
ServerReader<RequestType>*, ResponseType*)> ServerReader<RequestType>*, ResponseType*)> func,
func,
ServiceType* service) ServiceType* service)
: func_(func), service_(service) {} : func_(func), service_(service) {}
...@@ -98,8 +95,7 @@ class ClientStreamingHandler : public MethodHandler { ...@@ -98,8 +95,7 @@ class ClientStreamingHandler : public MethodHandler {
GPR_ASSERT(!param.server_context->sent_initial_metadata_); GPR_ASSERT(!param.server_context->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> CallOpServerSendStatus> ops;
ops;
ops.SendInitialMetadata(param.server_context->initial_metadata_); ops.SendInitialMetadata(param.server_context->initial_metadata_);
if (status.ok()) { if (status.ok()) {
status = ops.SendMessage(rsp); status = ops.SendMessage(rsp);
...@@ -111,8 +107,7 @@ class ClientStreamingHandler : public MethodHandler { ...@@ -111,8 +107,7 @@ class ClientStreamingHandler : public MethodHandler {
private: private:
std::function<Status(ServiceType*, ServerContext*, ServerReader<RequestType>*, std::function<Status(ServiceType*, ServerContext*, ServerReader<RequestType>*,
ResponseType*)> ResponseType*)> func_;
func_;
ServiceType* service_; ServiceType* service_;
}; };
...@@ -122,8 +117,7 @@ class ServerStreamingHandler : public MethodHandler { ...@@ -122,8 +117,7 @@ class ServerStreamingHandler : public MethodHandler {
public: public:
ServerStreamingHandler( ServerStreamingHandler(
std::function<Status(ServiceType*, ServerContext*, const RequestType*, std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ServerWriter<ResponseType>*)> ServerWriter<ResponseType>*)> func,
func,
ServiceType* service) ServiceType* service)
: func_(func), service_(service) {} : func_(func), service_(service) {}
...@@ -148,8 +142,7 @@ class ServerStreamingHandler : public MethodHandler { ...@@ -148,8 +142,7 @@ class ServerStreamingHandler : public MethodHandler {
private: private:
std::function<Status(ServiceType*, ServerContext*, const RequestType*, std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ServerWriter<ResponseType>*)> ServerWriter<ResponseType>*)> func_;
func_;
ServiceType* service_; ServiceType* service_;
}; };
...@@ -180,8 +173,7 @@ class BidiStreamingHandler : public MethodHandler { ...@@ -180,8 +173,7 @@ class BidiStreamingHandler : public MethodHandler {
private: private:
std::function<Status(ServiceType*, ServerContext*, std::function<Status(ServiceType*, ServerContext*,
ServerReaderWriter<ResponseType, RequestType>*)> ServerReaderWriter<ResponseType, RequestType>*)> func_;
func_;
ServiceType* service_; ServiceType* service_;
}; };
......
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
#ifndef GRPCXX_IMPL_CODEGEN_SERVICE_TYPE_H #ifndef GRPCXX_IMPL_CODEGEN_SERVICE_TYPE_H
#define GRPCXX_IMPL_CODEGEN_SERVICE_TYPE_H #define GRPCXX_IMPL_CODEGEN_SERVICE_TYPE_H
#include <grpc++/impl/rpc_service_method.h>
#include <grpc++/impl/serialization_traits.h>
#include <grpc++/impl/codegen/server_interface.h>
#include <grpc++/impl/codegen/config.h> #include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/rpc_service_method.h>
#include <grpc++/impl/codegen/serialization_traits.h>
#include <grpc++/impl/codegen/server_interface.h>
#include <grpc++/impl/codegen/status.h> #include <grpc++/impl/codegen/status.h>
namespace grpc { namespace grpc {
......
...@@ -122,8 +122,7 @@ class ClientReader GRPC_FINAL : public ClientReaderInterface<R> { ...@@ -122,8 +122,7 @@ class ClientReader GRPC_FINAL : public ClientReaderInterface<R> {
ClientContext* context, const W& request) ClientContext* context, const W& request)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) { : context_(context), call_(channel->CreateCall(method, context, &cq_)) {
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> CallOpClientSendClose> ops;
ops;
ops.SendInitialMetadata(context->send_initial_metadata_); ops.SendInitialMetadata(context->send_initial_metadata_);
// TODO(ctiller): don't assert // TODO(ctiller): don't assert
GPR_ASSERT(ops.SendMessage(request).ok()); GPR_ASSERT(ops.SendMessage(request).ok());
......
...@@ -64,5 +64,4 @@ extern "C" { ...@@ -64,5 +64,4 @@ extern "C" {
} }
#endif #endif
#endif /* GRPC_IMPL_CODEGEN_H */ #endif /* GRPC_IMPL_CODEGEN_H */
...@@ -161,12 +161,11 @@ class AsyncClient : public ClientImpl<StubType, RequestType> { ...@@ -161,12 +161,11 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
using Client::closed_loop_; using Client::closed_loop_;
using ClientImpl<StubType, RequestType>::channels_; using ClientImpl<StubType, RequestType>::channels_;
using ClientImpl<StubType, RequestType>::request_; using ClientImpl<StubType, RequestType>::request_;
AsyncClient( AsyncClient(const ClientConfig& config,
const ClientConfig& config, std::function<ClientRpcContext*(int, StubType*,
std::function<ClientRpcContext*(int, StubType*, const RequestType&)> const RequestType&)> setup_ctx,
setup_ctx, std::function<std::unique_ptr<StubType>(std::shared_ptr<Channel>)>
std::function<std::unique_ptr<StubType>(std::shared_ptr<Channel>)> create_stub)
create_stub)
: ClientImpl<StubType, RequestType>(config, create_stub), : ClientImpl<StubType, RequestType>(config, create_stub),
num_async_threads_(NumThreads(config)), num_async_threads_(NumThreads(config)),
channel_lock_(new std::mutex[config.client_channels()]), channel_lock_(new std::mutex[config.client_channels()]),
......
This diff is collapsed.
...@@ -54,4 +54,4 @@ then ...@@ -54,4 +54,4 @@ then
USE_DOCKER_MAYBE="--use_docker" USE_DOCKER_MAYBE="--use_docker"
fi fi
python tools/run_tests/run_tests.py $USE_DOCKER_MAYBE -t -l $language -c $config --arch ${curr_arch} --compiler ${curr_compiler} -x report.xml -j 3 $@ python tools/run_tests/run_tests.py $USE_DOCKER_MAYBE -t -l $language -c $config --arch ${curr_arch} --compiler ${curr_compiler} -x report.xml -j 3 $@
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment