~ubuntu-branches/ubuntu/quantal/aria2/quantal

« back to all changes in this revision

Viewing changes to src/CookieStorage.cc

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry
  • Date: 2011-05-26 22:22:12 UTC
  • mfrom: (2.5.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110526222212-8ck4ia81l227m44l
Tags: 1.11.2-1
* New upstream release
* debian/control:
  + Updated Standards-Version to 3.9.2
* debian/copyright:
  + Updated as per latest DEP-5 specification

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
  bool operator()
234
234
  (const CookiePathDivider& lhs, const CookiePathDivider& rhs) const
235
235
  {
236
 
    // Sort by path-length.
237
 
    //
238
 
    // RFC2965 says: Note that the NAME=VALUE pair for the cookie with
239
 
    // the more specific Path attribute, /acme/ammo, comes before the
240
 
    // one with the less specific Path attribute, /acme.  Further note
241
 
    // that the same cookie name appears more than once.
242
 
    //
243
 
    // Netscape spec says: When sending cookies to a server, all
244
 
    // cookies with a more specific path mapping should be sent before
245
 
    // cookies with less specific path mappings. For example, a cookie
246
 
    // "name1=foo" with a path mapping of "/" should be sent after a
247
 
    // cookie "name1=foo2" with a path mapping of "/bar" if they are
248
 
    // both to be sent.
249
 
    //
250
 
    // See also http://tools.ietf.org/html/draft-ietf-httpstate-cookie-14
251
 
    // section5.4
 
236
    // From http://tools.ietf.org/html/rfc6265#section-5.4:
 
237
    // 2.  The user agent SHOULD sort the cookie-list in the following
 
238
    //    order:
 
239
    //
 
240
    //    *  Cookies with longer paths are listed before cookies with
 
241
    //       shorter paths.
 
242
    //
 
243
    //    *  Among cookies that have equal-length path fields, cookies with
 
244
    //       earlier creation-times are listed before cookies with later
 
245
    //       creation-times.
252
246
    return lhs.pathDepth_ > rhs.pathDepth_ ||
253
247
      (!(rhs.pathDepth_ > lhs.pathDepth_) &&
254
248
       lhs.cookie_.getCreationTime() < rhs.cookie_.getCreationTime());