aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/httpcli/httpcli.h
diff options
context:
space:
mode:
authorGravatar ctiller <ctiller@google.com>2014-12-17 17:03:15 -0800
committerGravatar Michael Lumish <mlumish@google.com>2014-12-19 13:08:41 -0800
commit40260c4d5b607a5808b7e48511baa732b70468fc (patch)
tree6db4ec3e51356cddaa92f646738461f65064d8a5 /src/core/httpcli/httpcli.h
parent246ec3bd3a386a7ccf8516425214b7ac368436a9 (diff)
Allow overriding httpcli behavior by tests.
Change on 2014/12/17 by ctiller <ctiller@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=82379331
Diffstat (limited to 'src/core/httpcli/httpcli.h')
-rw-r--r--src/core/httpcli/httpcli.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h
index 56eebe951e..ef8031354c 100644
--- a/src/core/httpcli/httpcli.h
+++ b/src/core/httpcli/httpcli.h
@@ -100,4 +100,19 @@ void grpc_httpcli_post(const grpc_httpcli_request *request,
gpr_timespec deadline,
grpc_httpcli_response_cb on_response, void *user_data);
+/* override functions return 1 if they handled the request, 0 otherwise */
+typedef int (*grpc_httpcli_get_override)(const grpc_httpcli_request *request,
+ gpr_timespec deadline,
+ grpc_httpcli_response_cb on_response,
+ void *user_data);
+typedef int (*grpc_httpcli_post_override)(const grpc_httpcli_request *request,
+ const char *body_bytes,
+ size_t body_size,
+ gpr_timespec deadline,
+ grpc_httpcli_response_cb on_response,
+ void *user_data);
+
+void grpc_httpcli_set_override(grpc_httpcli_get_override get,
+ grpc_httpcli_post_override post);
+
#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_H__ */