brutella / hc

hc is a lightweight framework to develop HomeKit accessories in Go.
Apache License 2.0
1.74k stars 189 forks source link

Don't close connection when server closes background read #77

Closed brutella closed 7 years ago

brutella commented 7 years ago

In Go 1.8 the HTTP server finishes a request after it was handled by setting a read timeout. The behaviour of setting deadlines affecting ongoing reads is new since Go 1.8. Because of that reading fails with an i/o timeout error. This issue was discussed here.

Currently we close the connection on any read errors. But since this error is expected, we should ignore it.

Related to #75