Rasheed
2007-07-29 12:19:52 UTC
hi All,
i am facing one problem i.e for an Invalid URL i am getting the non
zero handle values. here is my code for your understanding.
This is my Invalid URL:
http://www.google.co.in/sea123rch?hl=en&q=flow123ers&meta=
but when I am executing below code I am getting the
hConnect,hRequest,bResults value.
I know that I have to get the value of hConnect because there I am
sending the correct server name "www.google.co.in" value but in the
case of WinHttpOpenRequest(), has to give the
"ERROR_WINHTTP_INVALID_URL" error becuase i am giving wrong
objectname.
so I am still confuse how I am getting the non Zero value for
hRequest.
So can any body help me please.
hSession = WinHttpOpen(GetClientAgentName(),
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS, 0);
if( hSession )
{
hConnect = WinHttpConnect( hSession, pollAddress,
refPolicy.m_dwPort /*INTERNET_DEFAULT_HTTPS_PORT*/, 0);
//pollAddress is in this case : www.google.co.in
}
if( hConnect )
{
hRequest = WinHttpOpenRequest( hConnect,
refPolicy.m_strVerb.c_str(),
pUrl, /// "/sea123rch?hl=en&q=flow123ers&meta="
NULL,
WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
WINHTTP_FLAG_BYPASS_PROXY_CACHE );
}
if( hRequest )
{
WinHttpSetTimeouts(hRequest, pollingOptions.m_dwTimeout,
pollingOptions.m_dwTimeout,
pollingOptions.m_dwTimeout,
pollingOptions.m_dwTimeout);
bResults = WinHttpSendRequest( hRequest,
WINHTTP_NO_ADDITIONAL_HEADERS, 0,
WINHTTP_NO_REQUEST_DATA, 0,
0, 0 );
}
if( bResults )
{
bResults = WinHttpReceiveResponse( hRequest, NULL );
}
Regards,
Rs.
i am facing one problem i.e for an Invalid URL i am getting the non
zero handle values. here is my code for your understanding.
This is my Invalid URL:
http://www.google.co.in/sea123rch?hl=en&q=flow123ers&meta=
but when I am executing below code I am getting the
hConnect,hRequest,bResults value.
I know that I have to get the value of hConnect because there I am
sending the correct server name "www.google.co.in" value but in the
case of WinHttpOpenRequest(), has to give the
"ERROR_WINHTTP_INVALID_URL" error becuase i am giving wrong
objectname.
so I am still confuse how I am getting the non Zero value for
hRequest.
So can any body help me please.
hSession = WinHttpOpen(GetClientAgentName(),
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS, 0);
if( hSession )
{
hConnect = WinHttpConnect( hSession, pollAddress,
refPolicy.m_dwPort /*INTERNET_DEFAULT_HTTPS_PORT*/, 0);
//pollAddress is in this case : www.google.co.in
}
if( hConnect )
{
hRequest = WinHttpOpenRequest( hConnect,
refPolicy.m_strVerb.c_str(),
pUrl, /// "/sea123rch?hl=en&q=flow123ers&meta="
NULL,
WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
WINHTTP_FLAG_BYPASS_PROXY_CACHE );
}
if( hRequest )
{
WinHttpSetTimeouts(hRequest, pollingOptions.m_dwTimeout,
pollingOptions.m_dwTimeout,
pollingOptions.m_dwTimeout,
pollingOptions.m_dwTimeout);
bResults = WinHttpSendRequest( hRequest,
WINHTTP_NO_ADDITIONAL_HEADERS, 0,
WINHTTP_NO_REQUEST_DATA, 0,
0, 0 );
}
if( bResults )
{
bResults = WinHttpReceiveResponse( hRequest, NULL );
}
Regards,
Rs.