diff options
Diffstat (limited to 'kioslave/http/kcookiejar')
-rw-r--r-- | kioslave/http/kcookiejar/kcookiejar.cpp | 60 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiejar.h | 6 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookieserver.cpp | 22 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookieserver.h | 12 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiewin.cpp | 30 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/netscape_cookie_spec.html | 8 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/rfc2109 | 20 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/rfc2965 | 28 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/tests/kcookiejartest.cpp | 20 |
9 files changed, 103 insertions, 103 deletions
diff --git a/kioslave/http/kcookiejar/kcookiejar.cpp b/kioslave/http/kcookiejar/kcookiejar.cpp index 555f8e897..909f92dcb 100644 --- a/kioslave/http/kcookiejar/kcookiejar.cpp +++ b/kioslave/http/kcookiejar/kcookiejar.cpp @@ -84,12 +84,12 @@ #define READ_BUFFER_SIZE 8192 #define IP_ADDRESS_EXPRESSION "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" -// Note with respect to TQString::tqfromLatin1( ) +// Note with respect to TQString::fromLatin1( ) // Cookies are stored as 8 bit data and passed to kio_http as // latin1 regardless of their actual encoding. // L1 is used to indicate latin1 constants -#define L1(x) TQString::tqfromLatin1(x) +#define L1(x) TQString::fromLatin1(x) template class TQPtrList<KHttpCookie>; template class TQPtrDict<KHttpCookieList>; @@ -154,9 +154,9 @@ KHttpCookie::KHttpCookie(const TQString &_host, // // Checks if a cookie has been expired // -bool KHttpCookie::isExpired(time_t tqcurrentDate) +bool KHttpCookie::isExpired(time_t currentDate) { - return (mExpireDate != 0) && (mExpireDate < tqcurrentDate); + return (mExpireDate != 0) && (mExpireDate < currentDate); } // @@ -194,14 +194,14 @@ bool KHttpCookie::match(const TQString &fqdn, const TQStringList &domains, if (fqdn != mHost) return false; } - else if (!domains.tqcontains(mDomain)) + else if (!domains.contains(mDomain)) { if (mDomain[0] == '.') return false; // Maybe the domain needs an extra dot. TQString domain = '.' + mDomain; - if ( !domains.tqcontains( domain ) ) + if ( !domains.contains( domain ) ) if ( fqdn != mDomain ) return false; } @@ -261,7 +261,7 @@ KCookieJar::KCookieJar() for(TQStringList::ConstIterator it = countries.begin(); it != countries.end(); ++it) { - m_twoLevelTLD.tqreplace(*it, (int *) 1); + m_twoLevelTLD.replace(*it, (int *) 1); } } @@ -301,7 +301,7 @@ static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie *cookiePt it != cookie->windowIds().end(); ++it) { long windowId = *it; - if (windowId && (cookiePtr->windowIds().tqfind(windowId) == cookiePtr->windowIds().end())) + if (windowId && (cookiePtr->windowIds().find(windowId) == cookiePtr->windowIds().end())) { cookiePtr->windowIds().append(windowId); } @@ -325,7 +325,7 @@ static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie *cookiePt // Returned is a string containing all appropriate cookies in a format // which can be added to a HTTP-header without any additional processing. // -TQString KCookieJar::tqfindCookies(const TQString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies) +TQString KCookieJar::findCookies(const TQString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies) { TQString cookieStr; TQStringList domains; @@ -337,10 +337,10 @@ TQString KCookieJar::tqfindCookies(const TQString &_url, bool useDOMFormat, long if (!parseURL(_url, fqdn, path)) return cookieStr; - bool secureRequest = (_url.tqfind( L1("https://"), 0, false) == 0 || - _url.tqfind( L1("webdavs://"), 0, false) == 0); + bool secureRequest = (_url.find( L1("https://"), 0, false) == 0 || + _url.find( L1("webdavs://"), 0, false) == 0); - // kdDebug(7104) << "tqfindCookies: URL= " << _url << ", secure = " << secureRequest << endl; + // kdDebug(7104) << "findCookies: URL= " << _url << ", secure = " << secureRequest << endl; extractDomains(fqdn, domains); @@ -399,7 +399,7 @@ TQString KCookieJar::tqfindCookies(const TQString &_url, bool useDOMFormat, long continue; } - if (windowId && (cookie->windowIds().tqfind(windowId) == cookie->windowIds().end())) + if (windowId && (cookie->windowIds().find(windowId) == cookie->windowIds().end())) { cookie->windowIds().append(windowId); } @@ -479,7 +479,7 @@ static const char * parseNameValue(const char *header, // No '=' sign -> use string as the value, name is empty // (behavior found in Mozilla and IE) Name = ""; - Value = TQString::tqfromLatin1(header); + Value = TQString::fromLatin1(header); Value.truncate( s - header ); Value = Value.stripWhiteSpace(); return (s); @@ -516,12 +516,12 @@ static const char * parseNameValue(const char *header, if ((*s=='\0') || (*s=='\n')) { // End of Name - Value = TQString::tqfromLatin1(header); + Value = TQString::fromLatin1(header); Value.truncate(s - header); return (s); } } - Value = TQString::tqfromLatin1(header); + Value = TQString::fromLatin1(header); // *s == '\"'; if (keepQuotes) Value.truncate( ++s - header ); @@ -542,7 +542,7 @@ static const char * parseNameValue(const char *header, while ((*s != '\0') && (*s != ';') && (*s != '\n')) s++; // End of Name - Value = TQString::tqfromLatin1(header); + Value = TQString::fromLatin1(header); Value.truncate( s - header ); Value = Value.stripWhiteSpace(); } @@ -591,7 +591,7 @@ bool KCookieJar::parseURL(const TQString &_url, // Cookie spoofing protection. Since there is no way a path separator // or escape encoded character is allowed in the hostname according // to RFC 2396, reject attempts to include such things there! - if(_fqdn.tqfind('/') > -1 || _fqdn.tqfind('%') > -1) + if(_fqdn.find('/') > -1 || _fqdn.find('%') > -1) { return false; // deny everything!! } @@ -620,7 +620,7 @@ void KCookieJar::extractDomains(const TQString &_fqdn, // Return numeric IPv4 addresses as is... if ((_fqdn[0] >= '0') && (_fqdn[0] <= '9')) { - if (_fqdn.tqfind(TQRegExp(IP_ADDRESS_EXPRESSION)) > -1) + if (_fqdn.find(TQRegExp(IP_ADDRESS_EXPRESSION)) > -1) { _domains.append( _fqdn ); return; @@ -683,7 +683,7 @@ void KCookieJar::extractDomains(const TQString &_fqdn, */ static TQString fixupDateTime(const TQString& dt) { - const int index = dt.tqfind(TQRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); + const int index = dt.find(TQRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); if (index > -1) { @@ -694,7 +694,7 @@ static TQString fixupDateTime(const TQString& dt) dateStrList[0] = dateStrList[1]; dateStrList[1] = date; date = dt; - return date.tqreplace(index, date.length(), dateStrList.join(" ")); + return date.replace(index, date.length(), dateStrList.join(" ")); } } @@ -729,7 +729,7 @@ KHttpCookieList KCookieJar::makeCookies(const TQString &_url, return KHttpCookieList(); } TQString defaultPath; - int i = path.tqfindRev('/'); + int i = path.findRev('/'); if (i > 0) defaultPath = path.left(i); @@ -811,7 +811,7 @@ KHttpCookieList KCookieJar::makeCookies(const TQString &_url, if(dom.length() > 2 && dom[dom.length()-1] == '.') dom = dom.left(dom.length()-1); - if(dom.tqcontains('.') > 1 || dom == ".local") + if(dom.contains('.') > 1 || dom == ".local") lastCookie->mDomain = dom; } else if (cName == "max-age") @@ -1020,7 +1020,7 @@ KCookieAdvice KCookieJar::cookieAdvice(KHttpCookiePtr cookiePtr) // cross-site cookie injection. if (!cookiePtr->domain().isEmpty()) { - if (!domains.tqcontains(cookiePtr->domain()) && + if (!domains.contains(cookiePtr->domain()) && !cookiePtr->domain().endsWith("."+cookiePtr->host())) cookiePtr->fixDomain(TQString::null); } @@ -1457,11 +1457,11 @@ bool KCookieJar::loadCookies(const TQString &_filename) if ((expDate == 0) || (expDate < curTime)) continue; - KHttpCookie *cookie = new KHttpCookie(TQString::tqfromLatin1(host), - TQString::tqfromLatin1(domain), - TQString::tqfromLatin1(path), - TQString::tqfromLatin1(name), - TQString::tqfromLatin1(value), + KHttpCookie *cookie = new KHttpCookie(TQString::fromLatin1(host), + TQString::fromLatin1(domain), + TQString::fromLatin1(path), + TQString::fromLatin1(name), + TQString::fromLatin1(value), expDate, protVer, secure, httpOnly, explicitPath); addCookie(cookie); @@ -1546,7 +1546,7 @@ void KCookieJar::loadConfig(KConfig *_config, bool reparse ) { const TQString &value = *it++; - int sepPos = value.tqfindRev(':'); + int sepPos = value.findRev(':'); if (sepPos <= 0) continue; diff --git a/kioslave/http/kcookiejar/kcookiejar.h b/kioslave/http/kcookiejar/kcookiejar.h index 32bd5e8c1..eb64485ea 100644 --- a/kioslave/http/kcookiejar/kcookiejar.h +++ b/kioslave/http/kcookiejar/kcookiejar.h @@ -89,7 +89,7 @@ public: time_t expireDate(void) { return mExpireDate; } int protocolVersion(void) { return mProtocolVersion; } bool isSecure(void) { return mSecure; } - bool isExpired(time_t tqcurrentDate); + bool isExpired(time_t currentDate); bool isCrossDomain(void) { return mCrossDomain; } bool isHttpOnly(void) { return mHttpOnly; } bool hasExplicitPath(void) { return mExplicitPath; } @@ -160,11 +160,11 @@ public: * * If @p useDOMFormat is true, the string is formatted in a format * in compliance with the DOM standard. - * @p pendingCookies tqcontains a list of cookies that have not been + * @p pendingCookies contains a list of cookies that have not been * approved yet by the user but that will be included in the result * none the less. */ - TQString tqfindCookies(const TQString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies=0); + TQString findCookies(const TQString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies=0); /** * This function parses cookie_headers and returns a linked list of diff --git a/kioslave/http/kcookiejar/kcookieserver.cpp b/kioslave/http/kcookiejar/kcookieserver.cpp index 884f08877..e6469f127 100644 --- a/kioslave/http/kcookiejar/kcookieserver.cpp +++ b/kioslave/http/kcookiejar/kcookieserver.cpp @@ -277,7 +277,7 @@ void KCookieServer::checkCookies( KHttpCookieList *cookieList) { TQCString replyType; TQByteArray replyData; - TQString res = mCookieJar->tqfindCookies( request->url, request->DOM, request->windowId ); + TQString res = mCookieJar->findCookies( request->url, request->DOM, request->windowId ); TQDataStream stream2(replyData, IO_WriteOnly); stream2 << res; @@ -369,14 +369,14 @@ bool KCookieServer::cookieMatches( KHttpCookiePtr c, // DCOP function QString -KCookieServer::tqfindCookies(TQString url) +KCookieServer::findCookies(TQString url) { - return tqfindCookies(url, 0); + return findCookies(url, 0); } // DCOP function QString -KCookieServer::tqfindCookies(TQString url, long windowId) +KCookieServer::findCookies(TQString url, long windowId) { if (cookiesPending(url)) { @@ -390,7 +390,7 @@ KCookieServer::tqfindCookies(TQString url, long windowId) return TQString::null; // Talk to you later :-) } - TQString cookies = mCookieJar->tqfindCookies(url, false, windowId); + TQString cookies = mCookieJar->findCookies(url, false, windowId); if (mCookieJar->changed()) saveCookieJar(); @@ -400,7 +400,7 @@ KCookieServer::tqfindCookies(TQString url, long windowId) // DCOP function QStringList -KCookieServer::tqfindDomains() +KCookieServer::findDomains() { TQStringList result; const TQStringList domains = mCookieJar->getDomainList(); @@ -418,7 +418,7 @@ KCookieServer::tqfindDomains() // DCOP function QStringList -KCookieServer::tqfindCookies(TQValueList<int> fields, +KCookieServer::findCookies(TQValueList<int> fields, TQString domain, TQString fqdn, TQString path, @@ -450,14 +450,14 @@ KCookieServer::tqfindCookies(TQValueList<int> fields, // DCOP function QString -KCookieServer::tqfindDOMCookies(TQString url) +KCookieServer::findDOMCookies(TQString url) { - return tqfindDOMCookies(url, 0); + return findDOMCookies(url, 0); } // DCOP function QString -KCookieServer::tqfindDOMCookies(TQString url, long windowId) +KCookieServer::findDOMCookies(TQString url, long windowId) { // We don't wait for pending cookies because it locks up konqueror // which can cause a deadlock if it happens to have a popup-menu up. @@ -465,7 +465,7 @@ KCookieServer::tqfindDOMCookies(TQString url, long windowId) KHttpCookieList pendingCookies; cookiesPending(url, &pendingCookies); - return mCookieJar->tqfindCookies(url, true, windowId, &pendingCookies); + return mCookieJar->findCookies(url, true, windowId, &pendingCookies); } // DCOP function diff --git a/kioslave/http/kcookiejar/kcookieserver.h b/kioslave/http/kcookiejar/kcookieserver.h index 042d75521..0c36f10b1 100644 --- a/kioslave/http/kcookiejar/kcookieserver.h +++ b/kioslave/http/kcookiejar/kcookieserver.h @@ -45,12 +45,12 @@ public: ~KCookieServer(); k_dcop: - TQString tqfindCookies(TQString); - TQString tqfindCookies(TQString, long); - TQStringList tqfindDomains(); - TQStringList tqfindCookies(TQValueList<int>,TQString,TQString,TQString,TQString); - TQString tqfindDOMCookies(TQString); - TQString tqfindDOMCookies(TQString, long); + TQString findCookies(TQString); + TQString findCookies(TQString, long); + TQStringList findDomains(); + TQStringList findCookies(TQValueList<int>,TQString,TQString,TQString,TQString); + TQString findDOMCookies(TQString); + TQString findDOMCookies(TQString, long); void addCookies(TQString, TQCString, long); void deleteCookie(TQString, TQString, TQString, TQString); void deleteCookiesFromDomain(TQString); diff --git a/kioslave/http/kcookiejar/kcookiewin.cpp b/kioslave/http/kcookiejar/kcookiewin.cpp index f0d29b05a..2c11c33cb 100644 --- a/kioslave/http/kcookiejar/kcookiewin.cpp +++ b/kioslave/http/kcookiejar/kcookiewin.cpp @@ -93,17 +93,17 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, } # endif #endif - // Main widget's tqlayout manager... - TQVBoxLayout* vtqlayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - vtqlayout->setResizeMode( TQLayout::Fixed ); + // Main widget's layout manager... + TQVBoxLayout* vlayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + vlayout->setResizeMode( TQLayout::Fixed ); // Cookie image and message to user TQHBox* hBox = new TQHBox( this ); hBox->setSpacing( KDialog::spacingHint() ); TQLabel* icon = new TQLabel( hBox ); icon->setPixmap( TQMessageBox::standardIcon(TQMessageBox::Warning) ); - icon->tqsetAlignment( Qt::AlignCenter ); - icon->setFixedSize( 2*icon->tqsizeHint() ); + icon->setAlignment( Qt::AlignCenter ); + icon->setFixedSize( 2*icon->sizeHint() ); int count = cookieList.count(); @@ -111,11 +111,11 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, TQString txt = i18n("You received a cookie from", "You received %n cookies from", count); TQLabel* lbl = new TQLabel( txt, vBox ); - lbl->tqsetAlignment( Qt::AlignCenter ); + lbl->setAlignment( Qt::AlignCenter ); KHttpCookiePtr cookie = cookieList.first(); TQString host (cookie->host()); - int pos = host.tqfind(':'); + int pos = host.find(':'); if ( pos > 0 ) { TQString portNum = host.left(pos); @@ -128,14 +128,14 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, if (cookie->isCrossDomain()) txt += i18n(" <b>[Cross Domain!]</b>"); lbl = new TQLabel( txt, vBox ); - lbl->tqsetAlignment( Qt::AlignCenter ); + lbl->setAlignment( Qt::AlignCenter ); lbl = new TQLabel( i18n("Do you want to accept or reject?"), vBox ); - lbl->tqsetAlignment( Qt::AlignCenter ); - vtqlayout->addWidget( hBox, 0, Qt::AlignLeft ); + lbl->setAlignment( Qt::AlignCenter ); + vlayout->addWidget( hBox, 0, Qt::AlignLeft ); // Cookie Details dialog... m_detailView = new KCookieDetail( cookieList, count, this ); - vtqlayout->addWidget( m_detailView ); + vlayout->addWidget( m_detailView ); m_showDetails = showDetails; m_showDetails ? m_detailView->show():m_detailView->hide(); @@ -168,7 +168,7 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, "<em>(see WebBrowsing/Cookies in the Control Center)</em>.") ); #endif m_btnGrp->insert( rb ); - vtqlayout->addWidget( m_btnGrp ); + vlayout->addWidget( m_btnGrp ); if ( defaultButton > -1 && defaultButton < 3 ) m_btnGrp->setButton( defaultButton ); @@ -202,8 +202,8 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, #endif - vtqlayout->addWidget( bbox ); - setFixedSize( tqsizeHint() ); + vlayout->addWidget( bbox ); + setFixedSize( sizeHint() ); } KCookieWin::~KCookieWin() @@ -313,7 +313,7 @@ KCookieDetail::KCookieDetail( KHttpCookieList cookieList, int cookieCount, if ( cookieCount > 1 ) { TQPushButton* btnNext = new TQPushButton( i18n("Next cookie","&Next >>"), this ); - btnNext->setFixedSize( btnNext->tqsizeHint() ); + btnNext->setFixedSize( btnNext->sizeHint() ); grid->addMultiCellWidget( btnNext, 8, 8, 0, 1 ); connect( btnNext, TQT_SIGNAL(clicked()), TQT_SLOT(slotNextCookie()) ); #ifndef QT_NO_TOOLTIP diff --git a/kioslave/http/kcookiejar/netscape_cookie_spec.html b/kioslave/http/kcookiejar/netscape_cookie_spec.html index afd1f1565..eb190f2e3 100644 --- a/kioslave/http/kcookiejar/netscape_cookie_spec.html +++ b/kioslave/http/kcookiejar/netscape_cookie_spec.html @@ -151,7 +151,7 @@ the URL request. The path "/foo" would match "/foobar" and "/foo/bar.html". The path "/" is the most general path. <P> If the <B>path</B> is not specified, it as assumed to be the same path -as the document being described by the header which tqcontains the cookie. +as the document being described by the header which contains the cookie. <P> <DT> <B>secure</B> <DD> @@ -223,16 +223,16 @@ as long as it is less than 4 kilobytes. <LI>If a CGI script wishes to delete a cookie, it can do so by returning a cookie with the same name, and an <B>expires</B> time which is in the past. The path and name must match exactly -in order for the expiring cookie to tqreplace the valid cookie. +in order for the expiring cookie to replace the valid cookie. This requirement makes it difficult for anyone but the originator of a cookie to delete a cookie. <P><LI>When caching HTTP, as a proxy server might do, the <B>Set-cookie</B> response header should never be cached. <P><LI>If a proxy server receives a response which -tqcontains a <B>Set-cookie</B> header, it should propagate the <B>Set-cookie</B> +contains a <B>Set-cookie</B> header, it should propagate the <B>Set-cookie</B> header to the client, regardless of whether the response was 304 (Not Modified) or 200 (OK). -<P>Similarly, if a client request tqcontains a Cookie: header, it +<P>Similarly, if a client request contains a Cookie: header, it should be forwarded through a proxy, even if the conditional If-modified-since request is being made. </UL> diff --git a/kioslave/http/kcookiejar/rfc2109 b/kioslave/http/kcookiejar/rfc2109 index 86a4fc7e9..432fdcc6e 100644 --- a/kioslave/http/kcookiejar/rfc2109 +++ b/kioslave/http/kcookiejar/rfc2109 @@ -13,7 +13,7 @@ Category: Standards Track L. Montulli HTTP State Management Mechanism -tqStatus of this Memo +Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for @@ -374,7 +374,7 @@ RFC 2109 HTTP State Management Mechanism February 1997 * The value for the Path attribute is not a prefix of the request- URI. - * The value for the Domain attribute tqcontains no embedded dots or + * The value for the Domain attribute contains no embedded dots or does not start with a dot. * The value for the request-host does not domain-match the Domain @@ -382,12 +382,12 @@ RFC 2109 HTTP State Management Mechanism February 1997 * The request-host is a FQDN (not IP address) and has the form HD, where D is the value of the Domain attribute, and H is a string - that tqcontains one or more dots. + that contains one or more dots. Examples: * A Set-Cookie from request-host y.x.foo.com for Domain=.foo.com - would be rejected, because H is y.x and tqcontains a dot. + would be rejected, because H is y.x and contains a dot. @@ -433,7 +433,7 @@ RFC 2109 HTTP State Management Mechanism February 1997 checkbox (or, conversely, its immediate destruction). Privacy considerations dictate that the user have considerable - control over cookie management. The PRIVACY section tqcontains more + control over cookie management. The PRIVACY section contains more information. 4.3.4 Sending Cookies to the Origin Server @@ -666,7 +666,7 @@ RFC 2109 HTTP State Management Mechanism February 1997 Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme" - Shopping basket tqcontains an item. + Shopping basket contains an item. @@ -714,7 +714,7 @@ RFC 2109 HTTP State Management Mechanism February 1997 each of which it receives a new cookie. All the cookies have the same Path attribute and (default) domain. Because the request URLs all have /acme as a prefix, and that matches the Path attribute, each - request tqcontains all the cookies received so far. + request contains all the cookies received so far. 5.2 Example 2 @@ -803,7 +803,7 @@ RFC 2109 HTTP State Management Mechanism February 1997 inherently. For example, if a shopping-basket-style application always displays a user's current basket contents on each page, those pages cannot be cached, because each user's basket's contents would - be different. On the other hand, if each page tqcontains just a link + be different. On the other hand, if each page contains just a link that allows the user to "Look at My Shopping Basket", the page can be cached. @@ -862,7 +862,7 @@ RFC 2109 HTTP State Management Mechanism February 1997 of a user through the server. Users may object to this behavior as an intrusive accumulation of information, even if their identity is not evident. (Identity might become evident if a user subsequently - fills out a form that tqcontains identifying information.) This state + fills out a form that contains identifying information.) This state management specification therefore requires that a user agent give the user control over such a possible intrusion, although the interface through which the user is given this control is left @@ -1053,7 +1053,7 @@ RFC 2109 HTTP State Management Mechanism February 1997 Wdy, DD-Mon-YY HH:MM:SS GMT - Note that the Expires date format tqcontains embedded spaces, and that + Note that the Expires date format contains embedded spaces, and that "old" cookies did not have quotes around values. Clients that implement to this specification should be aware of "old" cookies and Expires. diff --git a/kioslave/http/kcookiejar/rfc2965 b/kioslave/http/kcookiejar/rfc2965 index 1de450b13..8a4d02b17 100644 --- a/kioslave/http/kcookiejar/rfc2965 +++ b/kioslave/http/kcookiejar/rfc2965 @@ -13,7 +13,7 @@ Category: Standards Track Epinions.com, Inc. HTTP State Management Mechanism -tqStatus of this Memo +Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for @@ -71,7 +71,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 request line. Note that request-host is a HN. The term effective host name is related to host name. If a host name - tqcontains no dots, the effective host name is that name with the + contains no dots, the effective host name is that name with the string .local appended to it. Otherwise the effective host name is the same as the host name. Note that all effective host names contain at least one dot. @@ -472,7 +472,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 * The value for the Path attribute is not a prefix of the request-URI. - * The value for the Domain attribute tqcontains no embedded dots, + * The value for the Domain attribute contains no embedded dots, and the value is not .local. * The effective host name that derives from the request-host does @@ -480,7 +480,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 * The request-host is a HDN (not IP address) and has the form HD, where D is the value of the Domain attribute, and H is a string - that tqcontains one or more dots. + that contains one or more dots. * The Port attribute has a "port-list", and the request-port was not in the list. @@ -488,7 +488,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 Examples: * A Set-Cookie2 from request-host y.x.foo.com for Domain=.foo.com - would be rejected, because H is y.x and tqcontains a dot. + would be rejected, because H is y.x and contains a dot. * A Set-Cookie2 from request-host x.foo.com for Domain=.foo.com would be accepted. @@ -548,7 +548,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 response header, whether or not to accept the cookie. A potentially confusing situation could arise if the following sequence occurs: - * the user agent receives a cookie that tqcontains a CommentURL + * the user agent receives a cookie that contains a CommentURL attribute; * the user agent's cookie inspection interface is configured so @@ -585,7 +585,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 immediate destruction). Privacy considerations dictate that the user have considerable - control over cookie management. The PRIVACY section tqcontains more + control over cookie management. The PRIVACY section contains more information. 3.3.4 Sending Cookies to the Origin Server When it sends a request @@ -693,7 +693,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 request header facilitates interoperation between clients and servers that understand different versions of the cookie specification. When the client sends one or more cookies to an origin server, if at least - one of those cookies tqcontains a $Version attribute whose value is + one of those cookies contains a $Version attribute whose value is different from the version that the client understands, then the client MUST also send a Cookie2 request header, the syntax for which is @@ -865,7 +865,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 Set-Cookie2: Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme" - Shopping basket tqcontains an item. + Shopping basket contains an item. 5. User Agent -> Server @@ -912,7 +912,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 each of which it receives a new cookie. All the cookies have the same Path attribute and (default) domain. Because the request-URIs all path-match /acme, the Path attribute of each cookie, each request - tqcontains all the cookies received so far. + contains all the cookies received so far. 4.2 Example 2 @@ -996,7 +996,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 inherently. For example, if a shopping-basket-style application always displays a user's current basket contents on each page, those pages cannot be cached, because each user's basket's contents would - be different. On the other hand, if each page tqcontains just a link + be different. On the other hand, if each page contains just a link that allows the user to "Look at My Shopping Basket", the page can be cached. @@ -1052,7 +1052,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 6. PRIVACY Informed consent should guide the design of systems that use cookies. - A user should be able to tqfind out how a web site plans to use + A user should be able to find out how a web site plans to use information in a cookie and should be able to choose whether or not those policies are acceptable. Both the user agent and the origin server must assist informed consent. @@ -1074,7 +1074,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 of a user through the server. Users may object to this behavior as an intrusive accumulation of information, even if their identity is not evident. (Identity might become evident, for example, if a user - subsequently fills out a form that tqcontains identifying information.) + subsequently fills out a form that contains identifying information.) This state management specification therefore requires that a user agent give the user control over such a possible intrusion, although the interface through which the user is given this control is left @@ -1267,7 +1267,7 @@ RFC 2965 HTTP State Management Mechanism October 2000 understand Cookie request headers that also follow this specification. - New cookies MUST tqreplace both equivalent old- and new-style cookies. + New cookies MUST replace both equivalent old- and new-style cookies. That is, if a user agent that follows both this specification and Netscape's original specification receives a Set-Cookie2 response header, and the NAME and the Domain and Path attributes match (per diff --git a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp index 53a039310..0ad238ab7 100644 --- a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp +++ b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp @@ -53,7 +53,7 @@ static void FAIL(const TQString &msg) static void popArg(TQCString &command, TQCString & line) { - int i = line.tqfind(' '); + int i = line.find(' '); if (i != -1) { command = line.left(i); @@ -69,15 +69,15 @@ static void popArg(TQCString &command, TQCString & line) static void popArg(TQString &command, TQCString & line) { - int i = line.tqfind(' '); + int i = line.find(' '); if (i != -1) { - command = TQString::tqfromLatin1(line.left(i)); + command = TQString::fromLatin1(line.left(i)); line = line.mid(i+1); } else { - command = TQString::tqfromLatin1(line); + command = TQString::fromLatin1(line); line = 0; } } @@ -128,8 +128,8 @@ static void processCookie(TQCString &line) if (url.isEmpty()) FAIL(TQString("Missing URL")); - line.tqreplace("%LASTYEAR%", *lastYear); - line.tqreplace("%NEXTYEAR%", *nextYear); + line.replace("%LASTYEAR%", *lastYear); + line.replace("%NEXTYEAR%", *nextYear); KHttpCookieList list = jar->makeCookies(urlStr, line, 0); @@ -158,9 +158,9 @@ static void processCheck(TQCString &line) if (url.isEmpty()) FAIL(TQString("Missing URL")); - TQString expectedCookies = TQString::tqfromLatin1(line); + TQString expectedCookies = TQString::fromLatin1(line); - TQString cookies = jar->tqfindCookies(urlStr, false, 0, 0).stripWhiteSpace(); + TQString cookies = jar->findCookies(urlStr, false, 0, 0).stripWhiteSpace(); if (cookies != expectedCookies) FAIL(urlStr+TQString("\nGot '%1' expected '%2'") .arg(cookies, expectedCookies)); @@ -246,8 +246,8 @@ int main(int argc, char *argv[]) TQCString arg2; TQString result; - lastYear = new TQCString(TQString("Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::tqcurrentDate().year()-1).utf8()); - nextYear = new TQCString(TQString(" expires=Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::tqcurrentDate().year()+1).utf8()); + lastYear = new TQCString(TQString("Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::currentDate().year()-1).utf8()); + nextYear = new TQCString(TQString(" expires=Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::currentDate().year()+1).utf8()); KAboutData about("kcookietest", "kcookietest", "1.0", description, KAboutData::License_GPL, "(C) 2004 Waldo Bastian"); KCmdLineArgs::init( argc, argv, &about); |