Skip to content

Commit

Permalink
net/http: missing error handling during hijacking
Browse files Browse the repository at this point in the history
  • Loading branch information
das7pad committed Dec 27, 2024
1 parent 9f49d26 commit a04c13e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/net/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ func (c *conn) hijackLocked(w *response) (rwc net.Conn, buf *bufio.ReadWriter, e
}

ccn := &connCloseNotify{rwc: rwc, weakResponse: weak.Make(w)}
ccn.attach(c.bufr)
if err := ccn.attach(c.bufr); err != nil {
return nil, nil, fmt.Errorf("unexpected Peek failure while reattaching buffer: %v", err)
}
c.bufw.Reset(rwc)
buf = bufio.NewReadWriter(c.bufr, c.bufw)

Expand Down

0 comments on commit a04c13e

Please sign in to comment.