Skip to content

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

@imjoshin

Description

@imjoshin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions