diff options
author | 2015-06-01 12:55:57 -0700 | |
---|---|---|
committer | 2015-06-01 12:55:57 -0700 | |
commit | 06bac34df01bc2b06e3808a87f80d591c491fc5f (patch) | |
tree | cede895636542b0e9ad4476f7ef8248dc82a114a /src/core/httpcli/httpcli.c | |
parent | 89717c4c34967baf4733435cc9640e30eddddb64 (diff) |
Properly integrate credentials metadata delivery
Diffstat (limited to 'src/core/httpcli/httpcli.c')
-rw-r--r-- | src/core/httpcli/httpcli.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c index 53ec070900..d39bcfe55d 100644 --- a/src/core/httpcli/httpcli.c +++ b/src/core/httpcli/httpcli.c @@ -60,6 +60,7 @@ typedef struct { grpc_httpcli_response_cb on_response; void *user_data; grpc_httpcli_context *context; + grpc_pollset *pollset; } internal_request; static grpc_httpcli_get_override g_get_override = NULL; @@ -73,13 +74,10 @@ void grpc_httpcli_context_destroy(grpc_httpcli_context *context) { grpc_pollset_set_destroy(&context->pollset_set); } -void grpc_httpcli_context_add_interested_party(grpc_httpcli_context *context, grpc_pollset *pollset) { - grpc_pollset_set_add_pollset(&context->pollset_set, pollset); -} - static void next_address(internal_request *req); static void finish(internal_request *req, int success) { + grpc_pollset_set_del_pollset(&req->context->pollset_set, req->pollset); req->on_response(req->user_data, success ? &req->parser.r : NULL); grpc_httpcli_parser_destroy(&req->parser); if (req->addresses != NULL) { @@ -226,7 +224,7 @@ static void on_resolved(void *arg, grpc_resolved_addresses *addresses) { next_address(req); } -void grpc_httpcli_get(grpc_httpcli_context *context, +void grpc_httpcli_get(grpc_httpcli_context *context, grpc_pollset *pollset, const grpc_httpcli_request *request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data) { @@ -244,15 +242,17 @@ void grpc_httpcli_get(grpc_httpcli_context *context, req->deadline = deadline; req->use_ssl = request->use_ssl; req->context = context; + req->pollset = pollset; if (req->use_ssl) { req->host = gpr_strdup(request->host); } + grpc_pollset_set_add_pollset(&req->context->pollset_set, req->pollset); grpc_resolve_address(request->host, req->use_ssl ? "https" : "http", on_resolved, req); } -void grpc_httpcli_post(grpc_httpcli_context *context, +void grpc_httpcli_post(grpc_httpcli_context *context, grpc_pollset *pollset, const grpc_httpcli_request *request, const char *body_bytes, size_t body_size, gpr_timespec deadline, @@ -272,6 +272,7 @@ void grpc_httpcli_post(grpc_httpcli_context *context, req->deadline = deadline; req->use_ssl = request->use_ssl; req->context = context; + req->pollset = pollset; if (req->use_ssl) { req->host = gpr_strdup(request->host); } |