SeleniumHQ/selenium — pull request #150 by alisaifee (2013-12-11 01:03:42+00:00)
Title: Allow retry in http connection to remote webdriver

[#6690 phantomjs with selenium 2.38.1 fails with BadStatusLine exception](https://code.google.com/p/selenium/issues/detail?id=6690)

PhantomJS+GhostDriver as of PhantomJS version 1.9.2 does not enable http keep-alive which results in failure to communicate with the webdriver after the first request.

Other implementations of webdriver servers may also close the connection after a timeout - in which case a retry will ensure that the next command doesn't fail.