-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1836 count amount of bytes read instead of chunks #1846
Conversation
This is a fix for #1836 where not all data is read if |
Unit tests fail in testRespondWithPaddedStreamFilterOutput. |
Suggested fix: diff --git a/Slim/App.php b/Slim/App.php
index cd478f1..e65c6e4 100644
--- a/Slim/App.php
+++ b/Slim/App.php
@@ -386,6 +386,9 @@ class App
if (isset($contentLength)) {
$amountToRead = $contentLength;
while ($amountToRead > 0 && !$body->eof()) {
+ if ($amountToRead < $chunkSize) {
+ $chunkSize = $amountToRead;
+ }
$data = $body->read($chunkSize);
echo $data;
|
The unit tests run without problems on my local environment (Xubuntu 15.10, PHP 5.6.11), but fail on Travis. If you could help me reproduce the failing test locally, then I would appreciat it. I can probably get on IRC tonigh (CET). |
You need to install the |
Thanks! |
Hmm.. installed php5-mcrypt, but the test still succeeds. |
Can you see |
The fix you suggested seems to do the trick! Thanks for looking into this. |
Thanks! |
No description provided.