ovidiubob / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Google_CurlIO fails with proxy #401

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a Google_Client with a CURLOPT_PROXY pointed to an https proxy
2. Attempt to complete authentication
3. Observe JSON decode error due to wrong header offset into response body

What is the expected output? What do you see instead?

Expected not to have JSON decode error.

What version of the product are you using? On what operating system?

Latest, CentOS 6.4.

Please provide any additional information below.

There is a small fix in Google_CurlIO that is applicable for libcurl <= 7.30 -- 
after 7.31 the headerinfo reports the length correctly and this seemingly 
benevolent fix causes the code to offset into the buffer wrong, trigger a 
json_decode() error, and not work at all.

Google_CurlIO:
   public static function parseHttpResponse($respData, $headerSize) {
     if (stripos($respData, self::CONNECTION_ESTABLISHED) !== false) {        
       $respData = str_ireplace(self::CONNECTION_ESTABLISHED, '', $respData);
     } 

The first three lines need to go if curl_version() returns version 7.31.0 or 
higher.

See cURL issue: http://sourceforge.net/p/curl/bugs/1204/

Original issue reported on code.google.com by mis...@gmail.com on 25 Sep 2013 at 6:28

GoogleCodeExporter commented 8 years ago
Here's a patch that checks curl version appropriately and only applies the fix 
as needed.

Original comment by mis...@gmail.com on 18 Oct 2013 at 4:01

Attachments:

GoogleCodeExporter commented 8 years ago
Also, note that CentOS 6.4 has a much older libcurl, but we have a custom PHP 
build with libcurl 7.31.0 that has the official libcurl fix which is why we're 
seeing it on CentOS 6.4 in this case.

Original comment by mis...@gmail.com on 18 Oct 2013 at 4:02

GoogleCodeExporter commented 8 years ago
This issue tracker is now closing. Development on the Google PHP client library 
moved to GitHub with the release of the 1.0.0-alpha, and now the 1.0 branch has 
reached beta status there will be no further releases of the 0.6 branch of the 
library. 

Please take a look at the latest version on 
https://github.com/google/google-api-php-client

For information on migrating, please take a look at this guide: 
https://developers.google.com/api-client-library/php/guide/migration

For general library support please ask a question on StackOverflow: 
http://stackoverflow.com/questions/tagged/google-api-php-client

If you are looking for support with a specific API, please contact the team 
working with that API via StackOverflow or their preferred support mechanism. 

If your issue still exists with the new version of the library, please raise a 
bug in the GitHub issue tracker with a minimal code sample. 

Thanks!

Original comment by ianbar...@google.com on 22 Jan 2014 at 4:56

GoogleCodeExporter commented 8 years ago

Original comment by ianbar...@google.com on 22 Jan 2014 at 4:56