Skip to content
Snippets Groups Projects
Commit f83266d9 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Some http robustness improvements.

- Increase the maximum response header buffer size up to ~32 kB.
  This also moves it into a heap-allocated buffer instead of the
   stack, as 32 kB is really too much for the stack.
- Treat LF as CR LF when parsing headers.
  This is necessary when parsing the load-balancer response in
   front of <http://lazaradio.hu:8100/bermuda.opus>.
  The response returned by that server is invalid in lots of ways,
   but with these two changes we can read it.
- In addition, we now peek ahead at a large chunk of data when
   reading the response instead of reading 2 to 4 bytes at a time.
  This allows a typical response to be read with two syscalls
   (one peek, one read) instead of several hundred.
- Stop trying to read more data when the connection is closed.
parent 2ffd8cb7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment