Bug #41718

improve (jumpurl) download of large files

Added by till busch over 8 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2012-10-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

when downloading large files (using jumpurl) php dies:

Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 266393601 bytes) in typo3/sysext/cms/tslib/class.tslib_fe.php on line 2652

this can be improved by adding ob_end_flush() before readfile() in class.tslib_fe.php.

additionally i propose adding a Content-Length header (see the diff).


Files

jumpurl.diff (652 Bytes) jumpurl.diff till busch, 2012-10-08 14:52
#1

Updated by Steffen Gebert over 8 years ago

Sounds reasonable, Till.

We have a function t3lib_div::flushOutputBuffers() (in 4.x) / TYPO3\CMS\Core\Utility\GeneralUtility in (6.0) to flush output buffers.

It would be great, if you could push your patch with that correction into the review workflow. See http://wiki.typo3.org/Contribution_Walkthrough_Tutorials and ask here in the mailing lists, if you have any questions!

Yours
Steffen

#2

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/15507

#3

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15508

#4

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15509

#5

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/15510

#6

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-4 has been pushed to the review server.
It is available at http://review.typo3.org/15511

#7

Updated by till busch over 8 years ago

i have tried to add the changes to gerrit. i'm not quite sure if what i did is good/conforms to standars:
  • one commit for each version i want to change
  • commits for 4.x series have the same Change-Id
  • i have not tested if jumpurl works with typo3 6.x after the change

also i'm not sure if stat() should be @stat()

Steffen Gebert wrote:

...
It would be great, if you could push your patch with that correction into the review workflow. See http://wiki.typo3.org/Contribution_Walkthrough_Tutorials and ask here in the mailing lists, if you have any questions!
...

#8

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_4-4 has been pushed to the review server.
It is available at http://review.typo3.org/15511

#9

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/15507

#10

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15509

#11

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/15510

#12

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15508

#13

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15508

#14

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15509

#15

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/15510

#16

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch TYPO3_4-4 has been pushed to the review server.
It is available at http://review.typo3.org/15511

#17

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15508

#18

Updated by Steffen Gebert over 8 years ago

Thanks for pushing, Till!

Let's review it for master first and then we will take care of the other branches!

#19

Updated by Gerrit Code Review over 8 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15508

#20

Updated by Gerrit Code Review over 8 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15508

#21

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/15507

#22

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15509

#23

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/15510

#24

Updated by Alexander Opitz almost 8 years ago

Hi Till,

can you please rebase your patch to latest master?

#25

Updated by Gerrit Code Review almost 8 years ago

Patch set 4 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/15507

#26

Updated by Gerrit Code Review almost 8 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/15508

#27

Updated by Gerrit Code Review almost 8 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/15508

#28

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21917

#29

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/21918

#30

Updated by till busch almost 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#31

Updated by Nils Böcher almost 8 years ago

Gerrit Code Review wrote:

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21917

After this update (TYPO3 6.1.4) the header "Content-Length" for every download file showed a size of 26 bytes, no matter how big the file was.
The calculation of the filesize seems to be not working correctly.

I deleted line 2854 in TypoScriptFrontendController.php (header('Content-Length: ' . filesize($absoluteFileName));) as quick workaround.

#32

Updated by Alexander Opitz almost 8 years ago

  • Is Regression set to No

@Nils Böcher

Please open a new issue for this. From reading the source it should work. Please write in this issue your PHP version which you use. And the complete response header to get this analyzed.

Thanks.

#33

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF