Fix error checking on Zend\Http\Client\Adapter\Socket->write(). #3033

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

peterhil commented Nov 20, 2012

This failed on CLI usage, giving:
Notice: fwrite(): send of 8192 bytes failed with errno=32 Broken pipe in [a-symfony-project-name-held]/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Socket.php on line 361

The PHP fwrite function can returns the bytes written, which can be 0 – and returns false on error:
"fwrite() returns the number of bytes written, or FALSE on error."
http://php.net/manual/en/function.fwrite.php

This breaks the ZendService\Amazon\S3\S3->putFile(), when called from a CLI PHP script (using Symfony console).

peterhil referenced this pull request in xi-project/xi-filelib Nov 20, 2012

Closed

Fixed Amazon S3 client #104

Member

Ocramius commented Nov 21, 2012

@peterhil can you please test this by writing an empty string to the socket?

Nevermind, I'm trying to write the test myself :)

@Ocramius Ocramius added a commit to Ocramius/zf2 that referenced this pull request Nov 21, 2012

@Ocramius Ocramius Adding failing test for zendframework/zendframework#3033 0c8554b

Ocramius referenced this pull request Nov 21, 2012

Closed

Hotfix/issue #3033 #3049

Member

Ocramius commented Nov 21, 2012

Handled in #3049

@weierophinney weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge branch 'hotfix/3049' a44d7dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment