Skip to content

Use the curl_reset function to allow resource reusing #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2015

Conversation

shulard
Copy link
Contributor

@shulard shulard commented Nov 10, 2015

Since the PHP required version is 5.5, we can rely on the curl_reset function to manage curl handle.

It allow us to avoid create a new resource for each call. I've faced to some problem without reusing handles on previous project. Since that I always use that. It just reset all the attached option to the current handle.

@mekras mekras self-assigned this Nov 10, 2015
@dbu
Copy link
Contributor

dbu commented Nov 10, 2015

could there be an issue with async requests? or can curl never do async anyways?

@sagikazarmark
Copy link
Member

Actually we could backport curl_reset to PHP 5.4.

Is that possible at all? Maybe we could check if there is a symfony pollyfill for it.

@shulard
Copy link
Contributor Author

shulard commented Nov 10, 2015

It's not possible to create a polyfill to curl_reset. I've already tried to find a way to do that but we can't unset a config, we can just set its value.

I think that this PR is not a problem about the async thing, we just need to ensure that all is fine when async implementation is done.

@dbu
Copy link
Contributor

dbu commented Nov 10, 2015 via email

@sagikazarmark
Copy link
Member

Yeah, if there is 1% need for PHP 5.5, use it.

mekras added a commit that referenced this pull request Nov 11, 2015
Use the curl_reset function to allow resource reusing
@mekras mekras merged commit 31789de into php-http:master Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants