Authentication gets no response
-
I installed the new version 0.2.6 and attempted to authenticate. Sending the login credentials does not return any response whatsoever.
It seems that the problem might come from the remote connections the plugin establishes with pinterest website for its business.
This is what I have found:
When Pinim_Bridge class attempts to refresh_token() it gets the Pinterest App version by retrieving a response from pinterest.com/login with wp_remote_get(). This first remote connection is successful in my case.The second remote connection reads the response from pinterest.com before calling the set_auth() method. This is where I got stuck, but to be frank I am not sure where the problem comes from. I logged all downloaded blocks to the pinterest.com url directly from the request() method of wordpress’ WP_Http_Streams class, which is the one being used to establish the connection and found that:
- Both response headers and body are fully downloaded (the response body finishes with a closing </html> tag)
- For some reason the connection is never closed. Or that’s what it looks like. Wether this is a PHP, WordPress, pinterest, plugin issue or my machine’s I can’t tell right now. There appears to be no timeout fired (despite http streams’ being set at 5 sec), or error triggered or exception thrown of any kind.
The part where it seems to get stuck is in class-http.php line 1139 where it says:
while (!feof($handle) && $keep_reading) { $block = fread($handle, $block_size); $strResponse .= $block; if (!$bodyStarted && strpos($strResponse, "\r\n\r\n")) { $header_length = strpos($strResponse, "\r\n\r\n") + 4; $bodyStarted = true; } $keep_reading = (!$bodyStarted || !isset($r['limit_response_size']) || strlen($strResponse) < ( $header_length + $r['limit_response_size'] ) ); }
apparently the $handle never gets a feof. Even if at the last execution of this while{} loop you call stream_get_meta_data($handle) you still get the timed_out and eof keys as false.That’s as far as I went. My website is run locally in Ubuntu 15.04, PHP Version 5.6.4-4ubuntu6.3 . It is in a domain called example.com (which is looped back to localhost).
attempting to log in with WP_DEBUG set to false does the same.
- The topic ‘Authentication gets no response’ is closed to new replies.