Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15315743
D15179.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15179.diff
View Options
diff --git a/src/applications/files/uploadsource/PhabricatorFileUploadSource.php b/src/applications/files/uploadsource/PhabricatorFileUploadSource.php
--- a/src/applications/files/uploadsource/PhabricatorFileUploadSource.php
+++ b/src/applications/files/uploadsource/PhabricatorFileUploadSource.php
@@ -92,21 +92,27 @@
$threshold = PhabricatorFileStorageEngine::getChunkThreshold();
- // If we don't know how large the file is, we're going to read some data
- // from it until we know whether it's a small file or not. This will give
- // us enough information to make a decision about chunking.
- $length = $this->getDataLength();
- if ($length === null) {
- $rope = $this->getRope();
- while ($this->readFileData()) {
- $length = $rope->getByteLength();
- if ($length > $threshold) {
- break;
+ if ($threshold === null) {
+ // If there are no chunk engines available, we clearly can't chunk the
+ // file.
+ $this->shouldChunk = false;
+ } else {
+ // If we don't know how large the file is, we're going to read some data
+ // from it until we know whether it's a small file or not. This will give
+ // us enough information to make a decision about chunking.
+ $length = $this->getDataLength();
+ if ($length === null) {
+ $rope = $this->getRope();
+ while ($this->readFileData()) {
+ $length = $rope->getByteLength();
+ if ($length > $threshold) {
+ break;
+ }
}
}
- }
- $this->shouldChunk = ($length > $threshold);
+ $this->shouldChunk = ($length > $threshold);
+ }
return $this->shouldChunk;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 6:08 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7341704
Default Alt Text
D15179.diff (1 KB)
Attached To
Mode
D15179: Fix mishandling of chunk threshold in Diffusion for installs with no chunk engines available
Attached
Detach File
Event Timeline
Log In to Comment