本文整理汇总了C++中Cookie::GetHaveAuthentication方法的典型用法代码示例。如果您正苦于以下问题:C++ Cookie::GetHaveAuthentication方法的具体用法?C++ Cookie::GetHaveAuthentication怎么用?C++ Cookie::GetHaveAuthentication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::GetHaveAuthentication方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCookieL
Cookie* CookiePath::GetCookieL(Cookie_Item_Handler *params, BOOL create)
{
Cookie* ck = LocalGetCookie(params->name);
if (!create)
return ck;
if (ck)
{
#ifdef _ASK_COOKIE
ServerName *servername = (ServerName *) params->url->GetAttribute(URL::KServerName, (const void*) 0);
COOKIE_DELETE_ON_EXIT_MODE disc_mode = (servername ? servername->GetDeleteCookieOnExit(TRUE) : COOKIE_EXIT_DELETE_DEFAULT);
BOOL default_disc_mode = (BOOL) g_pcnet->GetIntegerPref(PrefsCollectionNetwork::AcceptCookiesSessionOnly);
if(
((default_disc_mode && disc_mode != COOKIE_NO_DELETE_ON_EXIT) ||
(!default_disc_mode && disc_mode == COOKIE_DELETE_ON_EXIT))&&
!params->flags.discard_at_exit && !ck->DiscardAtExit())
params->flags.discard_at_exit= TRUE;
#endif
if(!params->flags.accept_updates)
params->flags.accept_updates = ck->AcceptUpdates();
if(!params->flags.accepted_as_third_party)
params->flags.accepted_as_third_party = ck->GetAcceptedAsThirdParty();
if(!params->flags.have_password)
params->flags.have_password = ck->GetHavePassword();
if(!params->flags.have_authentication)
params->flags.have_authentication = ck->GetHaveAuthentication();
OP_DELETE(ck);
// *** Don't save an expired cookie.
if(params->expire && params->expire <
(time_t) (g_op_time_info->GetTimeUTC()/1000.0)
)
return NULL;
}
ck = Cookie::CreateL(params);
ck->Into(&cookie_list);
return ck;
}
示例2: if
//.........这里部分代码省略.........
{
int buf_used = 0;
char* buf_p = buf;
Cookie* ck = (Cookie*) cookie_list.First();
while (ck)
{
Cookie* next_ck = ck->Suc();
if (ck->Expires() && ck->Expires() < this_time)
{
OP_DELETE(ck);
}
else if ((is_secure || !ck->Secure()) &&
(for_http || !ck->HTTPOnly()) &&
(is_full_path || !ck->FullPathOnly())
&& (is_server || !ck->SendOnlyToServer()) &&
(ck->Version() == 0 || ck->CheckPort(port)) &&
(!third_party_only || ck->GetAcceptedAsThirdParty()) &&
(allow_dollar_cookies || *ck->Name().CStr() != '$')
)
{
int name_len = ck->Name().Length();
int value_len = ck->Value().Length();
int ver = ck->Version();
if(version > ver)
version = ver;
if(ver > max_version)
max_version = ver;
if (ck->GetCookieType() == COOKIE2_COOKIE)
seen_cookie2 = TRUE;
int dom_len = (ver ? ck->Received_Domain().Length() : 0) ;
int path_len = (ver && ck->Received_Path().HasContent() ? ck->Received_Path().Length()+1: 0) ;
int port_len = (ver ? (ck->Port().HasContent() ? ck->Port().Length() : (ck->PortReceived() ? 1 : 0)) : 0) ;
if ((name_len + value_len + 3 +
(dom_len ? dom_len + 10 : 0) +
(path_len ? path_len + 8 : 0) +
(port_len ? port_len + 8 : 0)) < buf_len - buf_used)
{
if (buf_used)
BufferAppend(buf_p, "; ", 2);
BufferAppend(buf_p, ck->Name().CStr());
if (value_len > 0 || ck->Assigned())
{
*buf_p++ = '=';
BufferAppend(buf_p, ck->Value().CStr());
}
if(ver > 0)
{
if(path_len)
{
BufferAppend(buf_p, "; $Path=\"");
BufferAppend(buf_p, ck->Received_Path().CStr());
*buf_p++ = '"';
*buf_p = '\0';
}
if(dom_len)
{
BufferAppend(buf_p, "; $Domain=");
BufferAppend(buf_p, ck->Received_Domain().CStr());
}
if(ck->PortReceived())
{
if(ck->Port().CStr())
{
BufferAppend(buf_p, "; $Port=\"");
BufferAppend(buf_p, ck->Port().CStr());
*buf_p++ = '"';
*buf_p = '\0';
}
else
BufferAppend(buf_p, "; $Port");
}
}
if(g_pcnet->GetIntegerPref(PrefsCollectionNetwork::TagUrlsUsingPasswordRelatedCookies))
{
if(ck->GetHavePassword())
have_password = TRUE;
if(ck->GetHaveAuthentication())
have_authentication = TRUE;
if(already_have_password)
ck->SetHavePassword(TRUE);
if(already_have_authentication)
ck->SetHaveAuthentication(TRUE);
}
buf_used = buf_p - buf;
ck->SetLastUsed(this_time);
}
}
ck = next_ck;
}
return buf_used;
}