File tree Expand file tree Collapse file tree 4 files changed +162
-77
lines changed Expand file tree Collapse file tree 4 files changed +162
-77
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,9 @@ func (p *Conn) readHeader() error {
244244 // run on the connection, as we don't want to override the previous
245245 // read deadline the user may have used.
246246 if p .readHeaderTimeout > 0 {
247- p .conn .SetReadDeadline (time .Now ().Add (p .readHeaderTimeout ))
247+ if err := p .conn .SetReadDeadline (time .Now ().Add (p .readHeaderTimeout )); err != nil {
248+ return err
249+ }
248250 }
249251
250252 header , err := Read (p .bufReader )
@@ -259,7 +261,9 @@ func (p *Conn) readHeader() error {
259261 if t == nil {
260262 t = time.Time {}
261263 }
262- p .conn .SetReadDeadline (t .(time.Time ))
264+ if err := p .conn .SetReadDeadline (t .(time.Time )); err != nil {
265+ return err
266+ }
263267 if netErr , ok := err .(net.Error ); ok && netErr .Timeout () {
264268 err = ErrNoProxyProtocol
265269 }
You can’t perform that action at this time.
0 commit comments