aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2017-01-25 16:10:18 -0800
committerGravatar Yuchen Zeng <zyc@google.com>2017-01-25 16:10:18 -0800
commitbc8a70445deeb4099d97a82ef2db709b75c99933 (patch)
treeb913f2366c62298385cb72ce4da33cc577b911e6 /include
parentc77344940b6e0f028338e5099cc988740480cd0b (diff)
parent6f690f34831ac175a2c92d8838a5fc12ab8035b5 (diff)
Merge remote-tracking branch 'upstream/master' into cares_bazel_rule
Diffstat (limited to 'include')
-rw-r--r--include/grpc/impl/codegen/slice.h9
-rw-r--r--include/grpc/slice_buffer.h7
2 files changed, 14 insertions, 2 deletions
diff --git a/include/grpc/impl/codegen/slice.h b/include/grpc/impl/codegen/slice.h
index 00781bb76b..035260445e 100644
--- a/include/grpc/impl/codegen/slice.h
+++ b/include/grpc/impl/codegen/slice.h
@@ -93,11 +93,16 @@ typedef struct grpc_slice {
/* Represents an expandable array of slices, to be interpreted as a
single item. */
typedef struct {
- /* slices in the array */
+ /* This is for internal use only. External users (i.e any code outside grpc
+ * core) MUST NOT use this field */
+ grpc_slice *base_slices;
+
+ /* slices in the array (Points to the first valid grpc_slice in the array) */
grpc_slice *slices;
/* the number of slices in the array */
size_t count;
- /* the number of slices allocated in the array */
+ /* the number of slices allocated in the array. External users (i.e any code
+ * outside grpc core) MUST NOT use this field */
size_t capacity;
/* the combined length of all slices in the array */
size_t length;
diff --git a/include/grpc/slice_buffer.h b/include/grpc/slice_buffer.h
index f1de653af4..2ed896645b 100644
--- a/include/grpc/slice_buffer.h
+++ b/include/grpc/slice_buffer.h
@@ -77,8 +77,15 @@ GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer *src, size_t n,
/* move the first n bytes of src into dst */
GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
grpc_slice_buffer *dst);
+/* move the first n bytes of src into dst (copying them) */
+GPRAPI void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
+ grpc_slice_buffer *src,
+ size_t n, void *dst);
/* take the first slice in the slice buffer */
GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *src);
+/* undo the above with (a possibly different) \a slice */
+GPRAPI void grpc_slice_buffer_undo_take_first(grpc_slice_buffer *src,
+ grpc_slice slice);
#ifdef __cplusplus
}