socketry / async-http

MIT License
298 stars 45 forks source link

closed stream read fix #70

Closed orlando-labs closed 3 years ago

orlando-labs commented 3 years ago

This PR addresses the same issue as this one

ioquatix commented 3 years ago

This looks okay to me, because read_line? means read a line if you can.

ioquatix commented 3 years ago

Thanks for your help on this issue. I believe we have fixed this issue in protocol-http1. However, looking at this code again, I wonder if it's wrong:

                    def read_line?
                        @stream.read_until(CRLF)
                    # rescue Errno::ECONNRESET
                    #   return nil
                    end

I'm not sure if we should be catching ECONNRESET because to me, read_line? is about reading a line if it's available, not ignoring underlying network failures.