pull/19486/head
Juanli Shen 5 years ago
parent 57d522eda3
commit 4c96998eb1
  1. 19
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  2. 4
      src/core/lib/iomgr/iocp_windows.cc
  3. 2
      src/core/lib/iomgr/socket_windows.h
  4. 14
      src/core/lib/iomgr/tcp_windows.cc
  5. 2
      tools/interop_matrix/client_matrix.py

@ -459,12 +459,13 @@ class GrpcPolledFdWindows : public GrpcPolledFd {
connect_done_ = true;
GPR_ASSERT(wsa_connect_error_ == 0);
if (error == GRPC_ERROR_NONE) {
DWORD transfered_bytes = 0;
DWORD transferred_bytes = 0;
DWORD flags;
BOOL wsa_success = WSAGetOverlappedResult(
grpc_winsocket_wrapped_socket(winsocket_),
&winsocket_->write_info.overlapped, &transfered_bytes, FALSE, &flags);
GPR_ASSERT(transfered_bytes == 0);
BOOL wsa_success =
WSAGetOverlappedResult(grpc_winsocket_wrapped_socket(winsocket_),
&winsocket_->write_info.overlapped,
&transferred_bytes, FALSE, &flags);
GPR_ASSERT(transferred_bytes == 0);
if (!wsa_success) {
wsa_connect_error_ = WSAGetLastError();
char* msg = gpr_format_message(wsa_connect_error_);
@ -620,8 +621,8 @@ class GrpcPolledFdWindows : public GrpcPolledFd {
}
}
if (error == GRPC_ERROR_NONE) {
read_buf_ = grpc_slice_sub_no_ref(read_buf_, 0,
winsocket_->read_info.bytes_transfered);
read_buf_ = grpc_slice_sub_no_ref(
read_buf_, 0, winsocket_->read_info.bytes_transferred);
read_buf_has_data_ = true;
} else {
grpc_slice_unref_internal(read_buf_);
@ -657,9 +658,9 @@ class GrpcPolledFdWindows : public GrpcPolledFd {
if (error == GRPC_ERROR_NONE) {
tcp_write_state_ = WRITE_WAITING_FOR_VERIFICATION_UPON_RETRY;
write_buf_ = grpc_slice_sub_no_ref(
write_buf_, 0, winsocket_->write_info.bytes_transfered);
write_buf_, 0, winsocket_->write_info.bytes_transferred);
GRPC_CARES_TRACE_LOG("fd:|%s| OnIocpWriteableInner. bytes transferred:%d",
GetName(), winsocket_->write_info.bytes_transfered);
GetName(), winsocket_->write_info.bytes_transferred);
} else {
grpc_slice_unref_internal(write_buf_);
write_buf_ = grpc_empty_slice();

@ -90,12 +90,12 @@ grpc_iocp_work_status grpc_iocp_work(grpc_millis deadline) {
abort();
}
if (socket->shutdown_called) {
info->bytes_transfered = 0;
info->bytes_transferred = 0;
info->wsa_error = WSA_OPERATION_ABORTED;
} else {
success = WSAGetOverlappedResult(socket->socket, &info->overlapped, &bytes,
FALSE, &flags);
info->bytes_transfered = bytes;
info->bytes_transferred = bytes;
info->wsa_error = success ? 0 : WSAGetLastError();
}
GPR_ASSERT(overlapped == &info->overlapped);

@ -59,7 +59,7 @@ typedef struct grpc_winsocket_callback_info {
to hold a mutex for a long amount of time. */
int has_pending_iocp;
/* The results of the overlapped operation. */
DWORD bytes_transfered;
DWORD bytes_transferred;
int wsa_error;
} grpc_winsocket_callback_info;

@ -196,17 +196,17 @@ static void on_read(void* tcpp, grpc_error* error) {
gpr_free(utf8_message);
grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices);
} else {
if (info->bytes_transfered != 0 && !tcp->shutting_down) {
GPR_ASSERT((size_t)info->bytes_transfered <= tcp->read_slices->length);
if (static_cast<size_t>(info->bytes_transfered) !=
if (info->bytes_transferred != 0 && !tcp->shutting_down) {
GPR_ASSERT((size_t)info->bytes_transferred <= tcp->read_slices->length);
if (static_cast<size_t>(info->bytes_transferred) !=
tcp->read_slices->length) {
grpc_slice_buffer_trim_end(
tcp->read_slices,
tcp->read_slices->length -
static_cast<size_t>(info->bytes_transfered),
static_cast<size_t>(info->bytes_transferred),
&tcp->last_read_buffer);
}
GPR_ASSERT((size_t)info->bytes_transfered == tcp->read_slices->length);
GPR_ASSERT((size_t)info->bytes_transferred == tcp->read_slices->length);
if (grpc_tcp_trace.enabled()) {
size_t i;
@ -288,7 +288,7 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices,
/* Did we get data immediately ? Yay. */
if (info->wsa_error != WSAEWOULDBLOCK) {
info->bytes_transfered = bytes_read;
info->bytes_transferred = bytes_read;
GRPC_CLOSURE_SCHED(&tcp->on_read, GRPC_ERROR_NONE);
return;
}
@ -333,7 +333,7 @@ static void on_write(void* tcpp, grpc_error* error) {
if (info->wsa_error != 0) {
error = GRPC_WSA_ERROR(info->wsa_error, "WSASend");
} else {
GPR_ASSERT(info->bytes_transfered == tcp->write_slices->length);
GPR_ASSERT(info->bytes_transferred == tcp->write_slices->length);
}
}

@ -284,7 +284,7 @@ LANG_RELEASE_MATRIX = {
('v1.16.0', ReleaseInfo(testcases_file='php__v1.0.1')),
('v1.17.1', ReleaseInfo(testcases_file='php__v1.0.1')),
('v1.18.0', ReleaseInfo()),
# v1.19 and v1.20 were deliberately ommitted here because of an issue.
# v1.19 and v1.20 were deliberately omitted here because of an issue.
# See https://github.com/grpc/grpc/issues/18264
('v1.21.4', ReleaseInfo()),
]),

Loading…
Cancel
Save