diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-22 10:45:28 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-22 10:45:28 -0700 |
commit | 1be70ccdb84ec41975cc018f6b2a2a89cf5072ee (patch) | |
tree | d4e6890ca32762bf786e2b801d3c26b27ec707ee /src/core/httpcli | |
parent | 45724b35e411fef7c5da66a74c78428c11d56843 (diff) |
Move arguments to the start of lists
Diffstat (limited to 'src/core/httpcli')
-rw-r--r-- | src/core/httpcli/httpcli.c | 32 | ||||
-rw-r--r-- | src/core/httpcli/httpcli.h | 12 | ||||
-rw-r--r-- | src/core/httpcli/httpcli_security_connector.c | 8 |
3 files changed, 26 insertions, 26 deletions
diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c index 1196f237a0..fac80a44a1 100644 --- a/src/core/httpcli/httpcli.c +++ b/src/core/httpcli/httpcli.c @@ -73,7 +73,7 @@ static grpc_httpcli_get_override g_get_override = NULL; static grpc_httpcli_post_override g_post_override = NULL; static void -plaintext_handshake (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list), grpc_closure_list * closure_list) +plaintext_handshake (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list)) { on_done (arg, endpoint, closure_list); } @@ -94,10 +94,10 @@ grpc_httpcli_context_destroy (grpc_httpcli_context * context) grpc_pollset_set_destroy (&context->pollset_set); } -static void next_address (internal_request * req, grpc_closure_list * closure_list); +static void next_address (grpc_exec_ctx * exec_ctx, internal_request * req); static void -finish (internal_request * req, int success, grpc_closure_list * closure_list) +finish (grpc_exec_ctx * exec_ctx, internal_request * req, int success) { grpc_pollset_set_del_pollset (&req->context->pollset_set, req->pollset, closure_list); req->on_response (req->user_data, success ? &req->parser.r : NULL, closure_list); @@ -118,16 +118,16 @@ finish (internal_request * req, int success, grpc_closure_list * closure_list) gpr_free (req); } -static void on_read (void *user_data, int success, grpc_closure_list * closure_list); +static void on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success); static void -do_read (internal_request * req, grpc_closure_list * closure_list) +do_read (grpc_exec_ctx * exec_ctx, internal_request * req) { grpc_endpoint_read (req->ep, &req->incoming, &req->on_read, closure_list); } static void -on_read (void *user_data, int success, grpc_closure_list * closure_list) +on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success) { internal_request *req = user_data; size_t i; @@ -160,13 +160,13 @@ on_read (void *user_data, int success, grpc_closure_list * closure_list) } static void -on_written (internal_request * req, grpc_closure_list * closure_list) +on_written (grpc_exec_ctx * exec_ctx, internal_request * req) { do_read (req, closure_list); } static void -done_write (void *arg, int success, grpc_closure_list * closure_list) +done_write (grpc_exec_ctx * exec_ctx, void *arg, int success) { internal_request *req = arg; if (success) @@ -180,7 +180,7 @@ done_write (void *arg, int success, grpc_closure_list * closure_list) } static void -start_write (internal_request * req, grpc_closure_list * closure_list) +start_write (grpc_exec_ctx * exec_ctx, internal_request * req) { gpr_slice_ref (req->request_text); gpr_slice_buffer_add (&req->outgoing, req->request_text); @@ -188,7 +188,7 @@ start_write (internal_request * req, grpc_closure_list * closure_list) } static void -on_handshake_done (void *arg, grpc_endpoint * ep, grpc_closure_list * closure_list) +on_handshake_done (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * ep) { internal_request *req = arg; @@ -203,7 +203,7 @@ on_handshake_done (void *arg, grpc_endpoint * ep, grpc_closure_list * closure_li } static void -on_connected (void *arg, int success, grpc_closure_list * closure_list) +on_connected (grpc_exec_ctx * exec_ctx, void *arg, int success) { internal_request *req = arg; @@ -216,7 +216,7 @@ on_connected (void *arg, int success, grpc_closure_list * closure_list) } static void -next_address (internal_request * req, grpc_closure_list * closure_list) +next_address (grpc_exec_ctx * exec_ctx, internal_request * req) { grpc_resolved_address *addr; if (req->next_address == req->addresses->naddrs) @@ -230,7 +230,7 @@ next_address (internal_request * req, grpc_closure_list * closure_list) } static void -on_resolved (void *arg, grpc_resolved_addresses * addresses, grpc_closure_list * closure_list) +on_resolved (grpc_exec_ctx * exec_ctx, void *arg, grpc_resolved_addresses * addresses) { internal_request *req = arg; if (!addresses) @@ -244,7 +244,7 @@ on_resolved (void *arg, grpc_resolved_addresses * addresses, grpc_closure_list * } static void -internal_request_begin (grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, const char *name, gpr_slice request_text, grpc_closure_list * closure_list) +internal_request_begin (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, const char *name, gpr_slice request_text) { internal_request *req = gpr_malloc (sizeof (internal_request)); memset (req, 0, sizeof (*req)); @@ -268,7 +268,7 @@ internal_request_begin (grpc_httpcli_context * context, grpc_pollset * pollset, } 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, grpc_closure_list * closure_list) +grpc_httpcli_get (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data) { char *name; if (g_get_override && g_get_override (request, deadline, on_response, user_data, closure_list)) @@ -281,7 +281,7 @@ grpc_httpcli_get (grpc_httpcli_context * context, grpc_pollset * pollset, const } 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, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list) +grpc_httpcli_post (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, 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) { char *name; if (g_post_override && g_post_override (request, body_bytes, body_size, deadline, on_response, user_data, closure_list)) diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h index cfe7e4b2af..021d619900 100644 --- a/src/core/httpcli/httpcli.h +++ b/src/core/httpcli/httpcli.h @@ -64,7 +64,7 @@ typedef struct grpc_httpcli_context typedef struct { const char *default_port; - void (*handshake) (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list), grpc_closure_list * closure_list); + void (*handshake) (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list)); } grpc_httpcli_handshaker; extern const grpc_httpcli_handshaker grpc_httpcli_plaintext; @@ -100,7 +100,7 @@ typedef struct grpc_httpcli_response } grpc_httpcli_response; /* Callback for grpc_httpcli_get and grpc_httpcli_post. */ -typedef void (*grpc_httpcli_response_cb) (void *user_data, const grpc_httpcli_response * response, grpc_closure_list * closure_list); +typedef void (*grpc_httpcli_response_cb) (grpc_exec_ctx * exec_ctx, void *user_data, const grpc_httpcli_response * response); void grpc_httpcli_context_init (grpc_httpcli_context * context); void grpc_httpcli_context_destroy (grpc_httpcli_context * context); @@ -115,7 +115,7 @@ void grpc_httpcli_context_destroy (grpc_httpcli_context * context); 'deadline' contains a deadline for the request (or gpr_inf_future) 'on_response' is a callback to report results to (and 'user_data' is a user supplied pointer to pass to said call) */ -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, grpc_closure_list * closure_list); +void grpc_httpcli_get (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data); /* Asynchronously perform a HTTP POST. 'context' specifies the http context under which to do the post @@ -132,11 +132,11 @@ void grpc_httpcli_get (grpc_httpcli_context * context, grpc_pollset * pollset, c 'on_response' is a callback to report results to (and 'user_data' is a user supplied pointer to pass to said call) Does not support ?var1=val1&var2=val2 in the path. */ -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, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list); +void grpc_httpcli_post (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, 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); /* 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, grpc_closure_list * closure_list); -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, grpc_closure_list * closure_list); +typedef int (*grpc_httpcli_get_override) (grpc_exec_ctx * exec_ctx, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data); +typedef int (*grpc_httpcli_post_override) (grpc_exec_ctx * exec_ctx, 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); diff --git a/src/core/httpcli/httpcli_security_connector.c b/src/core/httpcli/httpcli_security_connector.c index 00fb1fa458..5760f27f09 100644 --- a/src/core/httpcli/httpcli_security_connector.c +++ b/src/core/httpcli/httpcli_security_connector.c @@ -63,7 +63,7 @@ httpcli_ssl_destroy (grpc_security_connector * sc) } static void -httpcli_ssl_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +httpcli_ssl_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { grpc_httpcli_ssl_channel_security_connector *c = (grpc_httpcli_ssl_channel_security_connector *) sc; tsi_result result = TSI_OK; @@ -143,12 +143,12 @@ httpcli_ssl_channel_security_connector_create (const unsigned char *pem_root_cer typedef struct { - void (*func) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list); + void (*func) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint); void *arg; } on_done_closure; static void -on_secure_transport_setup_done (void *rp, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint, grpc_closure_list * closure_list) +on_secure_transport_setup_done (grpc_exec_ctx * exec_ctx, void *rp, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint) { on_done_closure *c = rp; if (status != GRPC_SECURITY_OK) @@ -164,7 +164,7 @@ on_secure_transport_setup_done (void *rp, grpc_security_status status, grpc_endp } static void -ssl_handshake (void *arg, grpc_endpoint * tcp, const char *host, void (*on_done) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list), grpc_closure_list * closure_list) +ssl_handshake (void *arg, grpc_endpoint * tcp, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list)) { grpc_channel_security_connector *sc = NULL; const unsigned char *pem_root_certs = NULL; |