Check curl handle explicitly for resource type instead of null. #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
After updating lib version started seeing errors with curl_reset() in Pusher.php:268 saying that expected a
resourcetype but got an int (value: 0).Why and how
$chvariables becomes0- I did not have enough time to dig deeper and reproduce it in isolated environment, but because$chbecomes0then curl_init() does not happen on attempt to reuse the handle. So the proposed fix is to check explicitly forresourcetype instead ofnull, which IMHO is more accurate and less error prone.Additional info
This might be due php/curl version combination, but its a long shot. Leaving here some details about the environment where it did happen, while I understand this might not be enough for reproducing the issue.
php version: 7.1.5
curl version: curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.19.1 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.4.3