Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/network/access/qnetworkcookiejar.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4141
    4242#include "qnetworkcookiejar.h"
     43
    4344#include "qnetworkcookiejar_p.h"
    4445
     
    158159    url object.
    159160
    160     Returns true if one or more cookes are set for url otherwise false.
     161    Returns true if one or more cookies are set for \a url,
     162    otherwise false.
    161163
    162164    If a cookie already exists in the cookie jar, it will be
     
    209211            QString domain = cookie.domain();
    210212            if (!(isParentDomain(domain, defaultDomain)
    211                 || isParentDomain(defaultDomain, domain))) {
    212                     continue;           // not accepted
    213             }
    214 
    215             // reject if domain is like ".com"
    216             // (i.e., reject if domain does not contain embedded dots, see RFC 2109 section 4.3.2)
    217             // this is just a rudimentary check and does not cover all cases
    218             if (domain.lastIndexOf(QLatin1Char('.')) == 0)
    219                 continue;           // not accepted
    220 
     213                || isParentDomain(defaultDomain, domain)))
     214                continue; // not accepted
     215
     216            // the check for effective TLDs makes the "embedded dot" rule from RFC 2109 section 4.3.2
     217            // redundant; the "leading dot" rule has been relaxed anyway, see above
     218            // we remove the leading dot for this check
     219            if (QNetworkCookieJarPrivate::isEffectiveTLD(domain.remove(0, 1)))
     220                continue; // not accepted
    221221        }
    222222
     
    251251    differing paths, the one with longer path is returned before the
    252252    one with shorter path. In other words, this function returns
    253     cookies sorted by path length.
     253    cookies sorted by path length.
    254254
    255255    The default QNetworkCookieJar class implements only a very basic
     
    270270    QDateTime now = QDateTime::currentDateTime();
    271271    QList<QNetworkCookie> result;
     272
    272273
    273274    // scan our cookies for something that matches
     
    280281            continue;
    281282        if (!(*it).isSessionCookie() && (*it).expirationDate() < now)
     283
     284
    282285            continue;
    283286
     
    302305}
    303306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
    304346QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.