Hello All,

Minor rant mixed with a question.  Please bear with me.

I have a PHP app which I really wanted to run on GAE.  However, this app 
makes extensive use of cURL, which was unsupported by Google.   When Google 
announced that AppEngine 1.9.18 would support cURL, I was very happy.

Upgraded, rewrote app.yaml, php.ini, yadda, yadda, yadda and run... No use 
and the most peculiar behaviour.

// begin CURL routine

        $chv = curl_init();
        $header[0] = "Content-Type: application/x-www-form-urlencoded; 
charset=ISO-8859-1";
        $header[] = "Accept: */*";
        //$user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; 
rv:28.0) Gecko/20100101 Firefox/28.0";
        
        curl_setopt($chv, CURLOPT_URL, $url);
        //curl_setopt($chv, CURLOPT_USERAGENT, $user_agent);
        curl_setopt($chv, CURLOPT_HTTPHEADER, $header);
        curl_setopt($chv, CURLOPT_REFERER, '');
        //curl_setopt($chv, CURLOPT_ENCODING, 'gzip, deflate');
        curl_setopt($chv, CURLOPT_AUTOREFERER, true);
        curl_setopt($chv, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($chv, CURLOPT_TIMEOUT, 10);
        curl_setopt($chv, CURLOPT_HEADER, false);
        curl_setopt($chv, CURLOPT_POST, true);
        curl_setopt($chv, CURLOPT_POSTFIELDS, $postFields);
        
        $html = curl_exec($chv); // execute the curl command

        CakeLog::write('debug',"CURL:".$html);
        /* If there is some error in CURL, relay it to View
           Essentially, we will abort "nicely" and log the CURL error in JS 
Console to help debugging */
        $curl_errno = curl_errno($chv);
        $curl_error = curl_error($chv);

This is a fairly standard cURL POST routine.  All variables are correctly 
and properly set.  Now what happens is pretty bizarre;  cURL RETRIEVES the 
page content ($html returns the correct page!), but $curl_errno/$curl_error 
are set to "3" and "No URL set"...  Needless to say, this completely breaks 
error handling...

Investigation showed that Google's cURL support is actually a code layer 
for URL Fetch, so my guess is that this is what's causing the problem.

Can anybody provide some light?

(now the rant...)  Since I am running out of time to release the app, I 
don't really have the time (and patience) to debug Google's CurlLite, so I 
guess Amazon will win... That said I am somewhat disappointed that Google 
chose to insist in using URL fetch instead of using native cURL, which has 
been used for years by the community and it's been proven simple, quick and 
secure so far. Ah well... so much for ranting... back to work... :)

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/253f1481-af48-4b1c-9a25-01d29863a439%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to