|
|
|
@ -336,15 +336,9 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
|
|
|
|
|
useSmartHttp = on; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** {@inheritDoc} */ |
|
|
|
|
@Override |
|
|
|
|
public FetchConnection openFetch() throws TransportException, |
|
|
|
|
NotSupportedException { |
|
|
|
|
final String service = SVC_UPLOAD_PACK; |
|
|
|
|
try { |
|
|
|
|
final HttpConnection c = connect(service); |
|
|
|
|
final InputStream in = openInputStream(c); |
|
|
|
|
try { |
|
|
|
|
@SuppressWarnings("resource") // Closed by caller
|
|
|
|
|
private FetchConnection getConnection(HttpConnection c, InputStream in, |
|
|
|
|
String service) throws IOException { |
|
|
|
|
BaseConnection f; |
|
|
|
|
if (isSmartHttp(c, service)) { |
|
|
|
|
readSmartHeaders(in, service); |
|
|
|
@ -356,8 +350,17 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
|
|
|
|
|
} |
|
|
|
|
f.setPeerUserAgent(c.getHeaderField(HttpSupport.HDR_SERVER)); |
|
|
|
|
return (FetchConnection) f; |
|
|
|
|
} finally { |
|
|
|
|
in.close(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** {@inheritDoc} */ |
|
|
|
|
@Override |
|
|
|
|
public FetchConnection openFetch() throws TransportException, |
|
|
|
|
NotSupportedException { |
|
|
|
|
final String service = SVC_UPLOAD_PACK; |
|
|
|
|
try { |
|
|
|
|
final HttpConnection c = connect(service); |
|
|
|
|
try (InputStream in = openInputStream(c)) { |
|
|
|
|
return getConnection(c, in, service); |
|
|
|
|
} |
|
|
|
|
} catch (NotSupportedException err) { |
|
|
|
|
throw err; |
|
|
|
|