diff options
author | Craig Tiller <ctiller@google.com> | 2015-08-26 15:37:47 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-08-26 15:37:47 -0700 |
commit | 8bf34083e2cf7336a75e39bc97d7aaeb26299512 (patch) | |
tree | f75213f7c3d3225e38d34a0e2d77856e40f4126c /src/core/iomgr | |
parent | 1e27e7d605e43ac6a4d7d2ace75c079f3569ddc0 (diff) |
Fix uninitialized data
Diffstat (limited to 'src/core/iomgr')
-rw-r--r-- | src/core/iomgr/tcp_posix.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c index 03be462960..0db7cd9f0e 100644 --- a/src/core/iomgr/tcp_posix.c +++ b/src/core/iomgr/tcp_posix.c @@ -85,8 +85,6 @@ typedef struct { grpc_iomgr_closure read_closure; grpc_iomgr_closure write_closure; - grpc_iomgr_closure handle_read_closure; - char *peer_string; } grpc_tcp; @@ -235,6 +233,7 @@ static void tcp_handle_read(void *arg /* grpc_tcp */, int success) { GPR_ASSERT(!tcp->finished_edge); if (!success) { + gpr_slice_buffer_reset_and_unref(tcp->incoming_buffer); call_read_cb(tcp, 0); TCP_UNREF(tcp, "read"); } else { @@ -255,8 +254,7 @@ static grpc_endpoint_op_status tcp_read(grpc_endpoint *ep, tcp->finished_edge = 0; grpc_fd_notify_on_read(tcp->em_fd, &tcp->read_closure); } else { - tcp->handle_read_closure.cb_arg = tcp; - grpc_iomgr_add_delayed_callback(&tcp->handle_read_closure, 1); + grpc_iomgr_add_delayed_callback(&tcp->read_closure, 1); } /* TODO(ctiller): immediate return */ return GRPC_ENDPOINT_PENDING; @@ -447,7 +445,6 @@ grpc_endpoint *grpc_tcp_create(grpc_fd *em_fd, size_t slice_size, tcp->write_closure.cb = tcp_handle_write; tcp->write_closure.cb_arg = tcp; - tcp->handle_read_closure.cb = tcp_handle_read; return &tcp->base; } |