Skip to content
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

Output stream isn't written to with default param #49

Open
imjoshin opened this issue Jan 8, 2019 · 0 comments
Open

Output stream isn't written to with default param #49

imjoshin opened this issue Jan 8, 2019 · 0 comments

Comments

@imjoshin
Copy link

imjoshin commented Jan 8, 2019

The output stream isn't written to when using the default param. I originally thought it was an issue with using STDOUT in a non-CLI environment, but after implementing a similar fix to #48, I wasn't seeing any changes.

I added some of our logging into the send() method to see what's going on:

protected function send($data)
{
    if ($this->need_headers)
    {
        $this->send_http_headers();
    }

    \Log::message("Output stream is valid: " . (fstat($this->output_stream) !== false ? 'true' : 'false'));
    \Log::message("Writing " . strlen($data) . " bytes");

    $this->need_headers = false;

    do
    {
        $result = fwrite($this->output_stream, $data);
        \Log::message("Wrote $result bytes");
        $data = substr($data, $result);
        fflush($this->output_stream);
    } while ($data && $result !== false);
}

I received these logs:

Output stream is valid: true
Writing 4096 bytes
Wrote 4096 bytes
Output stream is valid: true
Writing 1084 bytes
Wrote 1084 bytes
Output stream is valid: true
Writing 452 bytes
Wrote 452 bytes

Unfortunately, the tar downloaded was 0 bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant