Skip to content
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

Hangs with test connection #15

Closed
blackjack75 opened this issue Mar 24, 2017 · 4 comments · Fixed by #23
Closed

Hangs with test connection #15

blackjack75 opened this issue Mar 24, 2017 · 4 comments · Fixed by #23
Labels

Comments

@blackjack75
Copy link

I am trying to use this to make a simple connection to Apple. I pass an erroneous app ID + device ID and the connection just hangs in Client.php . IP is not blocked because a simple shell curl command to either dev or prod apple servers works fine (It returns an error of course).

With the current Client.php It hangs forever in the second while here:

` $active = null;
do {
$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);

     while ($active && $mrc == CURLM_OK) {

         if (curl_multi_select($mh) != -1) {
             do {
                 $mrc = curl_multi_exec($mh, $active);
             } while ($mrc == CURLM_CALL_MULTI_PERFORM);
         }

     }

However, If I replace this with this simple loop here.
do {
$mrc = curl_multi_exec($mh, $active);
} while ($active > 0);
`

All works fine.

System is out of the box Debian instance with PHP 7.0.16-3, OpenSSL 1.1.0e , cURL 7.52.1

Any ideas ?

@edamov
Copy link
Owner

edamov commented Apr 7, 2017

Is php compiled with that versions of OpenSSL and cURL ?

@blackjack75
Copy link
Author

blackjack75 commented Apr 8, 2017

Doh!

According to php this version was actually built with Curl 7.52.1 BUT with OpenSSL/1.0.2k
while "openssl version" in the system returns OpenSSL 1.1.0e

So I guess that's the cause? I am curious as to why the simple loop without curl_multi_select would cause no issue though ?

@edamov
Copy link
Owner

edamov commented Apr 8, 2017

So your curl and openssl versions is ok. You should also check if curl compiled with HTTP/2 support.

@blackjack75
Copy link
Author

PHP itself has HTTP2 support (says phpinfo) and curl also apparently:
curl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants