소스 검색

Merge "Check connection's error stream before reading from it"

tags/v2.0.0.201206130900-r
Christian Halstrick 12 년 전
부모
커밋
e05300b21d
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5
    1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java

+ 5
- 1
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java 파일 보기

@@ -512,10 +512,14 @@ public class AmazonS3 {
final HttpURLConnection c) throws IOException {
final IOException err = new IOException(MessageFormat.format(JGitText.get().amazonS3ActionFailed
, action, key, HttpSupport.response(c), c.getResponseMessage()));
final InputStream errorStream = c.getErrorStream();
if (errorStream == null)
return err;

final ByteArrayOutputStream b = new ByteArrayOutputStream();
byte[] buf = new byte[2048];
for (;;) {
final int n = c.getErrorStream().read(buf);
final int n = errorStream.read(buf);
if (n < 0)
break;
if (n > 0)

Loading…
취소
저장