aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/http')
-rw-r--r--src/core/lib/http/httpcli.c13
-rw-r--r--src/core/lib/http/httpcli_security_connector.c19
2 files changed, 18 insertions, 14 deletions
diff --git a/src/core/lib/http/httpcli.c b/src/core/lib/http/httpcli.c
index 581a74b73f..fb2108987b 100644
--- a/src/core/lib/http/httpcli.c
+++ b/src/core/lib/http/httpcli.c
@@ -47,6 +47,7 @@
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/support/string.h"
typedef struct {
@@ -111,14 +112,14 @@ static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
if (req->ep != NULL) {
grpc_endpoint_destroy(exec_ctx, req->ep);
}
- grpc_slice_unref(req->request_text);
+ grpc_slice_unref_internal(exec_ctx, req->request_text);
gpr_free(req->host);
gpr_free(req->ssl_host_override);
grpc_iomgr_unregister_object(&req->iomgr_obj);
- grpc_slice_buffer_destroy(&req->incoming);
- grpc_slice_buffer_destroy(&req->outgoing);
+ grpc_slice_buffer_destroy_internal(exec_ctx, &req->incoming);
+ grpc_slice_buffer_destroy_internal(exec_ctx, &req->outgoing);
GRPC_ERROR_UNREF(req->overall_error);
- grpc_resource_quota_internal_unref(exec_ctx, req->resource_quota);
+ grpc_resource_quota_unref_internal(exec_ctx, req->resource_quota);
gpr_free(req);
}
@@ -178,7 +179,7 @@ static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
}
static void start_write(grpc_exec_ctx *exec_ctx, internal_request *req) {
- grpc_slice_ref(req->request_text);
+ grpc_slice_ref_internal(req->request_text);
grpc_slice_buffer_add(&req->outgoing, req->request_text);
grpc_endpoint_write(exec_ctx, req->ep, &req->outgoing, &req->done_write);
}
@@ -266,7 +267,7 @@ static void internal_request_begin(grpc_exec_ctx *exec_ctx,
req->context = context;
req->pollent = pollent;
req->overall_error = GRPC_ERROR_NONE;
- req->resource_quota = grpc_resource_quota_internal_ref(resource_quota);
+ req->resource_quota = grpc_resource_quota_ref_internal(resource_quota);
grpc_closure_init(&req->on_read, on_read, req, grpc_schedule_on_exec_ctx);
grpc_closure_init(&req->done_write, done_write, req,
grpc_schedule_on_exec_ctx);
diff --git a/src/core/lib/http/httpcli_security_connector.c b/src/core/lib/http/httpcli_security_connector.c
index 6b197c2e35..440817c5a6 100644
--- a/src/core/lib/http/httpcli_security_connector.c
+++ b/src/core/lib/http/httpcli_security_connector.c
@@ -41,6 +41,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/security/transport/security_handshaker.h"
+#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/support/string.h"
#include "src/core/lib/tsi/ssl_transport_security.h"
@@ -50,7 +51,8 @@ typedef struct {
char *secure_peer_name;
} grpc_httpcli_ssl_channel_security_connector;
-static void httpcli_ssl_destroy(grpc_security_connector *sc) {
+static void httpcli_ssl_destroy(grpc_exec_ctx *exec_ctx,
+ grpc_security_connector *sc) {
grpc_httpcli_ssl_channel_security_connector *c =
(grpc_httpcli_ssl_channel_security_connector *)sc;
if (c->handshaker_factory != NULL) {
@@ -104,8 +106,9 @@ static grpc_security_connector_vtable httpcli_ssl_vtable = {
httpcli_ssl_destroy, httpcli_ssl_check_peer};
static grpc_security_status httpcli_ssl_channel_security_connector_create(
- const unsigned char *pem_root_certs, size_t pem_root_certs_size,
- const char *secure_peer_name, grpc_channel_security_connector **sc) {
+ grpc_exec_ctx *exec_ctx, const unsigned char *pem_root_certs,
+ size_t pem_root_certs_size, const char *secure_peer_name,
+ grpc_channel_security_connector **sc) {
tsi_result result = TSI_OK;
grpc_httpcli_ssl_channel_security_connector *c;
@@ -129,7 +132,7 @@ static grpc_security_status httpcli_ssl_channel_security_connector_create(
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
tsi_result_to_string(result));
- httpcli_ssl_destroy(&c->base.base);
+ httpcli_ssl_destroy(exec_ctx, &c->base.base);
*sc = NULL;
return GRPC_SECURITY_ERROR;
}
@@ -156,8 +159,8 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error_free_string(msg);
c->func(exec_ctx, c->arg, NULL);
} else {
- grpc_channel_args_destroy(args->args);
- grpc_slice_buffer_destroy(args->read_buffer);
+ grpc_channel_args_destroy(exec_ctx, args->args);
+ grpc_slice_buffer_destroy_internal(exec_ctx, args->read_buffer);
gpr_free(args->read_buffer);
c->func(exec_ctx, c->arg, args->endpoint);
}
@@ -184,14 +187,14 @@ static void ssl_handshake(grpc_exec_ctx *exec_ctx, void *arg,
c->arg = arg;
c->handshake_mgr = grpc_handshake_manager_create();
GPR_ASSERT(httpcli_ssl_channel_security_connector_create(
- pem_root_certs, pem_root_certs_size, host, &sc) ==
+ exec_ctx, pem_root_certs, pem_root_certs_size, host, &sc) ==
GRPC_SECURITY_OK);
grpc_channel_security_connector_add_handshakers(exec_ctx, sc,
c->handshake_mgr);
grpc_handshake_manager_do_handshake(
exec_ctx, c->handshake_mgr, tcp, NULL /* channel_args */, deadline,
NULL /* acceptor */, on_handshake_done, c /* user_data */);
- GRPC_SECURITY_CONNECTOR_UNREF(&sc->base, "httpcli");
+ GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, &sc->base, "httpcli");
}
const grpc_httpcli_handshaker grpc_httpcli_ssl = {"https", ssl_handshake};