|
|
@ -233,7 +233,7 @@ static void on_read(void* tcpp, grpc_error* error) { |
|
|
|
|
|
|
|
|
|
|
|
tcp->read_cb = NULL; |
|
|
|
tcp->read_cb = NULL; |
|
|
|
TCP_UNREF(tcp, "read"); |
|
|
|
TCP_UNREF(tcp, "read"); |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, cb, error); |
|
|
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_TARGET_READ_SIZE 8192 |
|
|
|
#define DEFAULT_TARGET_READ_SIZE 8192 |
|
|
@ -254,9 +254,10 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (tcp->shutting_down) { |
|
|
|
if (tcp->shutting_down) { |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, cb, |
|
|
|
grpc_core::ExecCtx::Run( |
|
|
|
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( |
|
|
|
DEBUG_LOCATION, cb, |
|
|
|
"TCP socket is shutting down", &tcp->shutdown_error, 1)); |
|
|
|
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( |
|
|
|
|
|
|
|
"TCP socket is shutting down", &tcp->shutdown_error, 1)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -289,7 +290,7 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices, |
|
|
|
/* Did we get data immediately ? Yay. */ |
|
|
|
/* Did we get data immediately ? Yay. */ |
|
|
|
if (info->wsa_error != WSAEWOULDBLOCK) { |
|
|
|
if (info->wsa_error != WSAEWOULDBLOCK) { |
|
|
|
info->bytes_transferred = bytes_read; |
|
|
|
info->bytes_transferred = bytes_read; |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, &tcp->on_read, GRPC_ERROR_NONE); |
|
|
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &tcp->on_read, GRPC_ERROR_NONE); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -302,8 +303,8 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices, |
|
|
|
int wsa_error = WSAGetLastError(); |
|
|
|
int wsa_error = WSAGetLastError(); |
|
|
|
if (wsa_error != WSA_IO_PENDING) { |
|
|
|
if (wsa_error != WSA_IO_PENDING) { |
|
|
|
info->wsa_error = wsa_error; |
|
|
|
info->wsa_error = wsa_error; |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, &tcp->on_read, |
|
|
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &tcp->on_read, |
|
|
|
GRPC_WSA_ERROR(info->wsa_error, "WSARecv")); |
|
|
|
GRPC_WSA_ERROR(info->wsa_error, "WSARecv")); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -338,7 +339,7 @@ static void on_write(void* tcpp, grpc_error* error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TCP_UNREF(tcp, "write"); |
|
|
|
TCP_UNREF(tcp, "write"); |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, cb, error); |
|
|
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Initiates a write. */ |
|
|
|
/* Initiates a write. */ |
|
|
@ -366,9 +367,10 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (tcp->shutting_down) { |
|
|
|
if (tcp->shutting_down) { |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, cb, |
|
|
|
grpc_core::ExecCtx::Run( |
|
|
|
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( |
|
|
|
DEBUG_LOCATION, cb, |
|
|
|
"TCP socket is shutting down", &tcp->shutdown_error, 1)); |
|
|
|
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( |
|
|
|
|
|
|
|
"TCP socket is shutting down", &tcp->shutdown_error, 1)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -399,7 +401,7 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, |
|
|
|
grpc_error* error = status == 0 |
|
|
|
grpc_error* error = status == 0 |
|
|
|
? GRPC_ERROR_NONE |
|
|
|
? GRPC_ERROR_NONE |
|
|
|
: GRPC_WSA_ERROR(info->wsa_error, "WSASend"); |
|
|
|
: GRPC_WSA_ERROR(info->wsa_error, "WSASend"); |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, cb, error); |
|
|
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error); |
|
|
|
if (allocated) gpr_free(allocated); |
|
|
|
if (allocated) gpr_free(allocated); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -417,7 +419,8 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, |
|
|
|
int wsa_error = WSAGetLastError(); |
|
|
|
int wsa_error = WSAGetLastError(); |
|
|
|
if (wsa_error != WSA_IO_PENDING) { |
|
|
|
if (wsa_error != WSA_IO_PENDING) { |
|
|
|
TCP_UNREF(tcp, "write"); |
|
|
|
TCP_UNREF(tcp, "write"); |
|
|
|
ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_WSA_ERROR(wsa_error, "WSASend")); |
|
|
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, |
|
|
|
|
|
|
|
GRPC_WSA_ERROR(wsa_error, "WSASend")); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|