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

Commit

Permalink
Fixes #36 - Error when uploading via Zend_Gdata behind proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
froschdesign committed Nov 29, 2014
1 parent 9b290a8 commit ae63b4d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions library/Zend/Gdata/HttpAdapterStreamingProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,19 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
'Error writing request to proxy server');
}

//read from $body, write to socket
while ($body->hasData()) {
if (! @fwrite($this->socket, $body->read(self::CHUNK_SIZE))) {
// Read from $body, write to socket
$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');
'Error writing request to server'
);
}
$chunk = $body->read(self::CHUNK_SIZE);
}
$body->closeFileHandle();

return 'Large upload, request is not cached.';
}
}

0 comments on commit ae63b4d

Please sign in to comment.