More fixes.

pull/4902/head
Nicolas "Pixel" Noble 9 years ago
parent 1d44510083
commit bd76a63a6f
  1. 4
      src/core/iomgr/iocp_windows.c
  2. 4
      src/core/iomgr/tcp_windows.c
  3. 5
      src/core/support/env_win32.c

@ -67,7 +67,7 @@ static DWORD deadline_to_millis_timeout(gpr_timespec deadline,
return 0;
}
timeout = gpr_time_sub(deadline, now);
return gpr_time_to_millis(gpr_time_add(
return (DWORD)gpr_time_to_millis(gpr_time_add(
timeout, gpr_time_from_nanos(GPR_NS_PER_MS - 1, GPR_TIMESPAN)));
}
@ -179,11 +179,9 @@ void grpc_iocp_add_socket(grpc_winsocket *socket) {
static void socket_notify_on_iocp(grpc_exec_ctx *exec_ctx,
grpc_winsocket *socket, grpc_closure *closure,
grpc_winsocket_callback_info *info) {
int run_now = 0;
GPR_ASSERT(info->closure == NULL);
gpr_mu_lock(&socket->state_mu);
if (info->has_pending_iocp) {
run_now = 1;
info->has_pending_iocp = 0;
grpc_exec_ctx_enqueue(exec_ctx, closure, 1);
} else {

@ -143,10 +143,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, int success) {
grpc_closure *cb = tcp->read_cb;
grpc_winsocket *socket = tcp->socket;
gpr_slice sub;
gpr_slice *slice = NULL;
size_t nslices = 0;
grpc_winsocket_callback_info *info = &socket->read_info;
int do_abort = 0;
if (success) {
if (socket->read_info.wsa_error != 0 && !tcp->shutting_down) {
@ -238,7 +235,6 @@ static void on_write(grpc_exec_ctx *exec_ctx, void *tcpp, int success) {
grpc_winsocket *handle = tcp->socket;
grpc_winsocket_callback_info *info = &handle->write_info;
grpc_closure *cb;
int do_abort = 0;
gpr_mu_lock(&tcp->mu);
cb = tcp->write_cb;

@ -38,7 +38,12 @@
#include "src/core/support/env.h"
#include "src/core/support/string.h"
#ifdef __MINGW32__
errno_t getenv_s(size_t *size_needed, char *buffer, size_t size,
const char *varname);
#else
#include <stdlib.h>
#endif
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

Loading…
Cancel
Save