Fixed infinite loop that takes over the CPU during request handling

* Prevented the infinite loop in HTTP header parser
* Fixed invalid typecasts in GenericConnection
* Fixed typo in the comment
Good point about `recv`, maybe you should use some additional flags to handle socket behavior appropriately.
http://stackoverflow.com/questions/19971858/c-socket-send-recv-vs-write-read