diff options
author | ctiller <ctiller@google.com> | 2014-12-09 14:39:16 -0800 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2014-12-09 16:20:55 -0800 |
commit | 18b49ab914ea5a57f22ed6d77520cd7d4372749b (patch) | |
tree | c2ec5971eebd10e3ef52c0c084c797b8d06bb267 /src/core/security | |
parent | 98bffb779b8c47f4d76c72c7807d9f1b1074a795 (diff) |
Introducing iomgr.
Move eventmanager and platform dependent endpoint functionality into a single
library called 'iomgr'.
This is primarily to prepare for a Windows port - where posix socket semantics
lead to poor quality code.
Mostly this is a code movement CL, with some small changes to help prepare the
way for porting:
- em style fd objects can only be held internally in iomgr, and own their memory
- added grpc_iomgr_create_endpoint_pair() to accomodate the common pattern of
creating a tcp endpoint from the output of socketpair - this will help keep
our tests portable
- separated em alarm interface into a separate file, as this part of event
manager is needed higher up the stack
- made the eventmanager bits a true singleton, simplifying API's across the
stack as there's no longer a reason to carry a pointer there.
Initial design document is here:
https://docs.google.com/document/d/1VmafcHvvrP5kwtQkz84R5yXF7u7fW-9Pn0bkSUQHDt8/edit?disco=AAAAARNByxg
Change on 2014/12/09 by ctiller <ctiller@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81716456
Diffstat (limited to 'src/core/security')
-rw-r--r-- | src/core/security/credentials.c | 14 | ||||
-rw-r--r-- | src/core/security/server_secure_chttp2.c | 7 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c index 7ff48f9123..bfc2e3361a 100644 --- a/src/core/security/credentials.c +++ b/src/core/security/credentials.c @@ -34,7 +34,7 @@ #include "src/core/security/credentials.h" #include "src/core/httpcli/httpcli.h" -#include "src/core/surface/surface_em.h" +#include "src/core/iomgr/iomgr.h" #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/string.h> @@ -379,7 +379,7 @@ static void compute_engine_get_request_metadata(grpc_credentials *creds, request.hdr_count = 1; request.hdrs = &header; grpc_httpcli_get( - &request, gpr_time_add(gpr_now(), refresh_threshold), grpc_surface_em(), + &request, gpr_time_add(gpr_now(), refresh_threshold), on_compute_engine_token_response, grpc_credentials_metadata_request_create(creds, cb, user_data)); } else { @@ -433,7 +433,8 @@ static int fake_oauth2_has_request_metadata_only( return 1; } -void on_simulated_token_fetch_done(void *user_data, grpc_em_cb_status status) { +void on_simulated_token_fetch_done(void *user_data, + grpc_iomgr_cb_status status) { grpc_credentials_metadata_request *r = (grpc_credentials_metadata_request *)user_data; grpc_fake_oauth2_credentials *c = (grpc_fake_oauth2_credentials *)r->creds; @@ -448,10 +449,9 @@ static void fake_oauth2_get_request_metadata(grpc_credentials *creds, grpc_fake_oauth2_credentials *c = (grpc_fake_oauth2_credentials *)creds; if (c->is_async) { - GPR_ASSERT(grpc_em_add_callback(grpc_surface_em(), - on_simulated_token_fetch_done, - grpc_credentials_metadata_request_create( - creds, cb, user_data)) == GRPC_EM_OK); + grpc_iomgr_add_callback( + on_simulated_token_fetch_done, + grpc_credentials_metadata_request_create(creds, cb, user_data)); } else { cb(user_data, &c->access_token_md, 1, GRPC_CREDENTIALS_OK); } diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c index 335d502217..28b56dd4c9 100644 --- a/src/core/security/server_secure_chttp2.c +++ b/src/core/security/server_secure_chttp2.c @@ -35,12 +35,11 @@ #include "src/core/channel/http_filter.h" #include "src/core/channel/http_server_filter.h" -#include "src/core/endpoint/resolve_address.h" -#include "src/core/endpoint/tcp_server.h" +#include "src/core/iomgr/resolve_address.h" +#include "src/core/iomgr/tcp_server.h" #include "src/core/security/security_context.h" #include "src/core/security/secure_transport_setup.h" #include "src/core/surface/server.h" -#include "src/core/surface/surface_em.h" #include "src/core/transport/chttp2_transport.h" #include <grpc/support/alloc.h> #include <grpc/support/log.h> @@ -101,7 +100,7 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr) { goto error; } - tcp = grpc_tcp_server_create(grpc_surface_em()); + tcp = grpc_tcp_server_create(); if (!tcp) { goto error; } |