OSDN Git Service
Handle the different definitions of 'connected' in HttpURLConnection.
Previously we were failing with a NullPointerException when
HTTP redirects required connecting to a different server.
The connected field means 'we can't change request parameters'.
The connection being non-null means 'we're currently connected'.
Internally, multiple connections are permitted in order to support
HTTP redirects. But in the public API only one connect() call is
permitted.
I've added a new method, makeConnection() to make the magic work.
Change-Id: Ic644d5d192ec2b1de781dc271ae149bcd1655de4