cURL / Mailing Lists / curl-users / Single Mail

curl-users

转发: Why libcurl sent two request packet for on "curl_multi_add_handle"?

From: Jason Liu <jason.liu_at_torchmobile.com.cn>
Date: Tue, 17 Apr 2012 06:44:21 -0400

Hi,
Please give me a help.
Thank you very much.

----- 原始消息 -----
发件人: Xue Wen Wang
收件人: Jason Liu
发送时间: Tue Apr 17 06:35:17 2012
主题: Why libcurl sent two request packet for on "curl_multi_add_handle"?

Hi,
I'm sending the HTTP Digest authentication request using LIBCURL, I
found the LIBCURL sending two requests for one calling
"curl_multi_add_handle".
Anyone know this issue?

I set these options, maybe not exactly:
     curl_easy_setopt(m_handle, CURLOPT_VERBOSE, 1);
     curl_easy_setopt(m_handle, CURLOPT_DEBUGFUNCTION, debugCallback);
     curl_easy_setopt(m_handle, CURLOPT_DEBUGDATA, this);
     curl_easy_setopt(m_handle, CURLOPT_PRIVATE, this);
     curl_easy_setopt(m_handle, CURLOPT_ERRORBUFFER, m_curlErrorBuffer);
     curl_easy_setopt(m_handle, CURLOPT_WRITEFUNCTION, writeCallback);
     curl_easy_setopt(m_handle, CURLOPT_WRITEDATA, this);
     curl_easy_setopt(m_handle, CURLOPT_HEADERFUNCTION, headerCallback);
     curl_easy_setopt(m_handle, CURLOPT_WRITEHEADER, this);
     curl_easy_setopt(m_handle, CURLOPT_SOCKOPTFUNCTION, sockOptCallback);
     curl_easy_setopt(m_handle, CURLOPT_SOCKOPTDATA, this);
     curl_easy_setopt(m_handle, CURLOPT_AUTOREFERER, 1);
     curl_easy_setopt(m_handle, CURLOPT_FOLLOWLOCATION, 0);
     curl_easy_setopt(m_handle, CURLOPT_DNS_CACHE_TIMEOUT,
kDNSCacheTimeout);
     curl_easy_setopt(m_handle, CURLOPT_NOSIGNAL, 1);
     curl_easy_setopt(m_handle, CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_1_1);
     curl_easy_setopt(m_handle, CURLOPT_SSL_VERIFYPEER, 1L);
     curl_easy_setopt(m_handle, CURLOPT_SSL_VERIFYHOST, 1L);
     curl_easy_setopt(m_handle, CURLOPT_SSL_CTX_FUNCTION,
sslContextCallback);
     curl_easy_setopt(m_handle, CURLOPT_SSL_CTX_DATA, this);
     curl_easy_setopt(m_handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
     curl_easy_setopt(m_handle, CURLOPT_USERNAME, request.getUsername());
     curl_easy_setopt(m_handle, CURLOPT_PASSWORD, request.getPassword());
     curl_easy_setopt(m_handle, CURLOPT_HTTPGET, true);

I'm testing this test case: http://test.webdav.org/auth-digest/

As I captured the packets, first time, it sent one request without the
degist credentials, the second time, it sent with the degist
credentials. I did only call the "curl_multi_add_handle" one time.

Can anyone help me?
Thanks.

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-17