aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/httpcli
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-02-25 18:10:24 -0800
committerGravatar Vijay Pai <vpai@google.com>2016-02-25 18:10:24 -0800
commite9ef53645150f7a0400a5f9be770eb2b4ba335b5 (patch)
tree34a8b7094b851589eec500b2ca419b64c9051d89 /src/core/httpcli
parente3cd25684051de21e4b1ba93173c06e72fa5ffad (diff)
Revert "Add an implementation firewall against pollset_set"
Diffstat (limited to 'src/core/httpcli')
-rw-r--r--src/core/httpcli/httpcli.c24
-rw-r--r--src/core/httpcli/httpcli.h3
2 files changed, 12 insertions, 15 deletions
diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c
index 1219c444c7..71237bb614 100644
--- a/src/core/httpcli/httpcli.c
+++ b/src/core/httpcli/httpcli.c
@@ -31,22 +31,20 @@
*
*/
-#include "src/core/httpcli/httpcli.h"
#include "src/core/iomgr/sockaddr.h"
+#include "src/core/httpcli/httpcli.h"
#include <string.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/httpcli/format_request.h"
-#include "src/core/httpcli/parser.h"
#include "src/core/iomgr/endpoint.h"
-#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/resolve_address.h"
#include "src/core/iomgr/tcp_client.h"
+#include "src/core/httpcli/format_request.h"
+#include "src/core/httpcli/parser.h"
#include "src/core/support/string.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
typedef struct {
gpr_slice request_text;
@@ -86,18 +84,18 @@ const grpc_httpcli_handshaker grpc_httpcli_plaintext = {"http",
plaintext_handshake};
void grpc_httpcli_context_init(grpc_httpcli_context *context) {
- context->pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_init(&context->pollset_set);
}
void grpc_httpcli_context_destroy(grpc_httpcli_context *context) {
- grpc_pollset_set_destroy(context->pollset_set);
+ grpc_pollset_set_destroy(&context->pollset_set);
}
static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req);
static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
int success) {
- grpc_pollset_set_del_pollset(exec_ctx, req->context->pollset_set,
+ grpc_pollset_set_del_pollset(exec_ctx, &req->context->pollset_set,
req->pollset);
req->on_response(exec_ctx, req->user_data, success ? &req->parser.r : NULL);
grpc_httpcli_parser_destroy(&req->parser);
@@ -199,7 +197,7 @@ static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req) {
addr = &req->addresses->addrs[req->next_address++];
grpc_closure_init(&req->connected, on_connected, req);
grpc_tcp_client_connect(
- exec_ctx, &req->connected, &req->ep, req->context->pollset_set,
+ exec_ctx, &req->connected, &req->ep, &req->context->pollset_set,
(struct sockaddr *)&addr->addr, addr->len, req->deadline);
}
@@ -239,7 +237,7 @@ static void internal_request_begin(
req->host = gpr_strdup(request->host);
req->ssl_host_override = gpr_strdup(request->ssl_host_override);
- grpc_pollset_set_add_pollset(exec_ctx, req->context->pollset_set,
+ grpc_pollset_set_add_pollset(exec_ctx, &req->context->pollset_set,
req->pollset);
grpc_resolve_address(request->host, req->handshaker->default_port,
on_resolved, req);
diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h
index 86e17c1d69..30875d71f1 100644
--- a/src/core/httpcli/httpcli.h
+++ b/src/core/httpcli/httpcli.h
@@ -39,7 +39,6 @@
#include <grpc/support/time.h>
#include "src/core/iomgr/endpoint.h"
-#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/pollset_set.h"
/* User agent this library reports */
@@ -57,7 +56,7 @@ typedef struct grpc_httpcli_header {
TODO(ctiller): allow caching and capturing multiple requests for the
same content and combining them */
typedef struct grpc_httpcli_context {
- grpc_pollset_set *pollset_set;
+ grpc_pollset_set pollset_set;
} grpc_httpcli_context;
typedef struct {