curl-library
Invalid proxy settings
Date: Wed, 1 Feb 2012 10:01:30 +0530
Hi All,
I have proxy server(Squid) with IP address of 192.168.1.12.
In my curl code I use following code to set proxy settings:
curl_easy_setopt(pCurl, CURLOPT_PROXY, proxyAddress);
curl_easy_setopt(pCurl, CURLOPT_PROXYPORT, port);
& check response code after execution using
curl_easy_getinfo(pCurl, CURLINFO_RESPONSE_CODE, &respCode); //If respCode
is 200 means Internet connectivity available
I have 3 cases to test this setup
1. Incorrect proxy server address:
If I provide proxy server address as "192.168.1.45" or "http://wrong.proxyserver.com", then
Response code is 0, means internet connection is not available.
2. Correct Proxy server address
If I provide proxy server address as "192.168.1.12", then
Response code is 200, means internet connection is available.
3. Invalid proxy server address
If I provide proxy server address as "/192.168.1.45" or "/./././", then
Response code is 200, means internet connection is available. But
here proxy is invalid, but still respCode return as 200.
This is buggy situation.
Please let me know how to resolve this issue(by doing some extra checks or
something).
Thanks & regards,
Chandrakant
::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.
-----------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-01