Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Fix memory leak: headers added by the http client are added to the same request object at each request #27

Closed
wants to merge 4 commits into from

Conversation

ikdekker
Copy link
Contributor

@ikdekker ikdekker commented Aug 6, 2017

Headers are no longer added every time. They used to be added regardless, which caused the headers array to grow infinitely.

Headers are no longer added every time. They used to be added regardless, which caused the headers array to grow infinitely.
@Ocramius
Copy link
Member

Ocramius commented Aug 6, 2017 via email

[cs] Remove whitespace on empty line
Headers are no longer added every time. They used to be added regardless, which caused the headers array to grow infinitely.

[test] Add headers check for content-type & accept
[cs] Remove whitespace on empty line
@ikdekker
Copy link
Contributor Author

ikdekker commented Aug 7, 2017

I don't know whether the kinds of tests I have added are those you require. However, I am unable to pass unit tests without fails.

Locally I pull the original zend-xmlrpc, composer install, then run phpunit. The results are two errors in ZendTest\XmlRpc\Request\HTTPTest::testGetHeaders and ZendTest\XmlRpc\Request\HTTPTest::testGetFullRequest
The content length is expected to be 958, but is actually 986. I am testing on Windows PHP 5.6. So it might be line endings.

The travic CI, I am not sure about. It gives an error about a VarTag which I don't see.

@Ocramius Ocramius added the bug label Aug 11, 2017
@Ocramius
Copy link
Member

@ikdekker the VarTag failure is unrelated - I'll fix that as soon as possible

Seems related to zendframework/zend-code#128

@Ocramius Ocramius changed the title Fix memory leak in Client.php Fix memory leak in headers added by the http client Aug 11, 2017
@Ocramius Ocramius changed the title Fix memory leak in headers added by the http client Fix memory leak: headers added by the http client are added at each request Aug 11, 2017
@Ocramius Ocramius changed the title Fix memory leak: headers added by the http client are added at each request Fix memory leak: headers added by the http client are added to the same request object at each request Aug 11, 2017
Ocramius added a commit that referenced this pull request Aug 11, 2017
Ocramius added a commit that referenced this pull request Aug 11, 2017
Ocramius added a commit that referenced this pull request Aug 11, 2017
@Ocramius Ocramius closed this in 0c28f13 Aug 11, 2017
@Ocramius Ocramius added this to the 2.6.1 milestone Aug 11, 2017
@Ocramius
Copy link
Member

@ikdekker merged, thanks!

master: 0c28f13
develop: 992adb0

@Ocramius Ocramius self-assigned this Aug 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants