Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Error when uploading via Zend_Gdata behind proxy #36

Closed
zfbot opened this issue Apr 5, 2013 · 2 comments
Closed

Error when uploading via Zend_Gdata behind proxy #36

zfbot opened this issue Apr 5, 2013 · 2 comments
Assignees
Milestone

Comments

@zfbot
Copy link

zfbot commented Apr 5, 2013

Jira Information

Original Issue:ZF-12475
Issue Type:Bug
Reporter:Chris Grice
Created:11/27/12
Assignee:Trevor Johns
Components:Zend_Gdata

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.

@zfbot
Copy link
Author

zfbot commented Apr 5, 2013

This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF-12475

Known GitHub users mentioned in the original message or comment:

@froschdesign
Copy link
Member

Ugly coding style in the Zend_Gdata classes, but I can confirm the problem.

@froschdesign froschdesign self-assigned this Nov 29, 2014
@froschdesign froschdesign added this to the 1.12.10 milestone Nov 29, 2014
dgiotas pushed a commit to tripsta/zf1 that referenced this issue Jun 17, 2016
antonis179 pushed a commit to tripsta/zf1 that referenced this issue Jan 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants