summaryrefslogtreecommitdiff
path: root/libpod/util.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-13 12:30:14 -0700
committerGitHub <noreply@github.com>2020-05-13 12:30:14 -0700
commit71f66f03c5dcf8ab65c741e64c60ce12b01218a8 (patch)
tree3000cb5cb03f019dd8b18386330552ca109e2612 /libpod/util.go
parent886b2cc4b10c32611b45da983fa9d1318d38356a (diff)
parentb6113e2b9ea8f397e345a09335c26f953994c6f4 (diff)
downloadpodman-71f66f03c5dcf8ab65c741e64c60ce12b01218a8.tar.gz
podman-71f66f03c5dcf8ab65c741e64c60ce12b01218a8.tar.bz2
podman-71f66f03c5dcf8ab65c741e64c60ce12b01218a8.zip
Merge pull request #6203 from jwhonce/wip/attach
V2 attach bindings and test
Diffstat (limited to 'libpod/util.go')
-rw-r--r--libpod/util.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/libpod/util.go b/libpod/util.go
index bdfd153ed..ba9f1fa05 100644
--- a/libpod/util.go
+++ b/libpod/util.go
@@ -249,9 +249,8 @@ func hijackWriteErrorAndClose(toWrite error, cid string, terminal bool, httpCon
// length and stream. Accepts an integer indicating which stream we are sending
// to (STDIN = 0, STDOUT = 1, STDERR = 2).
func makeHTTPAttachHeader(stream byte, length uint32) []byte {
- headerBuf := []byte{stream, 0, 0, 0}
- lenBuf := []byte{0, 0, 0, 0}
- binary.BigEndian.PutUint32(lenBuf, length)
- headerBuf = append(headerBuf, lenBuf...)
- return headerBuf
+ header := make([]byte, 8)
+ header[0] = stream
+ binary.BigEndian.PutUint32(header[4:], length)
+ return header
}