curl-library
A weird problem in the cURL library
Date: Fri, 27 May 2016 17:19:59 +0800
Dear masters:
Hope I will not spare you too much time. I am a Chinese programmer. Recently I was using the open source library cURL, which was written by you. I have got a problem which really puzzled me.
I post an oauth https request (actually, the method is "get") , but get nothing back. But if I ① open the verbose mode like following:
curl_easy_setopt(easy_handle, CURLOPT_VERBOSE, 1L);
and ② redirect stderr to the console like following:
AllocConsole();
freopen("CONOUT$", "w+t", stderr);
it works!
In other words, only when I did ① and ② could the oauth https get response back.
I located the code and found the critical line is the following line in the function Curl_add_buffer_send:
Curl_debug(conn->data, CURLINFO_HEADER_OUT, ptr, headlen, conn);
and the line in the function showit:
fwrite(ptr, size, 1, data->set.err);
When the buffer content is the oauth https request, if the "fwrite" sententce doesn't execute, there would be no response.
This problem only occurs on an oauth https request. Other https requests are OK. I really can't think of why can the stderr log affect the request. Could you please help me? Thanks a lot.
Cao Wei
Hangzhou, Zhe Jiang Province, China.
2016-05-27
supercaowei
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-05-27