让 cocos2d-x 的 CCHttpRequest 支持https(2)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:12 点击:次
p> if (code != CURLE_OK)
p> {
p> break;
p> }
p>
p> code = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callback);
p> if (code != CURLE_OK)
p> {
p> break;
p> }
p>
p> code = curl_easy_setopt(curl, CURLOPT_WRITEDATA, stream);
p> if (code != CURLE_OK)
p> {
p> break;
p> }
p>
p> code = curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
p> if (code != CURLE_OK) {
p> break;
p> }
p>
p> code = curl_easy_perform(curl);
p> if (code != CURLE_OK)
p> {
p> break;
p> }
p>
p> /* free the linked list for header data */
p> curl_slist_free_all(cHeaders);
p>
p> code = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, responseCode);
p> if (code != CURLE_OK || *responseCode != 200)
p> {
p> code = CURLE_HTTP_RETURNED_ERROR;
p> }
p> } while (0);
p>
p> if (curl) {
p> curl_easy_cleanup(curl);
p> }
p>
p> return (code == CURLE_OK ? 0 : 1);
p>}
p>
p>//Process POST Request
p>int processPostTask(CCHttpRequest *request, write_callback callback, void *stream, int32_t *responseCode)
p>{
p> CURLcode code = CURL_LAST;
p> CURL *curl = curl_easy_init();
p>
p> do {
p> if (!configureCURL(curl)) {
p> break;
p> }
p>
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>