summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/buffer/view.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-11-05 15:38:32 -0800
committerShentubot <shentubot@google.com>2018-11-05 15:39:30 -0800
commit37cbce1f9156109a58ae3d350f8e0e9d027b3785 (patch)
treea76b631fd031c1f348562cc9b3a2275b43fb1556 /pkg/tcpip/buffer/view.go
parent704b56a40d0a041a4e6f814c3dbb1f9ec15f9002 (diff)
Merge segments in sender's writeList
PiperOrigin-RevId: 220185891 Change-Id: Iaea73fd7b2fa8c399b989cdcaabf4885f370df4b
Diffstat (limited to 'pkg/tcpip/buffer/view.go')
-rw-r--r--pkg/tcpip/buffer/view.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/tcpip/buffer/view.go b/pkg/tcpip/buffer/view.go
index 24479ea40..6c70e0d69 100644
--- a/pkg/tcpip/buffer/view.go
+++ b/pkg/tcpip/buffer/view.go
@@ -144,3 +144,9 @@ func (vv VectorisedView) ToView() View {
func (vv VectorisedView) Views() []View {
return vv.views
}
+
+// Append appends the views in a vectorised view to this vectorised view.
+func (vv *VectorisedView) Append(vv2 *VectorisedView) {
+ vv.views = append(vv.views, vv2.views...)
+ vv.size += vv2.size
+}