One of these areas is the HTTP header parser and management routines. Among other things, the main issues I have with the parser and management code is listed below.
- Each header entry is represented by separate strings in memory;
- Each header entry has a small, separately allocated object (HttpHeaderEntry), one per header
- Parsing the header entries uses various stdio routines to iterate over characters, and these may be implemented slower (to handle unicode/wide/UTF/locale support) than what's needed here (7-bit ASCII);
- There's some sanity checks in the header parser - specifically, duplicate content-length - which is likely better once the headers have been parsed.
It's taking me quite a bit of time to slowly change the HTTP parser code to be ready for the new management code. Well, it's taken me about 6 months to slowly modify it in a way that doesn't require rewriting everything and potentially changing expected behaviour and/or introduce subtle bugs.
The upshoot? Things take time, but the code hopefully will be tidier, cleaner and easier to understand. Oh, and won't include bugs.
Post a Comment