aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/tcp_uv.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-10-26 21:08:10 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-10-26 21:08:10 -0700
commit618e67d655d8a0a345463d6e3e690e258dadd763 (patch)
treea886d8746523a58d9e6f42d31a99b2c943fdb2e4 /src/core/lib/iomgr/tcp_uv.c
parent2d75209fa8f3e43e4b7994b99b7d09e5116402ab (diff)
s/GPR_SLICE/GRPC_SLICE/g
Diffstat (limited to 'src/core/lib/iomgr/tcp_uv.c')
-rw-r--r--src/core/lib/iomgr/tcp_uv.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/lib/iomgr/tcp_uv.c b/src/core/lib/iomgr/tcp_uv.c
index 05d6eeb240..f44829959d 100644
--- a/src/core/lib/iomgr/tcp_uv.c
+++ b/src/core/lib/iomgr/tcp_uv.c
@@ -59,9 +59,9 @@ typedef struct {
grpc_closure *read_cb;
grpc_closure *write_cb;
- gpr_slice read_slice;
- gpr_slice_buffer *read_slices;
- gpr_slice_buffer *write_slices;
+ GRPC_SLICE read_slice;
+ GRPC_SLICE_buffer *read_slices;
+ GRPC_SLICE_buffer *write_slices;
uv_buf_t *write_buffers;
bool shutting_down;
@@ -108,14 +108,14 @@ static void alloc_uv_buf(uv_handle_t *handle, size_t suggested_size,
uv_buf_t *buf) {
grpc_tcp *tcp = handle->data;
(void)suggested_size;
- tcp->read_slice = gpr_slice_malloc(GRPC_TCP_DEFAULT_READ_SLICE_SIZE);
- buf->base = (char *)GPR_SLICE_START_PTR(tcp->read_slice);
- buf->len = GPR_SLICE_LENGTH(tcp->read_slice);
+ tcp->read_slice = GRPC_SLICE_malloc(GRPC_TCP_DEFAULT_READ_SLICE_SIZE);
+ buf->base = (char *)GRPC_SLICE_START_PTR(tcp->read_slice);
+ buf->len = GRPC_SLICE_LENGTH(tcp->read_slice);
}
static void read_callback(uv_stream_t *stream, ssize_t nread,
const uv_buf_t *buf) {
- gpr_slice sub;
+ GRPC_SLICE sub;
grpc_error *error;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_tcp *tcp = stream->data;
@@ -132,8 +132,8 @@ static void read_callback(uv_stream_t *stream, ssize_t nread,
error = GRPC_ERROR_CREATE("EOF");
} else if (nread > 0) {
// Successful read
- sub = gpr_slice_sub_no_ref(tcp->read_slice, 0, (size_t)nread);
- gpr_slice_buffer_add(tcp->read_slices, sub);
+ sub = GRPC_SLICE_sub_no_ref(tcp->read_slice, 0, (size_t)nread);
+ GRPC_SLICE_buffer_add(tcp->read_slices, sub);
error = GRPC_ERROR_NONE;
if (grpc_tcp_trace) {
size_t i;
@@ -157,14 +157,14 @@ static void read_callback(uv_stream_t *stream, ssize_t nread,
}
static void uv_endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *read_slices, grpc_closure *cb) {
+ GRPC_SLICE_buffer *read_slices, grpc_closure *cb) {
grpc_tcp *tcp = (grpc_tcp *)ep;
int status;
grpc_error *error = GRPC_ERROR_NONE;
GPR_ASSERT(tcp->read_cb == NULL);
tcp->read_cb = cb;
tcp->read_slices = read_slices;
- gpr_slice_buffer_reset_and_unref(read_slices);
+ GRPC_SLICE_buffer_reset_and_unref(read_slices);
TCP_REF(tcp, "read");
// TODO(murgatroid99): figure out what the return value here means
status =
@@ -204,13 +204,13 @@ static void write_callback(uv_write_t *req, int status) {
}
static void uv_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *write_slices,
+ GRPC_SLICE_buffer *write_slices,
grpc_closure *cb) {
grpc_tcp *tcp = (grpc_tcp *)ep;
uv_buf_t *buffers;
unsigned int buffer_count;
unsigned int i;
- gpr_slice *slice;
+ GRPC_SLICE *slice;
uv_write_t *write_req;
if (grpc_tcp_trace) {
@@ -245,8 +245,8 @@ static void uv_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
buffers = gpr_malloc(sizeof(uv_buf_t) * buffer_count);
for (i = 0; i < buffer_count; i++) {
slice = &tcp->write_slices->slices[i];
- buffers[i].base = (char *)GPR_SLICE_START_PTR(*slice);
- buffers[i].len = GPR_SLICE_LENGTH(*slice);
+ buffers[i].base = (char *)GRPC_SLICE_START_PTR(*slice);
+ buffers[i].len = GRPC_SLICE_LENGTH(*slice);
}
write_req = gpr_malloc(sizeof(uv_write_t));
write_req->data = tcp;