Hi Jason! Thanks for the patch!
At a first glance it looks nice but please make sure you test it! I think that the easiest way to do that would be to extend the class HttpTester (see ./Http/HttpTester.cpp) so that you make the ClientSession connect with a ServerSession and verify that the request/response message header and body gets transmitted.
You could take a look at ./Gnutella/Handshaking/HandshakingTester.cpp, which Sebastien extended in exactly that way to test Gnutella handshaking (which uses HTTP-style headers). You’ll see there how a QTcpServer is started to listen on a port. In your case, when you get an incoming connection (QTcpSocket), you’ll create a ServerSession object and call its slot startReadingRequest(). Now that I came to this, I think you won’t need to do:
+ connect (p->bodyWriter, SIGNAL (bodyWritten()),
+ this, SLOT (startReadingRequest()));
in the constructor, because starting reading the request is the very first thing that should happen.
Please keep us updated on any progress or problems!
Good luck!
P.S. I just came to the idea that you should try to use only one HttpTester object to test both ClientSession and ServerSession. In Handshaking we have one HandshakerTester object for the Handshaker that accepts the connection and one HandshakerTester object for the Handshaker that requests the connection. It’ll be great to be able to see these two possibilities in action and decide which one is better in regard to running automated tests.
