Issues

ZF-12475: Error when uploading via Zend_Gdata behind proxy

Description

When using Zend_Gdata to upload to youtube while behind a proxy, Zend_Gdata_HttpAdapterStreamingProxy throws a fatal error:

Fatal error: Call to undefined method Zend_Gdata_MediaMimeStream::hasData() in Zend/Gdata/HttpAdapterStreamingProxy.php on line 118

Using the implementation of the same functionality in Zend_Gdata_HttpAdapterStreamingSocket the upload completes successfully.

I.e replacing the lines from 118 to 124:

     while ($body->hasData()) {
        if (! @fwrite($this->socket, $body->read(self::CHUNK_SIZE))) {
            require_once 'Zend/Http/Client/Adapter/Exception.php';
            throw new Zend_Http_Client_Adapter_Exception(
                'Error writing request to server');
        }
    }

with the following:

    $chunk = $body->read(self::CHUNK_SIZE);
    while ($chunk !== FALSE) {
        if (! @fwrite($this->socket, $chunk)) {
            require_once 'Zend/Http/Client/Adapter/Exception.php';
            throw new Zend_Http_Client_Adapter_Exception(
                'Error writing request to server');
        }
        $chunk = $body->read(self::CHUNK_SIZE);
    }
    $body->closeFileHandle();

fixes the issue.

Comments

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf1/issues/36