diff options
author | qin shulei <qinsl0106@thundersoft.com> | 2023-06-28 19:52:47 +0800 |
---|---|---|
committer | qin shulei <qinsl0106@thundersoft.com> | 2023-06-29 11:00:35 +0800 |
commit | 79b46a0ef0c8bd45b95ec4887789f9013a7fbcbc (patch) | |
tree | fbca70bb4fc4a8dd9c9f75dd1cd096f0db4a45b7 /org.eclipse.jgit.lfs.server | |
parent | 91b23cc552c1038cf6e37d256ebb47eb83a8a5f6 (diff) | |
download | jgit-79b46a0ef0c8bd45b95ec4887789f9013a7fbcbc.tar.gz jgit-79b46a0ef0c8bd45b95ec4887789f9013a7fbcbc.zip |
Fix S3Repository getSize to handle larger object sizes
Update `getSize` method in `S3Repository` to handle larger object sizes.
The method previously used `Integer.parseInt`
to parse the `Content-Length` header of an HTTP response,
which limited the maximum object size to 2 GB.
Replaces `Integer.parseInt` with `Long.parseLong`,
allowing the method to handle object sizes larger than 2 GB.
- Use minio as local S3 service for gerrit lfs plugin
- The minio seems will return the Content-length
Change-Id: Ia3a5fd1a335643786714aff3fcc7d10a6b152058
Signed-off-by: qin shulei <qinsl0106@thundersoft.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server')
-rw-r--r-- | org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java index 3c98d7b9e5..5ebce5d8c0 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java @@ -126,7 +126,7 @@ public class S3Repository implements LargeFileRepository { String contentLengthHeader = conn .getHeaderField(HDR_CONTENT_LENGTH); if (contentLengthHeader != null) { - return Integer.parseInt(contentLengthHeader); + return Long.parseLong(contentLengthHeader); } } return -1; |