aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar vjpai <vpai@google.com>2016-01-07 10:20:46 -0800
committerGravatar vjpai <vpai@google.com>2016-01-07 10:20:46 -0800
commitde332dfcac51e080e4c294d183906e5969672133 (patch)
tree0cab8680a3c7cd108eebc139cb207fbcd912f49d /src
parent18c0477528169c2032a57b5da094964a6d4beb2f (diff)
Refactor server side to support generic tests.
Diffstat (limited to 'src')
-rw-r--r--src/cpp/util/byte_buffer.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc
index 467f0007de..91e202023c 100644
--- a/src/cpp/util/byte_buffer.cc
+++ b/src/cpp/util/byte_buffer.cc
@@ -89,4 +89,10 @@ ByteBuffer::ByteBuffer(const ByteBuffer& buf):
buffer_(grpc_byte_buffer_copy(buf.buffer_)) {
}
+ByteBuffer& ByteBuffer::operator=(const ByteBuffer& buf) {
+ Clear(); // first remove existing data
+ buffer_ = grpc_byte_buffer_copy(buf.buffer_); // then copy
+ return *this;
+}
+
} // namespace grpc