Worked most of the day on the HTTPD. There were quite a lot more problems than I knew. One is especially nice, I had forgotten to set the accepted socket to be non blocking. So did the most wrong thing possible in an asynchronous design, I blocked. Well, I fixed that little problem. Then found some issues in the read buffer and completely refactored the receiving and sending logic in the HTTP-connection class.
So now I actually know that the asynchronous stuff works, I checked it again and again. Also it seems there are no more errors in the receiving stuff, so at least I make progress. I also implemented part of the error handling stuff, the program now returns an error response if something didn't work. And even closing the connection and destroying the objects work. I hope I didn't miss one, though. But I think I got them all, I will when it is a bit more advanced put it through some stress tests, then I will see if I have a memory leak.
The next three steps are to finish handling protocol errors, adding timeouts and adding correct handling of the connection settings. Currently I ignore them (and don't even send Connection: Close). Also I have to add more header stuff, I currently just store most of the headers, but I will have to treat them differently, e.g. the Connection headers, but also Cookie- and Accept-headers have to be recognised. I would like to add compressing outgoing content to the program.