Merge github.com:grpc/grpc into shindig

Conflicts:
	src/core/surface/secure_channel_create.c
pull/3423/head
Craig Tiller 9 years ago
commit b0bd53a173
  1. 2
      include/grpc++/security/auth_metadata_processor.h
  2. 2
      include/grpc++/security/credentials.h
  3. 2
      src/core/channel/channel_args.h
  4. 4
      src/core/iomgr/tcp_client_windows.c
  5. 8
      src/core/iomgr/tcp_server_windows.c
  6. 2
      src/cpp/client/secure_credentials.cc
  7. 8
      test/cpp/end2end/end2end_test.cc

@ -45,7 +45,7 @@ namespace grpc {
class AuthMetadataProcessor {
public:
typedef std::multimap<grpc::string_ref, grpc::string_ref> InputMetadata;
typedef std::multimap<grpc::string, grpc::string_ref> OutputMetadata;
typedef std::multimap<grpc::string, grpc::string> OutputMetadata;
virtual ~AuthMetadataProcessor() {}

@ -180,7 +180,7 @@ class MetadataCredentialsPlugin {
// Gets the auth metatada produced by this plugin.
virtual Status GetMetadata(
grpc::string_ref service_url,
std::multimap<grpc::string, grpc::string_ref>* metadata) = 0;
std::multimap<grpc::string, grpc::string>* metadata) = 0;
};
std::shared_ptr<Credentials> MetadataCredentialsFromPlugin(

@ -71,7 +71,7 @@ grpc_channel_args *grpc_channel_args_set_compression_algorithm(
* compression algorithms are enabled. It's an error to disable an algorithm set
* by grpc_channel_args_set_compression_algorithm.
*
* Returns an instance will the updated algorithm states. The \a a pointer is
* Returns an instance with the updated algorithm states. The \a a pointer is
* modified to point to the returned instance (which may be different from the
* input value of \a a). */
grpc_channel_args *grpc_channel_args_compression_algorithm_set_state(

@ -121,7 +121,7 @@ static void on_connect(void *acp, int from_iocp) {
notification request for the connection, and one timeout alert. */
void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp),
void *arg, grpc_pollset_set *interested_parties,
const struct sockaddr *addr, int addr_len,
const struct sockaddr *addr, size_t addr_len,
gpr_timespec deadline) {
SOCKET sock = INVALID_SOCKET;
BOOL success;
@ -176,7 +176,7 @@ void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp),
socket = grpc_winsocket_create(sock, "client");
info = &socket->write_info;
success = ConnectEx(sock, addr, addr_len, NULL, 0, NULL, &info->overlapped);
success = ConnectEx(sock, addr, (int)addr_len, NULL, 0, NULL, &info->overlapped);
/* It wouldn't be unusual to get a success immediately. But we'll still get
an IOCP notification, so let's ignore it. */

@ -155,7 +155,7 @@ void grpc_tcp_server_destroy(grpc_tcp_server *s,
/* Prepare (bind) a recently-created socket for listening. */
static int prepare_socket(SOCKET sock, const struct sockaddr *addr,
int addr_len) {
size_t addr_len) {
struct sockaddr_storage sockname_temp;
socklen_t sockname_len;
@ -168,7 +168,7 @@ static int prepare_socket(SOCKET sock, const struct sockaddr *addr,
goto error;
}
if (bind(sock, addr, addr_len) == SOCKET_ERROR) {
if (bind(sock, addr, (int)addr_len) == SOCKET_ERROR) {
char *addr_str;
char *utf8_message = gpr_format_message(WSAGetLastError());
grpc_sockaddr_to_string(&addr_str, addr, 0);
@ -355,7 +355,7 @@ static void on_accept(void *arg, int from_iocp) {
}
static int add_socket_to_server(grpc_tcp_server *s, SOCKET sock,
const struct sockaddr *addr, int addr_len) {
const struct sockaddr *addr, size_t addr_len) {
server_port *sp;
int port;
int status;
@ -402,7 +402,7 @@ static int add_socket_to_server(grpc_tcp_server *s, SOCKET sock,
}
int grpc_tcp_server_add_port(grpc_tcp_server *s, const void *addr,
int addr_len) {
size_t addr_len) {
int allocated_port = -1;
unsigned i;
SOCKET sock;

@ -173,7 +173,7 @@ void MetadataCredentialsPluginWrapper::GetMetadata(
void MetadataCredentialsPluginWrapper::InvokePlugin(
const char* service_url, grpc_credentials_plugin_metadata_cb cb,
void* user_data) {
std::multimap<grpc::string, grpc::string_ref> metadata;
std::multimap<grpc::string, grpc::string> metadata;
Status status = plugin_->GetMetadata(service_url, &metadata);
std::vector<grpc_metadata> md;
for (auto it = metadata.begin(); it != metadata.end(); ++it) {

@ -121,7 +121,7 @@ class TestMetadataCredentialsPlugin : public MetadataCredentialsPlugin {
bool IsBlocking() const GRPC_OVERRIDE { return is_blocking_; }
Status GetMetadata(grpc::string_ref service_url,
std::multimap<grpc::string, grpc::string_ref>* metadata)
std::multimap<grpc::string, grpc::string>* metadata)
GRPC_OVERRIDE {
EXPECT_GT(service_url.length(), 0UL);
EXPECT_TRUE(metadata != nullptr);
@ -175,9 +175,9 @@ class TestAuthMetadataProcessor : public AuthMetadataProcessor {
if (auth_md_value == kGoodGuy) {
context->AddProperty(kIdentityPropName, kGoodGuy);
context->SetPeerIdentityPropertyName(kIdentityPropName);
consumed_auth_metadata->insert(
std::make_pair(string(auth_md->first.data(), auth_md->first.length()),
auth_md->second));
consumed_auth_metadata->insert(std::make_pair(
string(auth_md->first.data(), auth_md->first.length()),
string(auth_md->second.data(), auth_md->second.length())));
return Status::OK;
} else {
return Status(StatusCode::UNAUTHENTICATED,

Loading…
Cancel
Save