Fixed HTTP connection logic

Fixed bug in HTTP connection logic whereby the input buffer offset isn't updated
if the HTTP headers aren't yet received. Now the offset is always updated.