summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/exec.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-10 22:03:56 +0200
committerGitHub <noreply@github.com>2020-07-10 22:03:56 +0200
commit1d7175314c350b61b84ca4b2237d662e9b3f6c09 (patch)
treef6b0a8c94882669ce96fee0ddae5390f3b9aa2e7 /pkg/api/handlers/compat/exec.go
parent2ac8c6953481eb7391a6a7594709811f7ae3167f (diff)
parent324a02ec609f24aaba923a96266657d125228033 (diff)
downloadpodman-1d7175314c350b61b84ca4b2237d662e9b3f6c09.tar.gz
podman-1d7175314c350b61b84ca4b2237d662e9b3f6c09.tar.bz2
podman-1d7175314c350b61b84ca4b2237d662e9b3f6c09.zip
Merge pull request #6918 from skorhone/fix/hijacked_connection_handling
Fix: Correct connection counters for hijacked connections
Diffstat (limited to 'pkg/api/handlers/compat/exec.go')
-rw-r--r--pkg/api/handlers/compat/exec.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/pkg/api/handlers/compat/exec.go b/pkg/api/handlers/compat/exec.go
index aee4196dd..a3b8cb573 100644
--- a/pkg/api/handlers/compat/exec.go
+++ b/pkg/api/handlers/compat/exec.go
@@ -173,21 +173,11 @@ func ExecStartHandler(w http.ResponseWriter, r *http.Request) {
return
}
- // Hijack the connection
- hijacker, ok := w.(http.Hijacker)
- if !ok {
- utils.InternalServerError(w, errors.Errorf("unable to hijack connection"))
- return
- }
-
- connection, buffer, err := hijacker.Hijack()
+ connection, buffer, err := AttachConnection(w, r)
if err != nil {
- utils.InternalServerError(w, errors.Wrapf(err, "error hijacking connection"))
+ utils.InternalServerError(w, err)
return
}
-
- fmt.Fprintf(connection, AttachHeader)
-
logrus.Debugf("Hijack for attach of container %s exec session %s successful", sessionCtr.ID(), sessionID)
if err := sessionCtr.ExecHTTPStartAndAttach(sessionID, connection, buffer, nil, nil, nil); err != nil {