summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2015-05-10 14:44:15 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2015-05-10 14:44:16 -0400
commit4ac7cf003b802b66d085451a5b3dc4912c56e230 (patch)
treeea1a50e1c429850d2736939b7f5ea6adeeec0572
parente4e947049f60d72f766d90dff22b488cbe06ba95 (diff)
parent017032c465ff20ef255914eff9b58da67c5e46b4 (diff)
downloadjgit-4ac7cf003b802b66d085451a5b3dc4912c56e230.tar.gz
jgit-4ac7cf003b802b66d085451a5b3dc4912c56e230.zip
Merge "Fix IllegalArgumentException in AmazonS3"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
index 705a84613c..f43ea637aa 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
@@ -489,16 +489,14 @@ public class AmazonS3 {
final String md5str = Base64.encodeBytes(csum);
final long len = buf.length();
- final String lenstr = String.valueOf(len);
for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) {
final HttpURLConnection c = open("PUT", bucket, key); //$NON-NLS-1$
- c.setRequestProperty("Content-Length", lenstr); //$NON-NLS-1$
+ c.setFixedLengthStreamingMode(len);
c.setRequestProperty("Content-MD5", md5str); //$NON-NLS-1$
c.setRequestProperty(X_AMZ_ACL, acl);
encryption.request(c, X_AMZ_META);
authorize(c);
c.setDoOutput(true);
- c.setFixedLengthStreamingMode((int) len);
monitor.beginTask(monitorTask, (int) (len / 1024));
final OutputStream os = c.getOutputStream();
try {