Fix sending and receiving cookies
This commit is contained in:
parent
db2cee5b84
commit
e14c131332
2 changed files with 7 additions and 2 deletions
|
@ -416,6 +416,8 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
receiveCookies(_CurlWWW->Request, HTTPCurrentDomain, _TrustedDomain);
|
||||||
|
|
||||||
// redirect, get the location and try browse again
|
// redirect, get the location and try browse again
|
||||||
// we cant use curl redirection because 'addHTTPGetParams()' must be called on new destination
|
// we cant use curl redirection because 'addHTTPGetParams()' must be called on new destination
|
||||||
std::string location(_CurlWWW->getLocationHeader());
|
std::string location(_CurlWWW->getLocationHeader());
|
||||||
|
@ -441,6 +443,8 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
receiveCookies(_CurlWWW->Request, HTTPCurrentDomain, _TrustedDomain);
|
||||||
|
|
||||||
_RedirectsRemaining = DEFAULT_RYZOM_REDIRECT_LIMIT;
|
_RedirectsRemaining = DEFAULT_RYZOM_REDIRECT_LIMIT;
|
||||||
|
|
||||||
if ( (code < 200 || code >= 300) )
|
if ( (code < 200 || code >= 300) )
|
||||||
|
@ -449,8 +453,6 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
receiveCookies(_CurlWWW->Request, HTTPCurrentDomain, _TrustedDomain);
|
|
||||||
|
|
||||||
char *ch;
|
char *ch;
|
||||||
std::string contentType;
|
std::string contentType;
|
||||||
res = curl_easy_getinfo(_CurlWWW->Request, CURLINFO_CONTENT_TYPE, &ch);
|
res = curl_easy_getinfo(_CurlWWW->Request, CURLINFO_CONTENT_TYPE, &ch);
|
||||||
|
|
|
@ -387,6 +387,9 @@ namespace NLGUI
|
||||||
// add all cookies for domain to curl handle
|
// add all cookies for domain to curl handle
|
||||||
void sendCookies(CURL *curl, const std::string &domain, bool trusted)
|
void sendCookies(CURL *curl, const std::string &domain, bool trusted)
|
||||||
{
|
{
|
||||||
|
// enable curl cookie engine
|
||||||
|
curl_easy_setopt(curl, CURLOPT_COOKIELIST, "");
|
||||||
|
|
||||||
if (domain.empty())
|
if (domain.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue