c++ - curl_easy_perform return CURLE_WRITE_ERROR, but I won't write nothing -
i wrote simple code check network connection or our ios apps:
int cl_network::checkconnectionint1(){ curl *curl; curlcode res; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, curlopt_verbose, 1); curl_easy_setopt(curl, curlopt_url, "http://www.google.com"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); return res; } curl_easy_cleanup(curl); return -1; }
our test ok, return 0 when wi-fi enabled, apple reviewer return 23 (curl_write_error) wi-fi enable or disable.
the reviewer tells others strange behaviors (considering wi-fi enabled)
- ipod touch ios 5.1 returns 0, same wi-fi iphone5 ios 6.3 returns 23
- iphone 5 ios 6.3 run step step debug returns 0 (i don't know if happened 1 time or always)
have suggestions?
last note, verbose output of curl_easy_perform
< http/1.1 302 found < location: http://www.google.it/ < cache-control: private < content-type: text/html; charset=utf-8 < set-cookie: pref=id=08f8ea131f5d39dd:ff=0:tm=1367680782:lm=1367680782:s=at5iykntpeoffnif; expires=mon, 04-may-2015 15:19:42 gmt; path=/; domain=.google.com < set-cookie: nid=67=upkhtxntvuyy4qowvhstk4nzmgzcdssyw.....; expires=sun, 03-nov-2013 15:19:42 gmt; path=/; domain=.google.com; httponly < p3p: cp="this not p3p policy! see http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 more info." < date: sat, 04 may 2013 15:19:42 gmt < server: gws < content-length: 218 < x-xss-protection: 1; mode=block < x-frame-options: sameorigin < 302 moved
- about connect() www.google.com port 80 (#0)
- trying 173.194.35.20...
- connected
- connected www.google.com (173.194.35.20) port 80 (#0)
get / http/1.1 host: www.google.com accept: /
302 moved
document has moved here. * connection #0 host www.google.com left intact * closing connection #0 2013-05-04 17:19:42.183 testcurl[1468:c07] checkconnection 1: 0
Comments
Post a Comment